Skip to content
Snippets Groups Projects
Commit 52fedc58 authored by benoit-cty's avatar benoit-cty
Browse files

Agrandi la zone

parent 4e2d21b7
Branches
No related tags found
1 merge request!52Prepare prod
Pipeline #19251 failed
......@@ -303,7 +303,7 @@ class GetMeteo:
avg(m.temperature) as temperature,
avg(m.precipitation) as precipitation
from zone_circo c
join meteo_era5_circo m on (ST_DWithin(c.wkb_geometry, m.geom, 0.15))
join meteo_era5_circo m on (ST_DWithin(c.wkb_geometry, m.geom, 0.20))
where ref = '{circo}'
and annee between 1991 and 2020
group by 1,2) as monthly
......@@ -339,7 +339,7 @@ class GetMeteo:
avg(m.temperature) as temperature,
avg(m.precipitation) as precipitation
from zone_circo c
join meteo_era5_circo m on (ST_DWithin(c.wkb_geometry, m.geom, 0.15))
join meteo_era5_circo m on (ST_DWithin(c.wkb_geometry, m.geom, 0.20))
where ref = '{circo}'
group by 1,2) as monthly
group by 1
......@@ -374,7 +374,7 @@ class GetMeteo:
FROM crosstab(
$$SELECT meteo.mois, meteo.annee, avg(meteo.temperature) as temperature FROM (
SELECT m.* FROM meteo_era5_circo m
JOIN zone_circo c on (ST_DWithin(c.wkb_geometry, m.geom, 0.15))
JOIN zone_circo c on (ST_DWithin(c.wkb_geometry, m.geom, 0.20))
where c.ref = '{circo}') as meteo
GROUP BY 1,2
ORDER BY 1,2$$,
......@@ -408,7 +408,7 @@ class GetMeteo:
FROM crosstab(
$$SELECT meteo.mois, meteo.annee, avg(meteo.precipitation) as precipitation FROM (
SELECT m.* FROM meteo_era5_circo m
JOIN zone_circo c on (ST_DWithin(c.wkb_geometry, m.geom, 0.15))
JOIN zone_circo c on (ST_DWithin(c.wkb_geometry, m.geom, 0.20))
where c.ref = '{circo}') as meteo
GROUP BY 1,2
ORDER BY 1,2$$,
......
......@@ -16,8 +16,7 @@ MONTH = [str(i + 1).zfill(2) for i in range(12)]
years = range(START_YEAR, END_YEAR + 1)
# year_month = [("1962","05"), ("2020","05")] # For testing
year_month = [(y, m) for y in years for m in MONTH]
len(year_month)
print(f"Processing {len(year_month)} months : {year_month}")
print(f"Processing {len(year_month)} months.")
def convert_crs(ds):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment