<div dir="ltr"><div class="gmail_default" style="font-size:small">This is a resolution email to this question.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Amy and I took this conversation offline, and the main issue was that we needed the "tresh_ease23.prj" file in order for the lat/lon values on the shapefile to be calculated correctly.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Once we had this resolved, I modified the functions in the shapefiles_21.ncl example to allow you to mask data using shapefile ids (integers) as well as strings.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">See the attached image, which was created by masking the original data against all polygons on the shapefile where "tresh" was equal to 1.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The panel_plot.png image shows the original data and the masked data.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The shapefile areas are outlined in black, with the shapefile masking area of interest outlined in a thicker purple line.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The mask_data_plot.png image shows the same masked data plot, but with the location of the data's lat/lon grid drawn as red dots where it fell outside the shapefile area of interest, and in black inside the area of interest. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 27, 2017 at 6:10 PM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</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">Hi Amy,<br><br>In order to properly read shapefiles, we need the tresh_ease23.shx and tresh_ease23.dbf files as well<div style="font-size:small;display:inline">​.​</div><br><br>Also, I didn't see the <div style="font-size:small;display:inline">​ ​</div><a href="http://data_stats_2d_cmap.nc" target="_blank">data_stats_2d_cmap.nc</a><div style="font-size:small;display:inline">​ ​</div>file attached to your email. Can you upload this file and the other tresh_eas23.xxx files to <a href="http://ftp.cgd.ucar.edu" target="_blank">ftp.cgd.ucar.edu</a>?<br><br>Thanks,<br><br>--Mary<div><div class="h5"><br><br>On Fri, Oct 27, 2017 at 4:58 PM, Amy Hendricks <<a href="mailto:ashendricks@alaska.edu" target="_blank">ashendricks@alaska.edu</a>> wrote:<br>><br>> Hello again NCL magicians,<br>><br>> As per requested, I have uploaded the shapefile "tresh_ease23.shp" to the incoming directory and attached the script. The script is basically example #21 modified with my inputs. The script recognizes the shapefile and data, but doesn't plot like the examples, or write the mask (the data are all missing values). I'm looking to create a netcdf mask of just the Treshnikov region 1 (East Bering). Please help!<br>><br>> Thank you,<br>><br>> Amy<br>><br>><br>><br>> On Fri, Oct 27, 2017 at 2:56 PM, Amy Hendricks <<a href="mailto:ashendricks@alaska.edu" target="_blank">ashendricks@alaska.edu</a>> wrote:<br>>><br>>> Hello again NCL magicians,<br>>><br>>> As per requested, I have uploaded the shapefile "tresh_ease23.shp" to the incoming directory and attached the script and data file to be masked. The script is basically example #21 modified with my inputs. The script recognizes the shapefile and data, but doesn't plot like the examples, or write the mask (the data are all missing values). I'm looking to create a netcdf mask of just the Treshnikov region 1 (East Bering). Please help!<br>>><br>>> Thank you,<br>>><br>>> Amy<br>>><br>>><br>>><br>>> On Thu, Oct 26, 2017 at 4:17 PM, Amy Hendricks <<a href="mailto:ashendricks@alaska.edu" target="_blank">ashendricks@alaska.edu</a>> wrote:<br>>>><br>>>> Howdy NCL experts,<br>>>><br>>>> I'm trying to create a netcdf mask from a shapefile, however, the shape names are integers. All of the examples on the shapefiles examples page show how to mask with string shape names -- how do I convert the integer shape names to strings for creating a mask? <br>>>><br>>>> Cheers,<br>>>><br>>>> Amy<br>>>><br>>><br>>><br>>><br>>> --<br>>> Amy Hendricks<br>>> Graduate Research Assistant<br>>> Department of Atmospheric Sciences<br>>> University of Alaska Fairbanks<br>>> IARC 343-R<br>>> <a href="tel:(907)%20388-9893" value="+19073889893" target="_blank">907-388-9893</a><br>>> <a href="mailto:ashendricks@alaska.edu" target="_blank">ashendricks@alaska.edu</a><br>><br>><br>><br>><br>> --<br>> Amy Hendricks<br>> Graduate Research Assistant<br>> Department of Atmospheric Sciences<br>> University of Alaska Fairbanks<br>> IARC 343-R<br>> <a href="tel:(907)%20388-9893" value="+19073889893" target="_blank">907-388-9893</a><br>> <a href="mailto:ashendricks@alaska.edu" target="_blank">ashendricks@alaska.edu</a><br>><br></div></div><span class="">> ______________________________<wbr>_________________<br>> ncl-talk mailing list<br>> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>> List instructions, subscriber options, unsubscribe:<br>> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>><br></span></div>
</blockquote></div><br></div></div>