Project

General

Profile

Masking a region using another nc file or shape file

Added by Kushank Bajaj over 7 years ago

Hi Everyone,

Could someone please suggest how to mask a region from a netcdf file using another netcdf or a shape file.
I'm trying to extract a basin from world data and I have the boundary of the basin as a .nc file.

Thanks in advance.

Best,
Kushank


Replies (1)

RE: Masking a region using another nc file or shape file - Added by Ralf Mueller over 7 years ago

Hi!
it depends, how your maskfile (.nc) is done. if you have a 0-1-mask, you could just do a division by that mask to create missing values elsewhere. If you have as mask with non-mising values inside and missing values outsite your region(s), you might scale the non-missing values to 1 and do a multiplication. but keep in mind, that missing*zero = zero

hth
ralf

    (1-1/1)