diff --git a/src/config/floodscan.yml b/src/config/floodscan.yml index 0831683..3cce4da 100644 --- a/src/config/floodscan.yml +++ b/src/config/floodscan.yml @@ -5,7 +5,7 @@ forecast: False extra_dims: - band : str test: - start_date: 1981-01-01 + start_date: 1998-01-12 end_date: Null iso3s: ["BDI", "NGA", "TCD"] coverage: ["DZA", "AGO", "BEN", "BWA", "BFA", "BDI", "CPV", "CMR", "CAF", "TCD", "COM", "COG", "CIV", "CAP", "DJI", "EGY", "GNQ", "ERI", "SWZ", "ETH", "GAB", "GMB", "GHA", "GIN", "GNB", "KEN", "LS0", "LBR", "LBY", "MDG", "MWI", "MLI", "MRT", "MUS", "MAR", "MOZ", "NAM", "NER", "NGA", "RWA", "STP", "SEN", "SYC", "SLE", "SOM", "ZAF", "SSD", "SDN", "TGO", "TUN", "UGA", "TZA", "ZMB", "ZWE"] diff --git a/src/config/imerg.yml b/src/config/imerg.yml index 35d28d3..02844a5 100644 --- a/src/config/imerg.yml +++ b/src/config/imerg.yml @@ -3,6 +3,6 @@ start_date: 2000-06-01 end_date: Null forecast: False test: - start_date: 1981-01-01 + start_date: 2000-06-01 end_date: Null iso3s: ["BDI", "NGA", "TCD"] diff --git a/src/utils/cog_utils.py b/src/utils/cog_utils.py index 4f28c44..66a99a1 100644 --- a/src/utils/cog_utils.py +++ b/src/utils/cog_utils.py @@ -126,7 +126,7 @@ def process_floodscan(cog_name, mode): return da_in -def stack_cogs(start_date, end_date, dataset="era5", mode="dev"): +def stack_cogs(start_date, end_date, dataset, mode="dev"): """ Stack Cloud Optimized GeoTIFFs (COGs) for a specified date range into an xarray Dataset. @@ -173,11 +173,14 @@ def stack_cogs(start_date, end_date, dataset="era5", mode="dev"): cogs_list = [ x.name for x in container_client.list_blobs(name_starts_with=prefix) - if (parse_date(x.name) >= start_date) & (parse_date(x.name) <= end_date) # noqa + if (parse_date(x.name) >= start_date) + & (parse_date(x.name) <= end_date) # noqa ] if len(cogs_list) == 0: - raise Exception("No COGs found to process") + raise Exception( + f"No COGs found to process: {start_date} to {end_date}" + ) das = []