Changes
Page history
Update Data treatment
authored
Nov 18, 2021
by
Marie Brunel
Show whitespace changes
Inline
Side-by-side
Data-treatment.md
View page @
b37cc608
-
[ ] add explanation for harvest convertion to yield
# Monthly runoff
# Monthly runoff
-
convert monthly runoff to annual by summing :
-
convert monthly runoff to annual by summing :
```
```
...
@@ -44,3 +42,11 @@ grid_surface = np.zeros((len(latitudes),len(longitudes))) # dim [30,33]
...
@@ -44,3 +42,11 @@ grid_surface = np.zeros((len(latitudes),len(longitudes))) # dim [30,33]
for lon,longitude in enumerate(longitudes) :
for lon,longitude in enumerate(longitudes) :
grid_surface[lat][lon] = 110 * 110 * math.cos(math.pi*latitude/180) * 1/2 * 1/2 * 100 #in ha
grid_surface[lat][lon] = 110 * 110 * math.cos(math.pi*latitude/180) * 1/2 * 1/2 * 100 #in ha
```
```
# Moving average
```
ma_harvest = []
window = 10
for y,year in enumerate(years[window:]):
ma_harvest.append(np.average(harvests_regions[id_region][y-window:y]))
ma_harvest = np.asarray(ma_harvest)
```