From 16317009366ad3f0b8572bd62e62d8910a0864bb Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Thu, 21 Sep 2023 21:12:23 +0200 Subject: [PATCH] Do not allow the first file to be missing --- Inst_eddies/inst_eddies.py.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Inst_eddies/inst_eddies.py.in b/Inst_eddies/inst_eddies.py.in index 203951a2..95807099 100644 --- a/Inst_eddies/inst_eddies.py.in +++ b/Inst_eddies/inst_eddies.py.in @@ -84,6 +84,14 @@ def loop_inst_eddies(files, bbox, d, my_slice): cropped_fname = f"SHPC/Slice_{my_slice}/cropped.nc" unpacked_fname = f"SHPC/Slice_{my_slice}/unpacked.nc" + # First file is out of the loop because it must be present: + nc_file = next(files) + print("inst_eddies.loop_inst_eddies: Date:", d) + print("inst_eddies.loop_inst_eddies: Input file:", nc_file, flush = True) + process_1_file(bbox, nco_instance, nc_file, cropped_fname, unpacked_fname, + inst_eddies_exe, d, my_slice, writer) + d += 1 + for nc_file in files: print("inst_eddies.loop_inst_eddies: Date:", d) print("inst_eddies.loop_inst_eddies: Input file:", nc_file, -- GitLab