Update Data treatment authored by Marie Brunel's avatar Marie Brunel
# Monthly runoff into annual - [ ] add explanation for harvest convertion to yield
# Monthly runoff
- convert monthly runoff to annual by summing :
``` ```
if file_name == "mrunoff.nc": if file_name == "mrunoff.nc":
#convert number of months to years #convert number of months to years
nb_year = int(len(years)/12) nb_year = int(len(years)/12) #years in months here
tmp = np.zeros([nb_year,len(latitudes),len(longitudes)]) tmp = np.zeros([nb_year,len(latitudes),len(longitudes)])
#calculation of the sum over each year #calculation of the sum over each year
for k in range(0,nb_year,1): for k in range(0,nb_year,1):
tmp[k] = np.sum(data[k*12:k*12+12],axis=0) tmp[k] = np.sum(data[k*12:k*12+12],axis=0)
data = tmp data = tmp #[months,latitudes,longitudes]
```
# Harvest
- Convert harvest to yield :
```
yield = np.multiply(np.multiply(harvest,0.02222222),1.14)
``` ```
\ No newline at end of file
years,latitudes,longitudes = list from the file reading
data = numpy array from the reading of the file [months,latitudes,longitudes]
# harvest to yield
`yield = np.multiply(np.multiply(harvest,0.02222222),1.14)`
\ No newline at end of file