Project

General

Profile

mask out a region with CDO

Added by Victoria Naipal about 10 years ago

I have a netcdf file with a variable c(time,lat,lon), and I have another netcdf file with a masked region in it, it has a variable mask(lat,lon), which is 1 for the masked region in the file, all other values are no data.
Now I want to mask the same region out on my nc file with the variable c.
I tried cdo maskregion, but it didn't work.
How can I do this with cdo?


Replies (2)

RE: mask out a region with CDO - Added by Uwe Schulzweida about 10 years ago

You can use the CDO operator div to divide all variables in the first input file by a variable/mask in the second inputfile:

cdo div ifile1.nc ifile2.nc ofile.nc
All variables needs to have the same horizontal grid size.

RE: mask out a region with CDO - Added by Victoria Naipal about 10 years ago

thank you!!

    (1-2/2)