[Thread Prev][Thread Next][Index]

Re: [ferret_users] How to plot Time series of following data;



Hi Karnan,
This data is not on a grid. The kinds of commands you used would only work if there were a data point in the file at every depth and every time represented in the grid you defined. 

ASCII data always takes customized commands, and not all data easily conforms to the data model in Ferret (or any program, of course).

It looks like this data represents individual profiles, each a time series of measurements of Chlorophyll at a set of depths.  The first set all have the same date; the second set is one measurement per day.  The set of depths are different in the two profiles.  Here's the data:

"Latitude";"Longitude";"Depth";"TIME";"Chl a"
19;89;1;"15/07/2012";0.0984
19;89;2;"15/07/2012";0.1028
19;89;3;"15/07/2012";0.0993
19;89;4;"15/07/2012";0.1016
19;89;5;"15/07/2012";0.1021
19;89;6;"15/07/2012";0.0954
19;89;7;"15/07/2012";0.0964
19;89;8;"15/07/2012";0.086
19;89;9;"15/07/2012";0.0959
19;89;10;"15/07/2012";0.0911
;;;;
;;;;
19;89;105;"20/07/2012";0.1004
19;89;106;"21/07/2012";0.0973
19;89;107;"22/07/2012";0.1096
19;89;108;"23/07/2012";0.1102
19;89;109;"24/07/2012";0.1121
19;89;110;"25/07/2012";0.1085
19;89;111;"26/07/2012";0.105
19;89;112;"27/07/2012";0.1117
19;89;113;"28/07/2012";0.1206
19;89;114;"29/07/2012";0.1223
19;89;115;"30/07/2012";0.1214
19;89;116;"01/08/2012";0.1224
19;89;117;"02/08/2012";0.1235
Because the dates are in string format, you will need to use the SET DATA/FORMAT=DELIMITED form instead of the FILE command.  An alias for SET DATA/FORMAT=DELIMITED is COLUMNS.  The quote marks in the data are problematic and they interfere with the command syntax.  Before making the tests below, I used my text editor to removed them, so the lines look like,
19;89;1;15/07/2012;0.0984
19;89;2;15/07/2012;0.1028

Here is a command that reads the whole file.  The lines that have ;;;; are read as missing-data values.
COLUMNS/SKIP=1/delim=";"/var="Latitude,Longitude,Depth,TIME,Chl_a"/type="num,num,num,eurodate,num" TS.dat
set var/units="m" depth

plot/vs/ribbon/thick time, depth, chl_a
Which shows depth in meters as a function of time in days-since the start of January 1900, and colored with the chlorophyll value. This plot requires the most-recent Ferret with the /RIBBON qualifier.  Try this command to make depth run from 120 at the bottom up to zero, and to make a better scale on the horizontal axis.
plot/vs/ribbon/thick/hlim=41100:41125/vlim=120:0 time, depth, chl_a
There is more one could do with this, but this will give you a flavor of what it looks like.

Ansley

On 3/29/2013 2:20 AM, Karnan C wrote:
Dear Ferret users,

I attached the a sample data set here.

File name:"TS.dat"         \\ (csv)
(Time series data),
X=89E, Y=19N,
Depth=1:120m
Time and format=15-07-2012 and 20-07-2012 to 02-08-2012, (Totally 15 days)
Variable= Chlorophyll a

I used the following scripts, But I can't get the result.
(I'm very new to the ferret)
Help me,

yes? define axis/x=89:89:1/unit=degree xaxis
yes? define axis/y=19:19:1/unit=degree yaxis
yes? define axis/z=1:120:1/unit=meter zaxis
yes? define axis/t=0:15:1/t0="15-JUL-2012"/unit=days taxis  \\ (A break in the dates, how to define?)
yes? define grid/x=xaxis/y=yaxis/z=zaxis/t=taxis allgrid

yes? file/var="Latitude,Longitude,Depth,Time,Chl a"/grid=allgrid TS.dat   \\ (After this How to fill or shade?)
yes? fill Chl a
 **ERROR: command syntax: Chl a
          Chl before a is illegal

yes? show grid allgrid
    GRID ALLGRID
 name       axis              # pts   start                end
 XAXIS     LONGITUDE            1mr   89E                  89E
 YAXIS     LATITUDE             1 r   19N                  19N
 ZAXIS     Z (METER)          120 r   1                    120
 TAXIS     TIME                16 r   15-JUL-2012 00:00    30-JUL-2012 00:00
 normal    E
 normal    F

yes? show data TS.dat
     currently SET data sets:
    1> /home/data_disk/fer_dsets/data/TS.dat  (default)
 name     title                             I         J         K         L         M         N
 LATITUDE LATITUDE                         1:1       1:1       1:120     1:16      ...       ...
 LONGITUDE
          LONGITUDE                        1:1       1:1       1:120     1:16      ...       ...
 DEPTH    DEPTH                            1:1       1:1       1:120     1:16      ...       ...
 TIME     TIME                             1:1       1:1       1:120     1:16      ...       ...
 CHL      CHL                              1:1       1:1       1:120     1:16      ...       ...
 A        A                                1:1       1:1       1:120     1:16      ...       ...
 
yes? set region/x=89/y=19
yes? fill/k=1:120/l=1:16 Chl
 **TMAP ERR: Success
             during SKIP reads
             Data set: /home/data_disk/fer_dsets/data/TS.dat
             Data file: /home/data_disk/fer_dsets/data/TS.dat#

 yes? fill/k=1:120 Chl
 **TMAP ERR: Success
             during SKIP reads
             Data set: /home/data_disk/fer_dsets/data/TS.dat
             Data file: /home/data_disk/fer_dsets/data/TS.dat#

When should I save the data as netcdf (and how), that will help me to escape from define every time.


Thanks,

--
C. Karnan
CSIR - JRF  
National Institute of Oceanography (CSIR)
Regional Centre, Dr Salim Ali Road
Kochi - 682 018.

Mobile No. +91 9633032345; +91 9941811608



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

Privacy Policy | Disclaimer | Accessibility Statement