<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 14pt; color: rgb(0, 0, 0);">
<span>Thank you all for your contributions.<br>
</span><span>However, I do not have another shapefile with more areas.</span><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De:</b> Dave Allured - NOAA Affiliate <dave.allured@noaa.gov><br>
<b>Enviado:</b> quarta-feira, 17 de julho de 2019 17:52<br>
<b>Para:</b> Vanúcia Schumacher<br>
<b>Cc:</b> ncl-talk@ucar.edu<br>
<b>Assunto:</b> Re: [ncl-talk] problem to plot raster mode</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">You can get the highest quality plot without regridding, if you can get a different shapefile that includes all of the areas surrounding your basin. Do not use the data mask function. Make a filled contour plot over the entire area, then cover
the unwanted ares in white. See plot #3 of example shapefiles_21:<br>
<a href="https://www.ncl.ucar.edu/Applications/Images/shapefiles_21_3_lg.png">https://www.ncl.ucar.edu/Applications/Images/shapefiles_21_3_lg.png</a>
<br>
<br>
We talked about this last February for a different shapefile. For more suggestions, see that conversation:<br>
<a href="http://mailman.ucar.edu/pipermail/ncl-talk/2019-February/014178.html">http://mailman.ucar.edu/pipermail/ncl-talk/2019-February/014178.html</a><br>
<div><br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Wed, Jul 17, 2019 at 10:55 AM Adam Phillips via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">Hi Vanúcia,
<div>When you set cnFillMode = "RasterFill", NCL is showing every single grid box that has data. No interpolation or smoothing is done. The advantage of this method is that you will see every grid box. The downside is the block-like appearance. When cnFillMode
= "AreaFill" (or if cnFIllMode = "RasterFill" AND cnSmoothingOn = True), smoothing is done as NCL looks at values of neighboring grid boxes. However, if not enough neighboring grid boxes are present, a grid box might not be drawn, and therefore if you have
missing data you may not see all areas that have data filled. </div>
<div><br>
</div>
<div>All the above being said, it looks to me like the issue is coming from 1) the resolution of your data, and 2) the shapefile masking routine is excluding grid boxes that you do not want excluded. I see two possible solutions:</div>
<div>1) Interpolate your data to a higher resolution grid, following the numerous examples on the NCL website. I'd use the ESMF_regrid function. When the data is masked by the shapefile you should get a more precise masking on a higher resolution grid. But,
note that regridding to a higher resolution grid is generally not recommended due to the possibility of adding artifacts that are not there. Compare the regridded and original grid on a plot to make sure all looks well. </div>
<div>2) Sitck with your current grid, and then add back in points to the array after the shapefile mask has been applied. This will be tedious, but looking at the attached plot I created showing the unmasked and masked grids, it looks to be roughly 10 grid
boxes. You will want to use getind_latlon2d to identify the 2d coordinates needed:</div>
<div><a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml" target="_blank">http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml</a> </div>
<div><br>
</div>
<div>Hope that helps. I didn't lay out the exact coding needed, but the above hints should get you started down the right path to solving the issue.</div>
<div>Adam</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Wed, Jul 17, 2019 at 10:10 AM Vanúcia Schumacher via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:14pt; color:rgb(0,0,0)">
<span style="font-size:12pt">Using this resource</span><span style="font-size:12pt"> I get the same result if I do not use the RasterFill, that is, I do not have full shapefile area filling.</span><span><br>
</span>
<div><br>
</div>
<span style="font-size:12pt">Thank you anyway</span><br>
</div>
<div id="x_gmail-m_6836949707722353381gmail-m_-282359457189613835gmail-m_8737316740792018402gmail-m_-3248416686556168794gmail-m_5823922057309362400appendonsend">
</div>
<hr style="display:inline-block; width:98%">
<div id="x_gmail-m_6836949707722353381gmail-m_-282359457189613835gmail-m_8737316740792018402gmail-m_-3248416686556168794gmail-m_5823922057309362400divRplyFwdMsg" dir="ltr">
<font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>De:</b> Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>><br>
<b>Enviado:</b> quarta-feira, 17 de julho de 2019 12:39<br>
<b>Para:</b> Vanúcia Schumacher<br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Assunto:</b> Re: [ncl-talk] problem to plot raster mode</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>HI,</div>
<div><br>
</div>
<div>With that coarse of resolution of the data, its going to be tough to get a really good looking result. You might try using RasterFill and setting the resource cnRasterSmoothingOn = True:<br>
</div>
<div><br>
</div>
<div> <a href="http://ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnRasterSmoothingOn" target="_blank">
http://ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnRasterSmoothingOn</a><br>
</div>
<div><br>
</div>
<div>Rick<br>
</div>
</div>
<br>
<div class="x_gmail-m_6836949707722353381gmail-m_-282359457189613835gmail-m_8737316740792018402gmail-m_-3248416686556168794gmail-m_5823922057309362400x_gmail_quote">
<div dir="ltr" class="x_gmail-m_6836949707722353381gmail-m_-282359457189613835gmail-m_8737316740792018402gmail-m_-3248416686556168794gmail-m_5823922057309362400x_gmail_attr">
On Wed, Jul 17, 2019 at 8:50 AM Vanúcia Schumacher via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail-m_6836949707722353381gmail-m_-282359457189613835gmail-m_8737316740792018402gmail-m_-3248416686556168794gmail-m_5823922057309362400x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:14pt; color:rgb(0,0,0)">
<div style="margin:0px; font-size:14pt; font-family:Calibri,Helvetica,sans-serif; background-color:rgb(255,255,255)">
Hi users,</div>
<div style="margin:0px; font-size:14pt; font-family:Calibri,Helvetica,sans-serif; background-color:rgb(255,255,255)">
<br>
</div>
<div style="margin:0px; font-size:14pt; font-family:Calibri,Helvetica,sans-serif; background-color:rgb(255,255,255)">
<span style="margin:0px">I'm trying to plot a spatial graph from raster data (mask) using shapefile.<br>
</span>
<div style="margin:0px">The problem is that I was able to only plot 34 pixels inside the shapefile area, using cnFillMode = "RasterFill". <br>
</div>
<div style="margin:0px">However, I would like to not use this command (raster fill) and get a spatial graph better defined inside the shapefile, or increase the number of pixels within the area shapefile, with a better contour. But I am not getting a good result
(see figure off_raster). <br>
</div>
<div style="margin:0px"><br>
</div>
<div style="margin:0px">Attached follows the data and script.<br>
</div>
<span style="margin:0px">Thanks any help</span></div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>