Select precipitation >= 1 mm
Added by Florencia Iacovone over 3 years ago
Hello,
I have daily precipitation data in the trimester October-December, for the period 1981-2010, in South America. I want to select only pp>= 1 mm; and then calculate the 75th and 95th percentile.
Could someone help me?
I would appreciate it very much.
Thank you.
Replies (3)
RE: Select precipitation >= 1 mm - Added by Ralf Mueller over 3 years ago
hi!
there are multiple options
- use the netcdf variable attribute 'valid_range'
- multiply with a 0-1-mask computed from your input data using the 'gtc' operators
- set the range you want to exclude to missing values with 'setrtomiss'
hth
ralf
RE: Select precipitation >= 1 mm - Added by Maverick U about 2 years ago
Can you please write the cdo code for the same ?
RE: Select precipitation >= 1 mm - Added by Ralf Mueller about 2 years ago
ok, let me try.
I assume you have a file with precip in mm
called precip.nc
- Create the 0-1-mask for location with precip greater then 1mm being 1 and all other location set to 0
cdo -gtc,1 precip.nc precip_1mm_mask.nc
- Multiply the original data with this mask to set all data < 1mm to zero
cdo -mul precip.nc precip_gt1mm.nc
Please note, that this can also be done in a single command in case you don't need the mask for something else
cdo -mul -gtc,1 precip.nc precip.nc precip_gt1mm.nc
cheers
ralf