[Thread Prev][Thread Next][Index]

Re: [EXTERNAL] [ferret_users] Time series



Hi

I think that Xiaou's solution will work fine.

If the your station datasets have a time coordinate, so that the variables are z-by-t, and if the variables in all of the files have the same set of depths, then you could use the timeseries aggregation method to define a virtual dataset containing all the data, which is Z by T

See https://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/commands-reference/DEFINE#_define_data_agg

It might look like this:

yes? let my_files=spawn("ls -1 /datapath/station*.nc")  
yes? tseries all_stations = my_files

yes? show data
     currently SET data sets:
    1> all_stations  (default)
 name     title                             I         J         K         L
 var      station data                     ...       ...       1:20      1:25
 
yes? plot/along=z var


The plot/along= will draw a set of line plots from a multi-dimensional variable. 

Ansley


On 10/3/2022 3:06 PM, Xiaoyu Bai wrote:
Hi Swetha,

I only know how to simplify the first half currently. What you can do is:

let my_files=spawn("ls -1 /datapath/station*.nc")   
! it will look like when you use the list command and it is like an array that stores your files one by one

repeat/range=1:25/name=order (define symbol xx=`order`; use 'my_files[x=($xx)]')
! variable order will change every time you do a loop and you need a variable to respond to the changes

For the plotting part, I am not exactly sure. I am guessing that you can use a similar method like

repeat/range=1:25/name=order (define symbol xx=`order`; plot 'T[d=($xx)]') 
but I never tried it before. 😹

Best,

Xiaoyu

            

On Mon, Oct 3, 2022 at 1:30 AM Swetha sivakumar <swetha.s2060@xxxxxxxxx> wrote:
[Caution: Email from External Sender. Do not click or open links or attachments unless you know this sender.]
 
Hello all

I have 25 station point data stored in 25 files. I need to plot a time series of variable temperature for 25 stations. 

I am currently using the below code to do it. Is there any efficient way to achieve the same ?

use station1.nc
..
..
use station25.nc

plot T[d=1]
plot/ov T[d=2]
.. ..
..
plot/ov T[d=25]

Thank You
S


--
Xiaoyu (she/her)

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

Privacy Policy | Disclaimer | Accessibility Statement