retain all variables for conditional selection of one variable
Added by Kyle Clem over 4 years ago
Hello,
I have a dataset with 12 variables over time (attached). I would like to conditionally select all the variables/time steps based on a specified value range in one variable, landfall direction (land_ivt_dir). That is, retain all variables/time steps that meet the criteria:
80 < land_ivt_dir < 180
Does anyone know how to do this in CDO?
Thanks,
Kyle
lndfl_river_data.nc (262 KB) lndfl_river_data.nc |
Replies (2)
RE: retain all variables for conditional selection of one variable - Added by Ralf Mueller over 4 years ago
hi Kyle!
you can create a mask from your input
cdo expr,'mask=(80 < land_ivt_dir && land_ivt_dir < 180)' lndfl_river_data.nc mask.nc
After that you can apply that mask via division to create missing values
cdo div lndfl_river_data.nc mask.nc out.nc
hth
ralf
RE: retain all variables for conditional selection of one variable - Added by Kyle Clem over 4 years ago
Thank you very much Ralf!