<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'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'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"><<a href="mailto:dbrown@ucar.edu" target="_blank">dbrown@ucar.edu</a>></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>
"RasterFill" plot there are two things you need to adjust: the output<br>
workstation resolution, controlled by "wkWidth" and "wkHeight", and<br>
the resolution that the raster fill method uses when drawing, which is<br>
most easily controlled by setting the resource "cnRasterCellSizeF" 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'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 <<a href="mailto:micahs2005@gmail.com">micahs2005@gmail.com</a>> wrote:<br>
> Okay, thanks for explaining how the raster fill works Kyle. That does help<br>
> me understand this limitation. With respect to processing time between<br>
> rasterFill and areaFill. It took about 1-2 minutes for rasterFill, compared<br>
> to a ball park of 4 hours for areaFill. Quite a difference!<br>
><br>
> On Thu, Oct 30, 2014 at 1:26 PM, Kyle Griffin <<a href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a>> wrote:<br>
>><br>
>> That's part of the definition of Raster fill - it will always create the<br>
>> same number of boxes regardless of resolution of the data underneath,<br>
>> typically based on an average of the data points within that set of grid<br>
>> points. Although I'm not knowledgeable about the behind-the-scenes<br>
>> computations, I know it's common for NCL to mark the whole average as<br>
>> missing if any subset of that average is missing. I'm not sure if there's a<br>
>> way to override this - a developer might need to chime in here - but that<br>
>> would be your only hope if you want to keep your image production time down,<br>
>> as the other fill modes will almost certainly be more intensive. You can<br>
>> scan examples of Raster Fill code here (see link) and in the contour<br>
>> resources page as well.<br>
>><br>
>> <a href="https://www.ncl.ucar.edu/Applications/raster.shtml" target="_blank">https://www.ncl.ucar.edu/Applications/raster.shtml</a><br>
>><br>
>> If you did AreaFill or CellFill, I don't think you see much difference in<br>
>> the time to produce a vector file output versus a raster image output. But<br>
>> yes, what you are seeing is a limitation of using the RasterFill setting.<br>
>><br>
>><br>
>> Kyle<br>
>><br>
>> ----------------------------------------<br>
>> Kyle S. Griffin<br>
>> Department of Atmospheric and Oceanic Sciences<br>
>> University of Wisconsin - Madison<br>
>> Room 1421<br>
>> 1225 W Dayton St, Madison, WI 53706<br>
>> Email: <a href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a><br>
>><br>
>> On Thu, Oct 30, 2014 at 11:55 AM, Micah Sklut <<a href="mailto:micahs2005@gmail.com">micahs2005@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> No, I"m not masking data. Yes, I am using RasterFill, and the resulting<br>
>>> image for the Mid Atlantic is great. But, when I expand to global, I lose<br>
>>> the high detail, no matter how much I increase the png resolution. So, just<br>
>>> wondering why I am losing detail with the global image, and if there is a<br>
>>> way around it.<br>
>>><br>
>>> On Thu, Oct 30, 2014 at 12:52 PM, Kyle Griffin <<a href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a>><br>
>>> wrote:<br>
>>>><br>
>>>> Hi Micah,<br>
>>>><br>
>>>> This seems to me the type of result you would expect when using<br>
>>>> RasterFill as a cnFillMode - the default should be cnAreaFill, which<br>
>>>> increases plot time significantly, but might that be an issue?<br>
>>>> Otherwise, I assume you're doing nothing else to mask the data, correct?<br>
>>>> Sometimes masking data with a land mask can create similar blockiness,<br>
>>>> although I am unaware (via inexperience) as to whether there is a resolution<br>
>>>> dependence based on the plot size or native data resolution.<br>
>>>><br>
>>>><br>
>>>> Kyle<br>
>>>><br>
>>>> ----------------------------------------<br>
>>>> Kyle S. Griffin<br>
>>>> Department of Atmospheric and Oceanic Sciences<br>
>>>> University of Wisconsin - Madison<br>
>>>> Room 1421<br>
>>>> 1225 W Dayton St, Madison, WI 53706<br>
>>>> Email: <a href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a><br>
>>>><br>
>>>> On Thu, Oct 30, 2014 at 11:37 AM, Micah Sklut <<a href="mailto:micahs2005@gmail.com">micahs2005@gmail.com</a>><br>
>>>> wrote:<br>
>>>>><br>
>>>>> Hi Kyle,<br>
>>>>><br>
>>>>> Thanks for the reply.<br>
>>>>><br>
>>>>> The dataset is of 0.05 degree resolution, so that certainly isn't the<br>
>>>>> problem. I have attached an image of the same data, but limiting the min/max<br>
>>>>> lat/lon to the US Mid Atlantic. In this image you will see much more detail.<br>
>>>>> This is the type of detail I was hoping to achieve for the entire globe. I<br>
>>>>> figured if I increased the resolution of the global png, it would create the<br>
>>>>> desired effect, but as you can see from the global image I attached, this<br>
>>>>> wasn't the case.<br>
>>>>><br>
>>>>> Looking forward to hearing your thoughts.<br>
>>>>> Thank you,<br>
>>>>><br>
>>>>> Micah<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> On Thu, Oct 30, 2014 at 12:26 PM, Kyle Griffin <<a href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a>><br>
>>>>> wrote:<br>
>>>>>><br>
>>>>>> Micah,<br>
>>>>>><br>
>>>>>> This looks more like a limitation of your dataset - SST data is not of<br>
>>>>>> infinite resolution, and you're plotting far more pixels than would be data<br>
>>>>>> points in even a 0.1˚ dataset! It looks like the internal pixels are the<br>
>>>>>> same size as your coastlines, so I don't see an issue with NCL there. More<br>
>>>>>> specifically, you are not actually plotting coastlines - they only plot if<br>
>>>>>> you tell them to plot with a call to gsn_csm_map or another similar plotting<br>
>>>>>> tool. If you're looking for high resolution coastlines, look at the RANGS<br>
>>>>>> mapping capabilities in NCL. Beyond that, you can always plot shapefiles as<br>
>>>>>> well.<br>
>>>>>><br>
>>>>>> Yes, vector images are going to be extremely large and painful for<br>
>>>>>> even a moderate resolution file over the full globe. When you say raster,<br>
>>>>>> are you talking about it in the image sense (non-vector file) or in the<br>
>>>>>> cnFillMode sense (RasterFill, AreaFill, etc.;<br>
>>>>>> <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>
>>>>>> Raster fill mode will make the data more blocky and reduce interpolation<br>
>>>>>> between points, but the trade-off is a much faster plotting of the image and<br>
>>>>>> works well for high-resolution datasets being plotted at relatively low<br>
>>>>>> resolution/wide zoom.<br>
>>>>>><br>
>>>>>><br>
>>>>>> Kyle<br>
>>>>>><br>
>>>>>> ----------------------------------------<br>
>>>>>> Kyle S. Griffin<br>
>>>>>> Department of Atmospheric and Oceanic Sciences<br>
>>>>>> University of Wisconsin - Madison<br>
>>>>>> Room 1421<br>
>>>>>> 1225 W Dayton St, Madison, WI 53706<br>
>>>>>> Email: <a href="mailto:ksgriffin2@wisc.edu">ksgriffin2@wisc.edu</a><br>
>>>>>><br>
>>>>>> On Thu, Oct 30, 2014 at 9:58 AM, Micah Sklut <<a href="mailto:micahs2005@gmail.com">micahs2005@gmail.com</a>><br>
>>>>>> wrote:<br>
>>>>>>><br>
>>>>>>> Hi,<br>
>>>>>>><br>
>>>>>>> This is a follow up to my previous posts, in reference to searching<br>
>>>>>>> for high resolution images that could be used as zooming/navigating<br>
>>>>>>> (specific interest is with image tile layers).<br>
>>>>>>><br>
>>>>>>> I figured if I created a png file with a high resolution, it would be<br>
>>>>>>> able to capture the high detail, like with coastlines and so forth.<br>
>>>>>>> I've attached an image with very high resolution (16384x16384), but<br>
>>>>>>> as you can see, if you zoom the global image into the coastlines they are<br>
>>>>>>> extremely blocky.<br>
>>>>>>><br>
>>>>>>> Is is possible to capture high resolution features, such as<br>
>>>>>>> coastlines in a global raster image with NCL?<br>
>>>>>>><br>
>>>>>>> FYI, I tried the vector image route, but the file size was gigantic,<br>
>>>>>>> so that didn't seem like a proper route.<br>
>>>>>>><br>
>>>>>>> Thank you,<br>
>>>>>>><br>
>>>>>>> --<br>
>>>>>>> Micah Sklut<br>
>>>>>>><br>
>>>>>>> _______________________________________________<br>
>>>>>>> ncl-talk mailing list<br>
>>>>>>> List instructions, subscriber options, unsubscribe:<br>
>>>>>>> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
>>>>>>><br>
>>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> --<br>
>>>>> Micah Sklut<br>
>>>>><br>
>>>><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Micah Sklut<br>
>>><br>
>><br>
><br>
><br>
><br>
> --<br>
> Micah Sklut<br>
><br>
><br>
> _______________________________________________<br>
> ncl-talk mailing list<br>
> List instructions, subscriber options, unsubscribe:<br>
> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
><br>
</div></div></blockquote></div><br></div>