[Thread Prev][Thread Next][Index]

Re: Looping through varables in a data set



Hi Mike,

There's nothing to automate that in V5.22.  In the V5.33 beta (available for
download) we get half way there -- see the example below. Support for strings
in Ferret is still under development. One of the future syntaxes will be
various metadata available through "dot" notation. For example:
    <my_data_set>.variables
will be an array of strings that will behave much like "names" in the example
below.

    - steve

=======
> ferret_v533
        NOAA/PMEL TMAP
        Program FERRET (beta)
        Version 5.33 - 06/19/01
        24-Aug-01 18:42

yes? let names = {"a","b","c"}
yes? list names
             {"a","b","c"}
 1   / 1:"a"
 2   / 2:"b"
 3   / 3:"c"
yes? repeat/i=1:`names,return=isize` (let a = names[i=`i`]; say `a`)
 !-> repeat/i=1:3 (let a = names[i=`i`]; say `a`)
!-> REPEAT: I=1
 !-> DEFINE VARIABLE a = names[i=1]
 !-> MESSAGE/CONTINUE a
a
!-> REPEAT: I=2
 !-> DEFINE VARIABLE a = names[i=2]
 !-> MESSAGE/CONTINUE b
b
!-> REPEAT: I=3
 !-> DEFINE VARIABLE a = names[i=3]
 !-> MESSAGE/CONTINUE c
c

================================================

"McCann, Mike" wrote:

> Hi,
>
> I wish to write a go script that will take any number of variables
> in my netCDF time series data file, loop through the variables and
> create representative graphics for each of the variables.
>
> Is there a way to get the list of variables so that the go script
> can us them in a REPEAT-like loop to create the output I desire?
>
> Thanks in advance,
> Mike
>
> --
> Mike McCann   (mccann@mbari.org)
> Monterey Bay Aquarium Research Institute
> 7700 Sandholdt Road
> Moss Landing, CA 95039-9644
> Voice: (831) 775-1769   Fax: (831) 775-1646 http://www.mbari.org/rd/iag.htm

--

                |  NOAA/PMEL               |  ph. (206) 526-6080
Steve Hankin    |  7600 Sand Point Way NE  |  FAX (206) 526-6744
                |  Seattle, WA 98115-0070  |  hankin@pmel.noaa.gov




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement