[Thread Prev][Thread Next][Index]

Re: [ferret_users] for multiple png or gif file for the use of animation



thank you mr. sudheer for highlighting my mistake i will do this task again and will get back to you.

regards, saurabh

On Thu, Nov 17, 2016 at 10:37 AM, Sudheer Joseph <sjo.india@xxxxxxxxx> wrote:
Hi Saursbh,
You are using inverted comma instead of grave accent which do not interpret li,zw=3
You can see it in below link where image of keyboard is shown.


On Thu, 17 Nov 2016 at 4:47 AM, saurabh rathore <rohitsrb2020@xxxxxxxxx> wrote:
Dear all,
thanks for you reply but sadly i am not able to plot multiple gif or png file in one go. by using coads_climatology 12 image file of sst are developing but only last one is saving everytime.

i am attaching the script and the command that i issue in pyferret. if possible please provide me a script for pyferret or for ferret just for coads_climatology of sst later on i will modify this code for my higher number of images. i hope i will get more help so that i can complete this task of animation in my further work.

this is my command that i issued on pyferret command prompt

repeat/l=1:12 (let li='l';define symbol stamp='li,zw=3';define symbol filename=sst_($stamp);sp rm ($filename).png;go gif.jnl sst[l='li'])

this is the gif.jnl script commands

use coads_climatology
fill/pal=blue_orange sst
go fland
frame/file=gif0.png/format=png/ypixel=1024

this is the message that i am getting on running the repeat command (this type of message is for all 12 time steps)

use coads_climatology
fill/pal=blue_orange sst
go fland
 
frame/file=gif0.png/format=png/ypixel=1024
!-> REPEAT: L=12
 !-> define symbol filename=sst_'li,zw=3'
 !-> sp rm sst_'li,zw=3'.png
rm: cannot remove 'sst_li,zw=3.png': No such file or directory


regards, saurabh

On Thu, Nov 17, 2016 at 5:26 AM, Ansley C. Manke <ansley.b.manke@xxxxxxxx> wrote:
Hi
I have just one more thing to add.  Often it's cleaner to put the set of commands into a separate script, and just run that script in the loop.  Because all variables and symbols are defined globally within the Ferret session, the png file name symbol is available within the script; or you could send that in as an argument to the script as well.  For instance, you could break off the plot commands into a script:

use coads_climatology

repeat/l=1:12 (\

let li=`l`;\
define symbol stamp=`li,zw=3`;\
define symbol filename=sst_($stamp);\
sp rm ($filename).png;\
go timeplot sst[L=`li`])

Where the script timeplot.jnl might contain something like this:

! timeplot.jnl
! Argument 1 is the variable to plot

shade/set/pal=blue_orange $1
  ppl tics...
  ppl shakey...
ppl shade

go fland

frame/file=($filename).png/format=png/ypixel=1024

This could be all done in the repeat loop. Loops CAN contain all commands, including PPL commands, all separated by  semicolons, but once they start to get long, a separate script is easier to debug and maintain.

Ansley



On 11/16/2016 8:15 AM, Martin Schmidt wrote:

Hi,

using "frame" repeatedly with the same file name produces files with an additional extension. Just use the unix command 'ls' to explore this.

What image files are suitable for you depends on the software to compile the animation. There is a simple old tool 'whirlgif' to produce an animated gif. Its nice and easy to use, but vanishs out of sight of google. It requires gif input. Please note, the most favourable version of ferret, namely pyferret does not support gif anymore but produces png-files. If you need gifs just write a little shell script using the ImageMagic tool 'convert' to produce gif files. Something like

files=`ls *png`

for file in $files
do
  name=`echo $file | cut -f1 -d.`                                                                                                                       
  echo $name                                                                                                                                            
  convert $name.png $name.gif                                                                                                                           
done 

More complex tools like mencoder can be used to glue a sequence of png-files.                                                                                                                                                  

But now to ferret. Just organise a loop over the time slices. It is easy to generalise it for more than 12 steps.

use coads_climatology

repeat/l=1:12 (\
shade/pal=blue_orange sst;\
let li=`l`;\
define symbol stamp=`li,zw=3`;\
define symbol filename=sst_($stamp);\
sp rm ($filename).png;\
frame/file=($filename).png/format=png/ypixel=1024;\
)

You may guess the reason for the complex way to build the filename. Using ls *png produces the file list in the correct order, not only for 12 time slices but also for a larger number (<1000 or for more with zw=4). This allows to produce an ordered list of files to be glued to an animated file with a single unix command ls sst*.png > filelist.

Hope this helps to get you started. 

Best,

Martin

From: saurabh rathore

Sent: 15 November 2016 23:21
To: ferret users
Subject: [ferret_users] for multiple png or gif file for the use of animation

 

dear all,

i want to create multiple png or gif files to produce animation which is my next concern step. i am having the latest pyferret and ferret and by the use of pyferret i am doing in this way

use coads_climatology

REPEAT/L=1:12 (FILL SST; GO fland; FRAME/file=sst0_`l`.gif)

but i am getting only a single image of the last time step instead of 12 images which i want to use in further animation.

apart from this i also want to ask that can i create multiple .png files for my animation and for the beautification of my plots how to issue multiple commands like ppl tics, shakey, conset etc. in this excercise.

i hope i will get help on this regard. 

 

regards, saurabh

 


--

 

 

REGARDS

 

Saurabh Rathore

Research Scholar (PhD.)

Centre For Oceans, Rivers, Atmosphere & Land Science Technology

Indian Institute Of Technology, Kharagpur

contact :- 91- 8345984434

 






--


REGARDS

Saurabh Rathore
Research Scholar (PhD.)
Centre For Oceans, Rivers, Atmosphere & Land Science Technology
Indian Institute Of Technology, Kharagpur
contact :- 91- 8345984434
--
Sent from my iPhone 5S



--


REGARDS

Saurabh Rathore
Research Scholar (PhD.)
Centre For Oceans, Rivers, Atmosphere & Land Science Technology
Indian Institute Of Technology, Kharagpur
contact :- 91- 8345984434

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement