[ncl-talk] NCL bug using set values

Mary Haley haley at ucar.edu
Thu Nov 20 08:45:37 MST 2014


Cathy,

I think it's easier to just use regular gsn commands.  But, yes, if you
have a really long animation, or maybe each plot is using a really larger
variable, then "setvalues" may be the better way to go.

Whenever you call gsn_csm_contour_map with a new data variable, the plot
has to get created from scratch, and the lat/lon data has to be transformed
to the map projection.

When you use "setvalues" to only change the data, then, if I understand it
correctly, the data doesn't have to be transformed again, and hence the
plot can be created faster.

--Mary


On Wed, Nov 19, 2014 at 3:50 PM, Cathy Smith (NOAA Affiliate) <
cathy.smith at noaa.gov> wrote:

>  Mary
> That worked when I tried it. Thanks.
>
> Would I be better off using the regular gsn commands to create animations
> or is set values what one should use if I am trying to make animations that
> don't take too long to create?
>
> Cathy
>
>
>
> On 11/19/14 3:30 PM, Mary Haley wrote:
>
>  ​Hi Cathy,
>
>  None of the "gsnXXXXX" resources are recognized by setvalues or
> getvalues, because the gsnXXXX resources are ones that the gsn_xxxx scripts
> recognize, and not one that the core NCL language recognizes.
>
>  If you need to plot the data with the cyclic point added, but still be
> able to use setvalues in the way that this example does, then you can try
> the unadvertised gsn_add_cyclic_point function which is what "gsnAddCyclic"
> uses "under the hood".
>
>  So, for example, instead of:
>
>    t  = t(0,:,:)
>
>  use this:
>
>    t  = gsn_add_cyclic_point(a->t(0,:,:))                     ; Read
> first time step
>
>  and instead of:
>
>     setvalues plot at data
>       "sfDataArray" : (/a->t(i,:,:)/)
>     end setvalues
>
> use:
>
>     setvalues plot at data
>       "sfDataArray" : (/gsn_add_cyclic_point(a->t(i,:,:))/)
>     end setvalues
>
> --Mary
>
>
> On Wed, Nov 19, 2014 at 12:44 PM, Cathy Smith (NOAA Affiliate) <
> cathy.smith at noaa.gov> wrote:
>
>> Hi-
>> I followed this example
>>
>> https://www.ncl.ucar.edu/Applications/Scripts/animate_1.ncl
>>
>> to generate animations. If I set
>>
>> res at gsnAddCyclic       = True
>>
>> for the first plot, it is plotted correctly. But, subsequent plots all
>> plotted incorrectly as it appears that set values didn't recognize the
>> cyclic True setting.
>> (The array values were stretched to fill the 1 longitude longer data
>> array). We could verify this was the case as when we manually created an
>> extra longitude for the data array after the first plot, then it worked.
>>
>> Can set values be made to use use the gsnAddCycle setting that exists?
>> Or, is there another way that doesn't involve manually adding the extra
>> longitude?
>>
>> Let me know if more info is needed. In this case, I was using V6.1.2
>>
>> Cathy Smith
>>
>>
>>
>>
>> ----------------------------------------------
>> NOAA/ESRL PSD and CU CIRES
>> 303-497-6263
>> http://www.esrl.noaa.gov/psd/people/cathy.smith/
>> Emails about data/webpages may get quicker responses from emailing
>> esrl.psd.data at noaa.gov
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
> --
> ----------------------------------------------
> NOAA/ESRL PSD and CU CIRES303-497-6263http://www.esrl.noaa.gov/psd/people/cathy.smith/
>
> Emails about data/webpages may get quicker responses from emailing esrl.psd.data at noaa.gov
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141120/c4083559/attachment.html 


More information about the ncl-talk mailing list