[Thread Prev][Thread Next][Index]

Re: [ferret_users] using arguments in file creation



Hi Paul,
         In Ferret, the dollar field is used only with SYMBOLS/arguments to
GO files. In your script, within the repeat loop, "L" is a single value 
VARIABLE, and hence you have to use grave accents (``) instead of "$" field. 
If you prefer to use symbols rather than variables, you have to define it
explicitly within the repeat loop, as shown in the example 2 below. It is 
assumed that you have only 99 or less number of time steps to plot.

Example 1
----------
   set data coads_climatology
 
   set reg/x=30:120/y=-30:30

   REPEAT/L=1:12:1 (;\
        fill/levels=(10,30,1)/line/key sst ;\
        go land                            ;\
        let l_id = IF `L LT 10` THEN "0`L`" ELSE "`L`" ;\
        say "  Forecast_timestep-`l_id`.gif"           ;\
        pause ;\
   )

Example 2
----------
   set data coads_climatology

   set reg/x=30:120/y=-30:30

   REPEAT/L=1:12:1 (;\
        define symbol ll = `L` ;\
        fill/levels=(10,30,1)/line/key sst ;\
        go land ;\
        let l_id = IF `($ll) LT 10` THEN "0($ll)" ELSE "($ll)" ;\
        say "  Forecast_timestep-`l_id`.gif" ;\
        pause ;\
   )

In above examples, replace the say command by 

     FRAME/FILE=Forecast_timestep-`l_id`.gif

for properly named gif outputs.

Please let me know if you have any questions.....

Regards,

Jaison


On Thu, 30 Aug 2007 Paul.Durack@xxxxxxxx wrote:

> Hi there All,
> 
> I've been trying to loop through a time axis and write out plotted
> images to a file using:
> 
> yes? repeat/L=1:65 (sha/levels=(0)(0,60,5)(200) rnd; vector/overlay/k=18
> u, v; go land; frame/file=Forecast_timestep-$L.gif; pause;)
> 
> However, ferret is not substituting the $L for the numbers (1:65) in the
> resulting filenames..
> 
> Is it possible to create files using similar (altered) syntax?
> 
> Thanks,
> 
> Paul
> 
> 
> 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement