<div dir="ltr"><div class="gmail_default" style="font-size:small">Amit,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In order for the shapefile_mask_data function to "see" your lat /lon arrays, you must attach them to the data variable. This is only required if you have curvilinear or unstructured data.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You have curvilinear data (which means your lat/lon arrays are both 2D and the same size as your data array), so you can do this:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style=""><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> var = doubletofloat(a->HEM_MNT)</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> var@lat2d = a->latitude</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> var@lon2d = a->longitude</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> opt = True</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> opt@return_mask = True</font></div><div class="gmail_default" style="font-size:small"><font face="monospace, monospace"> shp_mask = shapefile_mask_data(var(0,:,:),filename,opt) </font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif">Also, see example #14 at:</font></div><div class="gmail_default" style="font-size:small"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="arial, helvetica, sans-serif"><a href="http://www.ncl.ucar.edu/Applications/shapefiles.shtml">http://www.ncl.ucar.edu/Applications/shapefiles.shtml</a><br></font></div><div class="gmail_default" style=""><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="arial, helvetica, sans-serif">--Mary</font></div><div class="gmail_default" style=""><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="monospace, monospace" style=""><br></font></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 9, 2016 at 6:50 AM, Amit Kumar <span dir="ltr"><<a href="mailto:amitkumar.777@hotmail.com" target="_blank">amitkumar.777@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div style="font-size:10pt;color:#2672ec;background-color:#ffffff;font-family:Arial,Helvetica,sans-serif">
<div>Hi All,<br>
<br>
I want to do shape file masking but I'm getting
<div><span style="color:rgb(255,0,0)">shapefile_mask_data: Error: not a valid rectilinear, curvilinear, or unstructured grid</span><br>
</div>
<br>
My variable description by ncl_filedump is as follows:<br>
<br>
Variable: f<br>
Type: file<br>
dimensions:<br>
time = 1<br>
lon = 2805<br>
lat = 2816<br>
variables:<br>
double time ( time )<br>
units : hours since 0001-01-01 00:00:00.0<br>
calendar : gregorian<br>
<br>
double latitude ( lat, lon )<br>
units : degrees_north<br>
<br>
double longitude ( lat, lon )<br>
units : degrees_east<br>
<br>
double HEM_MNT ( time, lat, lon )<br>
coordinates : latitude longitude<br>
fillvalue : -9.e+33<br>
missing_value : -9e+33<br>
_FillValue : -9e+33<br>
<br>
<br>
and my script section for masking is as follows:<br>
<br>
<div> var = doubletofloat(a->HEM_MNT)<br>
lat = a->latitude<br>
lon = a->longitude</div>
opt = True<br>
<div> opt@return_mask = True<br>
shp_mask = shapefile_mask_data(var(0,:,:)<wbr>,filename,opt) -------><span style="color:rgb(255,0,0)"> error in this line</span><br>
</div>
<br>
</div>
</div>
</div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>