animations using image magick

From: Jon Meyer <jonathan.meyer_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 16 2014 - 13:39:32 MDT

Hi,

I am using NCL to create .ps files with multiple pages that are converted
to .gif files using a call to image magick from NCL.

I am following this example:
http://www.ncl.ucar.edu/Applications/Scripts/animate_2.ncl

While the .ps files all appear normal and acceptable, the .gif frames are
not aligned appropriately after the first frame is plotted. I have tried
using the -dispose flag to clear previous frames, but the issue persists.

Attached is a copy of the original .ps file, and the converted .gif file to
demonstrate the issue.

Thanks,
Jon

Below is the pertinent code snippet:

;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;Begin plotting
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  fig_name = "WindsClimo"
  wks = gsn_open_wks("ps", "Animations/"+fig_name)
  gsn_define_colormap(wks, "WhiteBlueGreenYellowRed")

  ; =================================================================
  ; ASSIGN PLOT RESOURCES
  ; =================================================================

  res = True
 ;use desired resources set below
; res@gsnMaximize = True
  res@gsnSpreadColors = True
; res@gsnFrame = False
; res@gsnDraw = False
  res@gsnRightString = " "
  res@gsnLeftString = " "
  res@gsnStringFontHeightF = 0.02

  res@mpFillOn = False
  res@mpLimitMode = "Corners"
  res@mpUSStateLineColor = "black"
  res@mpOutlineBoundarySets = "GeophysicalAndUSStates"
  res@mpProjection = "Mercator"
  res@mpLeftCornerLatF = lat(0,0)
  res@mpLeftCornerLonF = lon(0,0)
  res@mpRightCornerLatF = lat(n_lat-1,n_lon-1)
  res@mpRightCornerLonF = lon(n_lat-1,n_lon-1)

  res@pmTickMarkDisplayMode = "Always" ; Turn on map
tickmarks.

  res@vcRefLengthF = 0.08
  res@vcGlyphStyle = "CurlyVector"
  res@vcMinDistanceF = 0.04
  res@vcRefAnnoBackgroundColor = "grey"
  res@vcRefAnnoFontHeightF = 0.02
  res@vcRefAnnoOrthogonalPosF = -0.20
  res@vcRefAnnoParallelPosF = .93

  ; =================================================================
  ; CREATE THE PLOTS
  ; =================================================================

  plot = gsn_csm_vector_map(wks,U_climo(0,0,0,:,:),V_climo(0,0,0,:,:),res)
  plot = gsn_csm_vector_map(wks,U_climo(1,0,0,:,:),V_climo(1,0,0,:,:),res)
  plot = gsn_csm_vector_map(wks,U_climo(2,0,0,:,:),V_climo(2,0,0,:,:),res)

  ; =================================================================
  ; CONVERT PS TO GIF ANIMATION
  ; =================================================================

  delete(wks) ; Make sure PS file is closed
  system("rm Animations/"+fig_name+".gif")
  cmd = "convert -delay 125 Animations/"+fig_name+ ".ps Animations/"
+fig_name+".gif"
  system(cmd)

Received on Wed Jul 16 07:39:49 2014

This archive was generated by hypermail 2.1.8 : Fri Aug 01 2014 - 15:10:55 MDT