[Thread Prev][Thread Next][Index]

Re: [ferret_users] how to read data in with SPAWN



Dear Karl,

That worked. I want to read them in different datasets, the use `filelist[I=1]` works fine.

Thank you very much 😸 and have a good weekend.

Xiaoyu

在 2018年10月5日,16:37,Karl Smith - NOAA Affiliate <karl.smith@xxxxxxxx> 写道:

The result of the:
    let filelist = spawn("ls -1 *CNRM*.nc")
is a string array variable on an X axis, and acts like other data arrays:
   list filelist
will list out all the filenames.  (Note the "-1 flag to "ls" - this puts each filename on a separate line.)  To use this list of filenames:

-- If you want to consider all these dataset as parts of one big dataset, consider the "define data /aggregate" commands.  For this command you can just give it the string array variable ("filelist" in the above example).  You will need to choose the appropriate aggregation options depending on what your data files contain and how you want them aggregated.

-- If you just want to open them as separate datasets, the syntax would be: 
   use `filelist[I=1]` 
to open the first one,
    use `filelist[2]`
to open the second one, etc.

Karl



On Fri, Oct 5, 2018 at 11:39 AM Xiaoyu Bai <xbai1@xxxxxxxx> wrote:

--
Karl M. Smith, Ph.D.
JISAO Univ. Wash. and PMEL NOAA
"The contents of this message are mine personally and do
not necessarily reflect any position of the Government
or the National Oceanic and Atmospheric Administration."

[Thread Prev][Thread Next][Index]