<div dir="ltr">Interesting. I would agree on having a couple of examples. In the meantime, a couple of thoughts...<div><br></div><div>Between the cnRasterCellSizeF and cnRasterSampleFactorF, you can essentially set the cell size to be infinitely small (e.g. 1e-30, within the range of float still) and keeping the sample factor at 1.0 should keep the cells no smaller than the size of the grid itself, correct? If this was done, is there any computational efficiency to be gained versus using an AreaFill? Might depend on the data itself, I suppose, but it would seem that the infinitely-small limit of RasteFill is essentially CellFill mode, but perhaps more computations (such as averaging all data points contributing a cell - in this case this is 1, but don&#39;t know if the average is removed in this limiting case) which would make CellFill more example in this limiting case, perhaps? Either way, you could avoid wkWidth/Height-dependent calculations with the sample factor limit, if I&#39;m reading the documentation correctly.</div><div><br></div><div>I think the application Micah has in mind would involve transferring the image over the web and using a browser-side piece of software to subset the image to the desired visible region. Plotting resolution issues were the problem when I tried something a while ago, so it would be interesting to find the most efficient way of hi-res plotting of an entire global grid and getting a subset to a web-based user.</div><div><br></div><div><br></div><div>Kyle</div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">----------------------------------------<div>Kyle S. Griffin</div><div>Department of Atmospheric and Oceanic Sciences</div><div>University of Wisconsin - Madison</div><div>Room 1421</div><div>1225 W Dayton St, Madison, WI 53706</div><div>Email: <a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</a></div></div></div>
<br><div class="gmail_quote">On Thu, Oct 30, 2014 at 3:19 PM, David Brown <span dir="ltr">&lt;<a href="mailto:dbrown@ucar.edu" target="_blank">dbrown@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Compared with high resolution PostScript files, high resolution PNG<br>
images do seem to be much more cost effective in terms of file size<br>
and quickness to load and manipulate by typical viewing tools like Mac<br>
Preview.<br>
<br>
Ideally you would want a PNG image that is close to the same<br>
resolution as your data or higher. In order to get this with an NCL<br>
&quot;RasterFill&quot; plot there are two things you need to adjust: the output<br>
workstation resolution, controlled by &quot;wkWidth&quot; and &quot;wkHeight&quot;, and<br>
the resolution that the raster fill method uses when drawing, which is<br>
most easily controlled by setting the resource &quot;cnRasterCellSizeF&quot; to<br>
a suitable small number. Note that the workstation resources set a<br>
resolution for the plot as a whole, including the annotations and any<br>
white space that surrounds the plot, while the raster cell size only<br>
relates to the area inside the viewport of the actual plot -- just<br>
something to keep in mind.<br>
<br>
For example, to visualize a 65,000,000 cell MPAS grid with maximum<br>
possible detail, I set<br>
wkWidth and wkHeight to 16384 (a power of 2 but not really necessary<br>
-- it could have been 16000).<br>
Then I set cnRasterCellSizeF to 1.0/16384.0  Nothing magical about<br>
these numbers, and they don&#39;t account for the whole plot vs viewport<br>
issue mathematically, but they do produce a very detailed image. The<br>
output PNG file is about 40 MB -- too big to attach to this message<br>
unfortunately.<br>
<br>
We should probably have an example or two showing how to create<br>
high-res graphics.<br>
 -dave<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
On Thu, Oct 30, 2014 at 11:30 AM, Micah Sklut &lt;<a href="mailto:micahs2005@gmail.com">micahs2005@gmail.com</a>&gt; wrote:<br>
&gt; Okay, thanks for explaining how the raster fill works Kyle. That does help<br>
&gt; me understand this limitation. With respect to processing time between<br>
&gt; rasterFill and areaFill. It took about 1-2 minutes for rasterFill, compared<br>
&gt; to a ball park of 4 hours for areaFill. Quite a difference!<br>
&gt;<br>
&gt; On Thu, Oct 30, 2014 at 1:26 PM, Kyle Griffin &lt;<a href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; That&#39;s part of the definition of Raster fill - it will always create the<br>
&gt;&gt; same number of boxes regardless of resolution of the data underneath,<br>
&gt;&gt; typically based on an average of the data points within that set of grid<br>
&gt;&gt; points. Although I&#39;m not knowledgeable about the behind-the-scenes<br>
&gt;&gt; computations, I know it&#39;s common for NCL to mark the whole average as<br>
&gt;&gt; missing if any subset of that average is missing. I&#39;m not sure if there&#39;s a<br>
&gt;&gt; way to override this - a developer might need to chime in here - but that<br>
&gt;&gt; would be your only hope if you want to keep your image production time down,<br>
&gt;&gt; as the other fill modes will almost certainly be more intensive. You can<br>
&gt;&gt; scan examples of Raster Fill code here (see link) and in the contour<br>
&gt;&gt; resources page as well.<br>
&gt;&gt;<br>
&gt;&gt; <a href="https://www.ncl.ucar.edu/Applications/raster.shtml" target="_blank">https://www.ncl.ucar.edu/Applications/raster.shtml</a><br>
&gt;&gt;<br>
&gt;&gt; If you did AreaFill or CellFill, I don&#39;t think you see much difference in<br>
&gt;&gt; the time to produce a vector file output versus a raster image output. But<br>
&gt;&gt; yes, what you are seeing is a limitation of using the RasterFill setting.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Kyle<br>
&gt;&gt;<br>
&gt;&gt; ----------------------------------------<br>
&gt;&gt; Kyle S. Griffin<br>
&gt;&gt; Department of Atmospheric and Oceanic Sciences<br>
&gt;&gt; University of Wisconsin - Madison<br>
&gt;&gt; Room 1421<br>
&gt;&gt; 1225 W Dayton St, Madison, WI 53706<br>
&gt;&gt; Email: <a href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a><br>
&gt;&gt;<br>
&gt;&gt; On Thu, Oct 30, 2014 at 11:55 AM, Micah Sklut &lt;<a href="mailto:micahs2005@gmail.com">micahs2005@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; No, I&quot;m not masking data. Yes, I am using RasterFill, and the resulting<br>
&gt;&gt;&gt; image for the Mid Atlantic is great. But, when I expand to global, I lose<br>
&gt;&gt;&gt; the high detail, no matter how much I increase the png resolution. So, just<br>
&gt;&gt;&gt; wondering why I am losing detail with the global image, and if there is a<br>
&gt;&gt;&gt; way around it.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Thu, Oct 30, 2014 at 12:52 PM, Kyle Griffin &lt;<a href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a>&gt;<br>
&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Hi Micah,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; This seems to me the type of result you would expect when using<br>
&gt;&gt;&gt;&gt; RasterFill as a cnFillMode - the default should be cnAreaFill, which<br>
&gt;&gt;&gt;&gt; increases plot time significantly, but might that be an issue?<br>
&gt;&gt;&gt;&gt; Otherwise, I assume you&#39;re doing nothing else to mask the data, correct?<br>
&gt;&gt;&gt;&gt; Sometimes masking data with a land mask can create similar blockiness,<br>
&gt;&gt;&gt;&gt; although I am unaware (via inexperience) as to whether there is a resolution<br>
&gt;&gt;&gt;&gt; dependence based on the plot size or native data resolution.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Kyle<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; ----------------------------------------<br>
&gt;&gt;&gt;&gt; Kyle S. Griffin<br>
&gt;&gt;&gt;&gt; Department of Atmospheric and Oceanic Sciences<br>
&gt;&gt;&gt;&gt; University of Wisconsin - Madison<br>
&gt;&gt;&gt;&gt; Room 1421<br>
&gt;&gt;&gt;&gt; 1225 W Dayton St, Madison, WI 53706<br>
&gt;&gt;&gt;&gt; Email: <a href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Thu, Oct 30, 2014 at 11:37 AM, Micah Sklut &lt;<a href="mailto:micahs2005@gmail.com">micahs2005@gmail.com</a>&gt;<br>
&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Hi Kyle,<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Thanks for the reply.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; The dataset is of 0.05 degree resolution, so that certainly isn&#39;t the<br>
&gt;&gt;&gt;&gt;&gt; problem. I have attached an image of the same data, but limiting the min/max<br>
&gt;&gt;&gt;&gt;&gt; lat/lon to the US Mid Atlantic. In this image you will see much more detail.<br>
&gt;&gt;&gt;&gt;&gt; This is the type of detail I was hoping to achieve for the entire globe. I<br>
&gt;&gt;&gt;&gt;&gt; figured if I increased the resolution of the global png, it would create the<br>
&gt;&gt;&gt;&gt;&gt; desired effect, but as you can see from the global image I attached, this<br>
&gt;&gt;&gt;&gt;&gt; wasn&#39;t the case.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Looking forward to hearing your thoughts.<br>
&gt;&gt;&gt;&gt;&gt; Thank you,<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Micah<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On Thu, Oct 30, 2014 at 12:26 PM, Kyle Griffin &lt;<a href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Micah,<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; This looks more like a limitation of your dataset - SST data is not of<br>
&gt;&gt;&gt;&gt;&gt;&gt; infinite resolution, and you&#39;re plotting far more pixels than would be data<br>
&gt;&gt;&gt;&gt;&gt;&gt; points in even a 0.1˚ dataset! It looks like the internal pixels are the<br>
&gt;&gt;&gt;&gt;&gt;&gt; same size as your coastlines, so I don&#39;t see an issue with NCL there. More<br>
&gt;&gt;&gt;&gt;&gt;&gt; specifically, you are not actually plotting coastlines - they only plot if<br>
&gt;&gt;&gt;&gt;&gt;&gt; you tell them to plot with a call to gsn_csm_map or another similar plotting<br>
&gt;&gt;&gt;&gt;&gt;&gt; tool. If you&#39;re looking for high resolution coastlines, look at the RANGS<br>
&gt;&gt;&gt;&gt;&gt;&gt; mapping capabilities in NCL. Beyond that, you can always plot shapefiles as<br>
&gt;&gt;&gt;&gt;&gt;&gt; well.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Yes, vector images are going to be extremely large and painful for<br>
&gt;&gt;&gt;&gt;&gt;&gt; even a moderate resolution file over the full globe. When you say raster,<br>
&gt;&gt;&gt;&gt;&gt;&gt; are you talking about it in the image sense (non-vector file) or in the<br>
&gt;&gt;&gt;&gt;&gt;&gt; cnFillMode sense (RasterFill, AreaFill, etc.;<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnFillMode" target="_blank">https://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnFillMode</a>)?<br>
&gt;&gt;&gt;&gt;&gt;&gt; Raster fill mode will make the data more blocky and reduce interpolation<br>
&gt;&gt;&gt;&gt;&gt;&gt; between points, but the trade-off is a much faster plotting of the image and<br>
&gt;&gt;&gt;&gt;&gt;&gt; works well for high-resolution datasets being plotted at relatively low<br>
&gt;&gt;&gt;&gt;&gt;&gt; resolution/wide zoom.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Kyle<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; ----------------------------------------<br>
&gt;&gt;&gt;&gt;&gt;&gt; Kyle S. Griffin<br>
&gt;&gt;&gt;&gt;&gt;&gt; Department of Atmospheric and Oceanic Sciences<br>
&gt;&gt;&gt;&gt;&gt;&gt; University of Wisconsin - Madison<br>
&gt;&gt;&gt;&gt;&gt;&gt; Room 1421<br>
&gt;&gt;&gt;&gt;&gt;&gt; 1225 W Dayton St, Madison, WI 53706<br>
&gt;&gt;&gt;&gt;&gt;&gt; Email: <a href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; On Thu, Oct 30, 2014 at 9:58 AM, Micah Sklut &lt;<a href="mailto:micahs2005@gmail.com">micahs2005@gmail.com</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; This is a follow up to my previous posts, in reference to searching<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; for high resolution images that could be used as zooming/navigating<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; (specific interest is with image tile layers).<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; I figured if I created a png file with a high resolution, it would be<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; able to capture the high detail, like with coastlines and so forth.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; I&#39;ve attached an image with very high resolution (16384x16384), but<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; as you can see, if you zoom the global image into the coastlines they are<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; extremely blocky.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Is is possible to capture high resolution features, such as<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; coastlines in a global raster image with NCL?<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; FYI, I tried the vector image route, but the file size was gigantic,<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; so that didn&#39;t seem like a proper route.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Thank you,<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Micah Sklut<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; ncl-talk mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; List instructions, subscriber options, unsubscribe:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; Micah Sklut<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Micah Sklut<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Micah Sklut<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; ncl-talk mailing list<br>
&gt; List instructions, subscriber options, unsubscribe:<br>
&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;<br>
</div></div></blockquote></div><br></div>