Project

General

Profile

convert all netcdf values > 0 to 1

Added by paolo de luca almost 4 years ago

Dear all,

I would like to apply the ERA5 land-sea mask (here attached) to some of my datasets. The mask has NaN set on the oceans, however it has some 0 < values < 1 over the coasts and lakes.

Since I am applying the mask using the function cdo mul I think that all the land values have to be = 1. Am I correct?

If this is the case, how can I convert all the land values (included coasts and lakes) to 1 with CDO?

Thanks for any help,
paolo

ERA5_land_sea_mask.nc (1.99 MB) ERA5_land_sea_mask.nc ERA5 land-sea mask

Replies (2)

RE: convert all netcdf values > 0 to 1 - Added by Karin Meier-Fleischer almost 4 years ago

Hi Pao,

you can do that with the gec operator

cdo -gec,0 ERA5_land_sea_mask.nc ERA5_land_sea_mask_all_ones.nc

-Karin

    (1-2/2)