Project

General

Profile

retain all variables for conditional selection of one variable

Added by Kyle Clem over 3 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


Replies (2)

RE: retain all variables for conditional selection of one variable - Added by Ralf Mueller over 3 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

    (1-2/2)