[ncl-talk] Fix topography contour in animation

Mary Haley haley at ucar.edu
Mon Aug 3 09:06:15 MDT 2015


The same principles apply when overlay contour lines versus filled contours.

But, I do see that it can be an issue if you are trying to overlay lines
with labels, and the labels keep changing.

I suggest either turning off the line labels with "res at cnLineLabelsOn =
False", or try to control the look of your labels with some extra
resources. You can see some examples at:

http://www.ncl.ucar.edu/Applications/contourLab.shtml

I don't know if you need to define a new workstation inside the loop, every
time you create a topography plot. It's likely that you can just have one
workstation open, as I do in the example I created earlier, and then just
change the data each time in the loop.

--Mary

On Mon, Aug 3, 2015 at 3:25 AM, Sebastian Otarola-Bustos <
Sebastian.F.Otarola-Bustos.1 at nd.edu> wrote:

> Thank you very much Mary, I saw your nice script, but I'm not sure if it
> is what I'm looking for. Because I want to do contours lines of height, but
> not filled, because I want them to be over a colormap. And My trouble is
> that I'm plotting topography inside the loop, and the labels of the contour
> lines are changing their possitions on every iteration. So it's a little
> bit confussing. And I don't know how to do this outside the loop, because
> I'm defining the workstation inside.  I'm also not sure if I can overlay
> things that belong from different workstations. In that case, I only need
> to plot topography once before the do loop, but I haven't checked yet :P
>
> All the best,
> Thank you,
> Sebastián.
>
> On Fri, Jul 31, 2015 at 3:04 PM, Mary Haley <haley at ucar.edu> wrote:
>
>> Sebastian,
>>
>> Please see a new example I just created, which generates an animation of
>> filled contours of a data field across time, over filled contours of a
>> terrain map.
>>
>> http://www.ncl.ucar.edu/Applications/animate.shtml#ex3
>>
>> The terrain map is static for each time step, while the reflectivity
>> changes. The animate_3_1.ncl script is the more traditional way of
>> generating the contours, like you are currently doing, while the
>> animate_3_2.ncl and animate_3_3.ncl use "setvalues" and/or
>> "NhlRemoveOverlay" to speed things up.
>>
>> I didn't get a lot of speed up with the "faster" versions of this script,
>> because the field I contoured was relatively small and I "only" had 97 time
>> steps.  If you have more time steps or your terrain map is particularly
>> large, then you might get better speed up with animate_3_2.ncl or
>> animate_3_3.ncl.
>>
>> I may attempt a panel plot of this same script but at different levels,
>> just to see if I better illustrate the speed up better.
>>
>> --Mary
>>
>>
>>
>>
>> On Tue, Jul 21, 2015 at 4:40 AM, Sebastian Otarola-Bustos <
>> Sebastian.F.Otarola-Bustos.1 at nd.edu> wrote:
>>
>>> Hi All,
>>>
>>> I'm trying to do an animation of different fields and I need to plot
>>> also topography contours, because I'm working in a valley surrounded by
>>> mountains. I'm doing something like this:
>>>
>>>    do n=0,ntimes-1
>>>       wks = gsn_open_wks("png","animate"+sprinti("%03i",n))
>>>       print("Trabajando en el tiempo: " + times(n))
>>>       res at gsnRightString  = "    Tiempo:  "+ times(n)
>>>       res at gsnDraw = False
>>>       res at gsnFrame = False
>>>       plotB = gsn_csm_contour(wks,SLP(n,:,:),res)
>>>       plotA = gsn_csm_contour(wks,ter(:,:),ter_res)
>>>
>>>       map = gsn_csm_map(wks,map_res)
>>>        overlay(map,plotB)
>>>       overlay(map,plotA)
>>>       draw(map)
>>>       frame(wks)
>>>
>>>       delete(wks)   ; Make sure PNG file is closed
>>>     end do
>>>
>>> The problem is, as I'm creating the workstation inside de loop, I have
>>> to plot topography(which is a static field) every time. And when I finally
>>> see the animation, the contours are fixed, but the contour numbers are
>>> moving all the time. Does anybody know other way to the the same or to fix
>>> this?
>>>
>>>
>>> All the best,
>>> Sebastián.
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150803/01e33df3/attachment.html 


More information about the ncl-talk mailing list