Project

General

Profile

Land-Sea Masking

Added by Theodoros Gkousarov almost 10 years ago

HI All,

First to mention that I ve gone through the forum threads and couldnt solve my issue.

I have one Land Sea mask file ( Sea=1 , Land =0) and one file with solar radiation values.

I need to mask the solar radiation file so that it only includes values over the Land.

Attached are both files if someone wants to give it a quick try.

ps: does anyone have a much higher resolution version of land-sea mask?


Replies (9)

RE: Land-Sea Masking - Added by Jaison-Thomas Ambadan almost 10 years ago

try

cdo -f nc -setmissval,0 -mul -eqc,0 finalmask.nc CLIMATO0310sum.nc ofile.nc

PS: you don't need to use -setmissval,0 if you want to keep zeros in the ocean.

RE: Land-Sea Masking - Added by Jaison-Thomas Ambadan almost 10 years ago

you can create an approximate high resolution mask using topo operator, like:

cdo -P 8 -f nc2 -gtc,0 -remapcon,r2880x1440 -topo seamask.nc

RE: Land-Sea Masking - Added by Theodoros Gkousarov almost 10 years ago

Thanks it worked.

Here is a new more interesting challenge though

This file (link) contains a much higher resolution land sea mask, but it also contains the distance from the sea in Km (not completely sure of the units).

How can I make it work as the above example but only for the mask which has 0 values?

https://www.ghrsst.org/products-and-services/tools/navo-ghrsst-pp-land-sea-mask/

RE: Land-Sea Masking - Added by Theodoros Gkousarov almost 10 years ago

Interesting about this TOPO function,

but I get this error
Option -P failed, OpenMP support not compiled in!

RE: Land-Sea Masking - Added by Theodoros Gkousarov almost 10 years ago

Could you run the command, create the file and upload the file here for me since my OpenMP function doesnt work?

cdo -P 8 -f nc2 -gtc,0 -remapcon,r2880x1440 -topo seamask.nc

cheers for the help

RE: Land-Sea Masking - Added by Jaison-Thomas Ambadan almost 10 years ago

if the OpenMP support not compiled-in, you can still use the command without the -P 8 option - it'll be a bit slower, that's all.

regarding the navo-ghrsst-pp-land-sea-mask:

just download the the mask file from the website:

cdo -f nc2 -copy lsmask-world8-var.dist5.5.nc mymask.nc
cdo -f nc2 -sellonlatbox,-12,5,49,61 mymask.nc template.nc
cdo -b F64 -f nc2 -setmissval,0 -mul -eqc,0 template.nc -remapbil,template.nc CLIMATO0310sum.nc ofile.nc

RE: Land-Sea Masking - Added by Theodoros Gkousarov almost 10 years ago

It Works!!!

However, the file produced using a sea mask is about 20x bigger than the original. It seems weird since I would expect smaller files since theres a mask.

For example the daily SSR climatology is 8GB and when I apply the mask it is 250GB. :/ Any way to fix this?

cheers for the help.

RE: Land-Sea Masking - Added by Jaison-Thomas Ambadan almost 10 years ago

you do NOT need to use "-b F64" (double precision), and you could use "-f nc4" (if it's compiled in) or GRIB ("-f grb") format for the output file - this may help you to reduce the file size.

RE: Land-Sea Masking - Added by srinivasu upparapalli almost 9 years ago

I have created a netcdf format land-sea and basin mask from the following datasets
https://www.nodc.noaa.gov/OC5/woa13/masks13.html
The netcdf file (0.25 degree resolution attached).

    (1-9/9)