Commit 853b2814 authored by CEVAER's avatar CEVAER
Browse files

Added -1 to update all files in plots_from_netcdf.py

parent c1418f6f
......@@ -29,7 +29,7 @@ if __name__ == "__main__":
help="The base path where to save plot files")
parser.add_argument("-b", "--backend", action="store", default="bokeh", help="Backend to use for plotting")
parser.add_argument("-d", "--days", action="store", type=float, default=1,
help="Takes only files modified maximum n days ago")
help="Takes only files modified maximum n days ago. -1 means all")
parser.add_argument("--debug", action="store_true", default=False,
help="Enable debug logging level.")
......@@ -52,7 +52,7 @@ if __name__ == "__main__":
for f in files:
mod_epoch = os.path.getmtime(f)
mod_datetime = datetime.datetime.fromtimestamp(mod_epoch)
if (now - mod_datetime).total_seconds() < args.days * 24 * 3600:
if args.days == -1 or (now - mod_datetime).total_seconds() < args.days * 24 * 3600:
ds = xr.open_dataset(f)
logger.info(f"Processing {f}...")
source_sat = ds.attrs["Source satellite file"].replace("_sw", "_ll_gd")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment