I recently started to use ERA5 land-hourly data and python code.
I will use data of 2 variables (total precipitation and 2 metre temperature) from an entire year (2017).
Data downloaded are in GRIB or netCDF format.
The things I want to do are:
1) Convert units. In the case of:
- Total precipitation - convert "m" into "mm"
- 2m temperature - convert "Kelvin" into "Celsius"
2) Convert hourly to daily values:
I've found the following code from ECMWF's offficial site: https://confluence.ecmwf.int/display/CKB/ERA5%3A+How+to+calculate+daily+total+precipitation Unfortunately, the code is designed only to compile daily values for one day (January 1st, 2017).
I want to convert all values for an entirely year. I know that (if I'm right):
- total precipitation presents acumulated values. So daily value is the sum of 24 hours.
- temperature presents mean values. So daily value is the mean of 24 hours.
3) Pick especific information from data files:
In order to do an analysis, I want to keep only information about:
- values
- latitude
- longitude
- time
for both variables (total precipitation and 2 metre temperature)
4) Convert GRIB or netCDF files into some format that can be read by Stata software
I really will appreciate any gesture of help