-3

I have world map GRACE-data in netcdf file. I'm looking for visualizing data in a selected region, for instance just visualize the data for Amazon or Volga basin. I was suggested to use basin mask

Minh Hiếu
  • 39
  • 1
  • 8

2 Answers2

3

You could do the following if you have a shapefile of your basin.

# convert shp to nc
gdal_rasterize -of netCDF -burn 1 -tr 0.01 0.01 basin.shp basin.nc

# regrid
cdo remapbil,infile.nc basin.nc basin2.nc

# mask
cdo ifthen basin2.nc infile.nc masked_infile.nc
Dani56
  • 372
  • 1
  • 2
  • 7
1

If you don't need to exactly follow a basin's boundaries and are happy to simply view a "rectangle" lat-lon region, then you can also simply do

cdo sellonlatbox,lon1,lon2,lat1,lat2 world_file.nc region.nc 
ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86