Project

General

Profile

Filtering dates based on multiple conditions

Added by Lyndon Mark Olaguera about 4 years ago

Dear CDO experts,

I have a netcdf file with daily rainfall data. I would like to select only the dates with rainfall above 5 mm/day over 120-122.5E and 10-20N and save it as a separate netcdf file.

I saw the gtc function, but this creates a netcdf file with 1 and 0 only. I would like to retain the data.

Is this possible in CDO? If yes, how can I do this correctly?

I'll appreciate any help.


Replies (1)

RE: Filtering dates based on multiple conditions - Added by Karin Meier-Fleischer about 4 years ago

Hi Lyndon,

cdo -sellonlatbox,120.,122.,10.,20. infile.nc tmp.nc

cdo -expr,'pr5 = ((pr >= 5)) ? pr : (pr/0.0)' tmp.nc outfile.nc

-Karin

    (1-1/1)