[ncl-talk] Raster image discrepancies between versions 6.1.2 and 6.2.x

David Brown dbrown at ucar.edu
Tue Nov 4 14:21:49 MST 2014


Hi Andrea,
I have spent some time looking at your issue, and I have discovered
the immediate cause of the "noticeable differences" you see between
NCL 6.1.2 and NCL 6.2.1 in rendering your plot. The problem is that
when the new cairo workstations were introduced, they did not fully
support a non-public resource that allows the raster filling routines
to get the workstation's resolution values. When drawing a PNG file,
this is essentially the values of wkWidthF/wkHeightF. Since the cairo
workstation was not sending back the current information, the resource
retained its default value of 1024. For 6.2.1 we corrected this
omission, and now the actual value of the workstation's current
resolution is returned. This difference accounts for the different
appearance of the plots, and I can say with some confidence that the
6.2.1 version is more correct. The simplest way to see this is to
change the wkWidth and wkHeight resources in your test script to 1024
(the default value). Then 6.2.1 and 6.1.2 will return the same
picture.

That said, there are a couple of other points I would like to make
about your script. First of all, you are plotting only a very small
subset of a number of large arrays. Since this data has 1D
coordinates, you can speed up your code immensely by sending only the
subset you want to plot to gsn_csm_contour_map. Instead of passing
data(n,:,:) you could use coordinate subscripting to
pass
data(n,{res at mpMinLatF:res at mpMaxLatF},{res at mpMinLonF:res at mpMaxLonF})





On Thu, Oct 30, 2014 at 2:27 PM, David Brown <dbrown at ucar.edu> wrote:
> Hi Andrea,
> I do see the small but noticeable differences you are talking about,
> and I am not sure why either. If you can send us your script and data,
> we can try to figure out the cause. For info on uploading files, see
> the page: http://www.ncl.ucar.edu/report_bug.shtml
> Be sure to let me know (offline) the names of the files you upload.
> Thanks,
>  -dave
>
> On Thu, Oct 30, 2014 at 1:10 PM, Andrea Allan
> <aallan at coas.oregonstate.edu> wrote:
>> Hello,
>>
>> I am currently struggling with trying to diagnose small, but very noticeable
>> differences between raster images (png workstation) created in NCL 6.1.2 and
>> the newest version 6.2.1, using the exact same code and data files in both
>> cases.  Large-scale patterns in the data are consistent; however, something
>> has changed between the two versions of NCL that make the data shift ever so
>> slightly (see attached images).
>>
>> I've perused all the changes made in the the new version of NCL, and while
>> it is hard to pinpoint the problem, could this be related to the change in
>> how transparency is handled in raster contouring, or the raster contouring
>> method itself?  Searching the ncl-talk archives, I came across this
>> statement from another raster image-related problem:
>>
>> "I think the problem is that the old workstation types do not understand
>> transparency in colors."
>>
>> I have experimented with res at cnMissingValFillColor to no avail.  We have
>> also looked at data resolution vs. screen resolution, and while that makes a
>> difference within the figure, it does not solve the discrepancy between
>> versions.  Any insight regarding this issue is greatly appreciated.
>>
>> Andrea
>>
>>
>> ~~~
>> Andrea M. Allan
>> Postdoctoral Research Associate
>> College of Earth, Ocean, and Atmospheric Sciences
>> Oregon State University
>> 112 Burt Hall
>> 541-737-3427
>> aallan at coas.oregonstate.edu
>> ~~~
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>


More information about the ncl-talk mailing list