Skip to content
Snippets Groups Projects
Commit e99b7dbf authored by Benoît Courty's avatar Benoît Courty
Browse files

Fix meteo

parent 449ba6d5
No related branches found
No related tags found
1 merge request!56Fix may 2025
Pipeline #20372 failed
......@@ -18,6 +18,7 @@ import cdsapi
import humanize
import requests
from datacirco import utilitaires
import datetime
# Disable warning
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
......@@ -41,7 +42,7 @@ FORMAT = "netcdf"
# PRODUCT = 'reanalysis-era5-single-levels'
# TYPE = 'reanalysis'
# TYPE = 'ensemble_members'
TIME = [f"{i}:00".zfill(5) for i in range(24)]
# TIME = [f"{i}:00".zfill(5) for i in range(24)]
# Monthly
PRODUCT = "reanalysis-era5-single-levels-monthly-means"
......@@ -157,7 +158,16 @@ if __name__ == "__main__":
print(f"{DATA_DIR} don't exist !")
exit(1)
years = range(START_YEAR, END_YEAR + 1)
year_month = [(y, m) for y in years for m in MONTH]
current_year_now = datetime.datetime.now().year
last_month_now = datetime.datetime.now().month - 1
year_month = []
for y in years:
for m in MONTH:
# Stop at last month
if y < current_year_now or (
y == current_year_now and int(m) < last_month_now
):
year_month.append((y, m))
module = "meteo"
utilitaires.clear_dataset_source(module)
utilitaires.add_dataset_source(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment