Create the animate gif file in the CDAT

Dear All,

Here is the sample code to generate the animate gif file in the CDAT.

For the we need to install the following package.

In ubuntu – sudo apt-get install gifsicle


import cdms2,vcs
f = cdms2.open('out.xml')
data = f('pobs')

for i in range(0,len(data)):
     x.clear()
     x.plot( data( time=slice(i,i+1) ),continents = 6, bg = 0)
     x.gif('outfile.gif',merge='a')
Thanks,
Arulalan.T
Advertisements

About arulalant

Currently working as "Project Scientist – C" in National Centre for Medium Range Weather Forecasting (NCMRWF), MoES, Noida, India
This entry was posted in CDAT, Python and tagged , , , . Bookmark the permalink.

One Response to Create the animate gif file in the CDAT

  1. kunjaai says:

    Another way to make animation is
    >>>import sys, os
    >>>os.system(“convert -density 300 -delay 190 -loop 50 *.pdf -resize 2024×1024 My_animation.gif”)

    Here we can control the frame rate by giving value to “-delay 190” ..and we can define the resolution of plot also….

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s