[Thread Prev][Thread Next][Index]

Re: [ferret_users] Naming (sorting) output frames in the loop REPEAT/L=...



If you don't care about leading zeroes, then it is pretty easy. Use the syntax REPEAT/RANGE=/NAME=

repeat/range=1:15:2/name=ct1 (let ct2=`ct2`; def sym ct3 `ct2`; plot/....; frame/file=myplot.($ct3).gif)

The need to do the double definition is cumbersome, but I think it is necessary to end up with a symbol. Once you have the symbol defined, then it is useful for many things, however.

You can do leading zeroes by doing the 1-9's first, then the 10-99's, etc. Smarter people than me (Andrew Wittenberg, Ryo Furue) can probably do this much more elegantly.

BK

On 18 Jul 2011, at 9:22 PM, Sergei Maurits wrote:

Dear Ferret Users,

I output GIF files in the large loop with command REPEAT/L=1,120, 12. So far I failed to find syntax solution that would output my GIF-frames with L- count, like frame.001.gif,
frame.002.gif, ...etc.

Naturally, in the standard output the frames are named according to the Ferret standards

frame.gif
frame.gif.~1~
frame.gif.~2~
....

So, my questions:

1. Is there any way to name output with the current value of loop variable L in the GIF file name?
2. Are there some UNIX  tools for the following transition


first frame         frame.gif         ==> frame.0001.gif
second frame  frame.gif.~1~ ==> frame.0002.gif
....
or something without leading zeros and dots (these are easy to insert) like

first frame        ==> frame.1.gif
second frame ==> frame.2.gif
....

Basically, I need something that counts frame not in a regular order and substitutes
~n~  in Ferret notation with the direct order frame number

I am aware about Fsort utility, but I'd like to check first about other tools before I
start my own scripting.

Thank you,
Sergei Maurits

Dr. Sergei Maurits, HPC Specialist
Arctic Region Supercomputing Center
University of Alaska Fairbanks
Fairbanks, AK 99775-6020
907 450 8697 voice   907 450 8604 fax.
maurits@xxxxxxxx



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
William S. Kessler
NOAA / Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115 USA

william.s.kessler@xxxxxxxx
Tel: 206-526-6221
Fax: 206-526-6744
Web: http://www.pmel.noaa.gov/people/kessler



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

Privacy Policy | Disclaimer | Accessibility Statement