Skip to content
Snippets Groups Projects

Make sure TIFF files reflect NC file contents

Merged Tor-Einar Skog requested to merge iterativetest into main
1 file
+ 4
3
Compare changes
  • Side-by-side
  • Inline
+ 4
3
@@ -199,9 +199,10 @@ for timestep in timesteps:
@@ -199,9 +199,10 @@ for timestep in timesteps:
timestep_dates.append(file_date)
timestep_dates.append(file_date)
# If start_date is set, that means that we should only generate result files from that date on
# If start_date is set, that means that we should only generate result files from that date on
# -- IF GeoTIFF fiels already exists before that.
# -- IF GeoTIFF fiels already exists before that.
if start_date is not None and timestep_date < start_date:
# THERE IS A BUG IN THIS LOGIC, DISABLING FOR NOW
if os.path.isfile(f'{outfile_path}result_WARNING_STATUS_{file_date}.tif') and os.path.isfile(f'{outfile_path}result_{file_date}.tif'):
#if start_date is not None and timestep_date < start_date:
continue
# if os.path.isfile(f'{outfile_path}result_WARNING_STATUS_{file_date}.tif') and os.path.isfile(f'{outfile_path}result_{file_date}.tif'):
 
# continue
# Create NetCDF result file
# Create NetCDF result file
subprocess.run(f'cdo -s -seltimestep,{timestep_index}/{timestep_index} {tmpfile_path}result.nc {tmpfile_path}result_{file_date}.nc', shell=True)
subprocess.run(f'cdo -s -seltimestep,{timestep_index}/{timestep_index} {tmpfile_path}result.nc {tmpfile_path}result_{file_date}.nc', shell=True)
Loading