diff --git a/Inst_eddies/inst_eddies_in.py b/Inst_eddies/inst_eddies_in.py index 776b0bdd72581e28c56aeac588a7fa032bb46d6c..a0a2699767e6dc3a948898c1f25a68408e29b393 100755 --- a/Inst_eddies/inst_eddies_in.py +++ b/Inst_eddies/inst_eddies_in.py @@ -58,8 +58,8 @@ else: last_date = my_date for orient in ["cyclo", "anti"]: - if os.access(f"SHPC_{orient}_all_dates", os.F_OK): - shutil.rmtree(f"SHPC_{orient}_all_dates") + if os.access(f"SHPC_{orient}", os.F_OK): shutil.rmtree(f"SHPC_{orient}") + os.mkdir(f"SHPC_{orient}") perf_report = open("perf_report.csv", "w", newline='') writer = csv.writer(perf_report, lineterminator = "\n") @@ -83,8 +83,6 @@ while True: nc_file = "unpacked.nc" os.symlink(nc_file, "h.nc") os.symlink(nc_file, "uv.nc") - os.mkdir("SHPC_cyclo") - os.mkdir("SHPC_anti") elapsed_NCO = time.perf_counter() - my_pc with open("main_nml.txt") as nml_file: @@ -101,18 +99,10 @@ while True: my_pc = time.perf_counter() for orient in ["cyclo", "anti"]: - if os.access(f"SHPC_{orient}_all_dates", os.F_OK): - if os.access(f"SHPC_{orient}", os.F_OK): - shutil.rmtree(f"SHPC_{orient}") - - with open(f"SHPC_{orient}_all_dates/ishape_last.txt", "a") as \ - ishape_last, \ - shapefile.Reader(f"SHPC_{orient}_all_dates/extremum") as shpr: - n_shapes = len(shpr) - ishape_last.write(str(n_shapes - 1) + "\n") - else: - if os.access(f"SHPC_{orient}", os.F_OK): - os.rename(f"SHPC_{orient}", f"SHPC_{orient}_all_dates") + with open(f"SHPC_{orient}/ishape_last.txt", "a") as ishape_last, \ + shapefile.Reader(f"SHPC_{orient}/extremum") as shpr: + n_shapes = len(shpr) + ishape_last.write(str(n_shapes - 1) + "\n") elapsed_cat = time.perf_counter() - my_pc writer.writerow([my_date, elapsed_NCO, elapsed_Fortran, elapsed_cat])