[ncl-talk] Fix topography contour in animation
Mary Haley
haley at ucar.edu
Fri Jul 31 13:04:06 MDT 2015
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/20150731/ecbc23a6/attachment.html
More information about the ncl-talk
mailing list