Masking using Shapefile

From: rahmi ariani <rahmi.ariani_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 31 2014 - 08:12:07 MDT

Dear everyone,

I am trying to mask a data using a shapefile and i got an error like
this: *shapefile_mask_data:
Error: not a valid rectilinear, curvilinear, or unstructured grid*. I use
my own shapefile (i cannot attach the file because the size is too big),
but even i use the shapefile used in this example:
https://www.ncl.ucar.edu/Applications/Scripts/mask_12.ncl
(http://www.ngdc.noaa.gov/mgg/shorelines/data/gshhs/version2.2.0<http://www.ngdc.noaa.gov/mgg/shorelines/data/gshhs/version2.2.0/>),
its still giving the same error. Could someone help me with this problem?
Any help will be appreciate. Thank you.

Here is my script:

load "./shapefile_mask_data.ncl"
WRITE_MASK = True
DEBUG = False
in = addfile("TRMM_3LT.nc","r")
PR3 = in->PR3(:,{-7:7}, {94:107})
shpfile = "Sumatera.shp"
  opt = True
  opt@return_mask = True
  opt@minlat = -7
  opt@maxlat = 7
  opt@minlon = 94
  opt@maxlon = 107
land_mask = shapefile_mask_data(PR3,shpfile,opt)
PR3_ocean_mask = where(land_mask.eq.0,PR3,PR3@_FillValue)
copy_VarMeta(PR3,PR3_ocean_mask)

Best,

--
Rahmi Ariani
Student of Applied Climatology
Faculty of Mathematics and Natural Science
Bogor Agricultural University
Indonesia
16680

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 31 08:12:18 2014

This archive was generated by hypermail 2.1.8 : Thu Apr 03 2014 - 13:36:27 MDT