Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
datacirco-prepare-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leximpact
DataCirco
datacirco-prepare-data
Commits
e99b7dbf
Commit
e99b7dbf
authored
3 months ago
by
Benoît Courty
Browse files
Options
Downloads
Patches
Plain Diff
Fix meteo
parent
449ba6d5
No related branches found
No related tags found
1 merge request
!56
Fix may 2025
Pipeline
#20372
failed
3 months ago
Stage: init
Stage: download
Stage: populate_db
Stage: export_json
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
downloads/meteo.py
+12
-2
12 additions, 2 deletions
downloads/meteo.py
with
12 additions
and
2 deletions
downloads/meteo.py
+
12
−
2
View file @
e99b7dbf
...
...
@@ -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
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment