Re: overlay plot ncl 5.2.0 and earlier

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 13 2010 - 14:53:04 MDT

Hi Jan,
I responded to you earlier on our progress on this, but I thought I
would inform the group as to what was happening and the reasons for it.

As I said earlier, your cnLevels setting was being ignored as
cnLevelSelectionMode was not being set to "ExplicitLevels", and this
resulted in the plot looking different than you expected using NCL 5.2.0.

Mary discovered that there was a bug fix implemented after NCL 5.1.0 was
released that fixed the following:
If a user set cnLevels, but didn't set cnLevelSelectionMode =
"ExplicitLevels", cnLevels was still being used. According to the
documentation, this is incorrect, in that cnLevels should only be used
when cnLevelSelectionMode = "ExplicitLevels". Fixed.

So, NCL 5.1.0 was allowing you to set cnLevels and not set
cnLevelSelectionMode, but 5.2.0 does not let you do that. This resulted
in different contour levels being plotted between the 2 NCL versions,
which is what you saw.

If any of this isn't clear please let me know, but I think we got to the
bottom of the issue...
Best regards,
Adam

On 07/13/2010 09:58 AM, Adam Phillips wrote:
> Hi Jan,
> Just to update you: Either I or Mary will respond to ncl-talk when the
> investigation is complete, but one thing I noticed with your script is
> that you are not setting resb@cnLevelSelectionMode = "ExplicitLevels"...
> If you do not set this, resb@cnLevels is ignored. You can see what
> contour levels were chosen (by NCL in this case) by adding the following
> below your gsn_contour_shade call:
>
> getvalues plot2
> "cnLevels" : test
> end getvalues
> print(test)
>
> On my version of 5.2.0, I am getting contours starting at -2.5 and
> continuing by 2.5 to 30. This explains why your 5.2.0 plot looks like it
> does, as only those values greater than 2.5 (and less than -2.5) are
> being pattern filled. If I add the cnLevelSelectionMode resource I
> detailed above, the script works as I think you want.
>
> One thing we have not answered or investigated yet is why the NCL
> derived contour levels changed between version 5.1.0 and 5.2.0 as you
> reported. (We don't believe that should be happening.) I can't test
> that, so Mary is going to look into this sometime today time permitting..
> Adam
>
> On 07/13/2010 03:22 AM, Jan Sedlacek wrote:
>> Hi Adam
>>
>> I uploaded the two files to the ftp server. I was not able to check if
>> it worked. If not just tell me and I will retry. The two files are
>> called precip_data.nc and plot_test.ncl.
>>
>> Let me know what you find out...
>>
>> Cheers,
>> Jan
>>
>> On 12/07/2010 18:45, Adam Phillips wrote:
>>> Hi Jan,
>>> We are not aware of any issues or changes to the gsn_contour_shade
>>> function between version 5.1.0 and 5.2.0. (Which doesn't rule out that
>>> something else was changed somewhere else that could cause this.) Could
>>> you send us your script and data so we could do the testing here?
>>>
>>> ftp ftp.cgd.ucar.edu
>>> anonymous
>>> Use your email address for the password
>>> cd incoming
>>> put ...
>>> put ...
>>> :
>>> quit
>>>
>>> Please send me an email detailing the names of the data files/script, as
>>> we cannot see what is placed in the incoming directory.
>>> Thanks!
>>> Adam
>>>
>>>
>>> On 07/12/2010 03:46 AM, Jan Sedlacek wrote:
>>>> Hi
>>>>
>>>> I'm plotting precipitation anomalies form a model ensemble and I'm
>>>> superimposing the significance with an overlay function. The code bit
>>>> looks like this:
>>>>
>>>> plot(1) = gsn_csm_contour_map_polar(wks,precip_trans(1,:,:),res)
>>>>
>>>> plot2 = gsn_contour(wks,precip_signif_trans(1,:,:),resb)
>>>> plot2 = gsn_contour_shade(plot2,-1,1,opt)
>>>>
>>>> overlay(plot(1),plot2)
>>>>
>>>> What I discovered is that the significance which is dotted in the plot
>>>> differs between the ncl versions. We have several versions installed
>>>> and
>>>> running and it seems that the change occured betwen versions 5.1.0 and
>>>> 5.1.1. We tested it with different precompiled versions from your
>>>> website and with the same versions we compiled ourselves. The results
>>>> are the same.
>>>>
>>>> I have attached two plots, one from ncl 5.1.0 and one from 5.2.0
>>>> just to
>>>> give an example. On the left hand panel is a simple contour plot from
>>>> the significance and on the right hand panel is the plot as it should
>>>> be. The dots in the right hand panel should cover the same area as the
>>>> blue regions from the left hand panel. I have the impression that
>>>> version 5.1.0 draws the dots at the right place while 5.2.0 does not.
>>>>
>>>> Is it possible that this is a bug? Or is there something that I need to
>>>> adjust in the code to make it work properly with newer versions?
>>>>
>>>> Thanks a lot and have a nice day,
>>>> Jan
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>

-- 
__________________________________________________
Adam Phillips 
asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
Climate and Global Dynamics Division         fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 13 14:53:21 2010

This archive was generated by hypermail 2.1.8 : Mon Jul 19 2010 - 09:39:01 MDT