[Thread Prev][Thread Next][Index]

RE: export time series from netCDF file



Title: Message

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement
Dear All,
 
Thanks to Jian Ma for the help.  My previous message may not describe the problem clearly.   I want to save  ASCII file in table format, but not as "list/format=tab/file=1.dat " in the manual.
 
I attached the data file I am working with.  As you can see, I am trying to use

list/clobber/i=37/file="z.txt" slp

to extract slp time series as the attached table format.  However, I can only get every 2nd point time series for a given start longitude (i=37). Clearly, to get all the time series merged into columns of z.txt, I have to repeat the "list" many times for different longitudes up to 160E (i.e, i=65), and append new time series to the end of columns of the z.txt.   Is there better way to extract all time series over the study region (e.g. X=90e:160e/Y=60S:0S)? 

Thank you for your attention.

Regards,

Yun

-----Original Message-----
From: Jian Ma [mailto:majian@fio.org.cn]
Sent: Thursday, 2 June 2005 2:24 PM
To: Li, Yun (CMIS, Floreat); Ferret user group
Subject: Re: export time series from netCDF file

Dear Yun,
 
Doesn't the method in the user's manual work?
 
If you want to save as a ASCII file in table format, please try as:
 
list/format=tab/file=1.dat ...
 
If you want to read from a ASCII file, please try as:
 
 
Example 4—1 variable, 2 dimensions

4a) Consider a different situation: a greenhouse with three rows of four plants and a file with a single column of data representing the height of each plant at a single time (successive values represent plants in a row of the greenhouse):
3.1
2.6
5.4
4.6
3.5
6.1
. . .

If we want to produce a contour plot of height as a function of position in the greenhouse, axes will have to be defined:

yes? DEFINE AXIS/X=1:4:1 xplants
yes? DEFINE AXIS/Y=1:3:1 yplants
yes? DEFINE GRID/X=xplants/Y=yplants gplants
yes? FILE/VAR=height/GRID=gplants greenhouse_plants.dat
yes? CONTOUR height
When reading data the first index, x, varies fastest. Schematically, the data will be assigned as follows:
x=1 x=2 x=3 x=4
y=1 3.1 2.6 5.4 4.6
y=2 3.5 6.1 . . .
y=3 . . .
4b) If the file in the above example has, instead, 4 values per record:
3.1 2.6 5.4 4.6
3.5 6.1 . . .

then add /COLUMNS=4 to the FILE command:
yes? FILE/VAR=height/COLUMNS=4/GRID=gplants greenhouse_plants.dat
 
 
Hope these can help you some.
 
Regards,
Jian
 
****************************************
Jian Ma
 
M. S. in Physical Oceanography
The First Institute of Oceanography
State Oceanic Administration
P. R. China
 
No. 6 Xian-Xia-Ling Road, Qingdao 266061
Tel: 86-532-8967401
Fax: 86-532-8967400
URL: www.fio.org.cn
****************************************
 
 
 
----- Original Message -----
Sent: Thursday, June 02, 2005 1:46 PM
Subject: export time series from netCDF file

Dear All,
 
Is there a way to extract all time series in ASCII format (file.txt) at each grid point, and form them into a table with each column corresponding to a time series of a grid?  For example, let X1, X2, ...., Xn be the time series (e.g. MSLP) of n grid points over the study area, and xi,j are jth sample value of Xi.  The new data structure is as follows
 
____________________________________________
Date                       X1              X2        ...          Xn

____________________________________________

1948                     x1,1           x2,1        ...        xn,1

1949                     x1,2            x2,2       ....       xn,2

1950                     x1,3            x2,3       ....       xn,3

.....                        ....            ....        ....        ....

2004                    x1,57           ...        ....         xn,57

_____________________________________________

I would be most grateful if you can provide a help here.

Regards,

Yun

 

 

slp.JJA.1948.2004.nc
SET REGION/X=90e:160e/Y=60S:0S

list/clobber/i=37/file="z.txt" slp  

yes? list/i=37
             VARIABLE : JJA SLP
             FILENAME : slp.JJA.1948.2004.nc
             SUBSET   : 25 by 57 points (LATITUDE-TIME)
             LONGITUDE: 90E
      ... listing every   2th point
                     60S    55S    50S    45S    40S    35S    30S    25S    20S    15S    10S    5S      0    
                     13     15     17     19     21     23     25     27     29     31     33     35     37
 01-JUN-1948 /  1:   992.   994.   999.  1006.  1013.  1020.  1022.  1021.  1017.  1013.  1010.  1009.  1009.
 01-JUN-1949 /  2:   983.   988.   998.  1007.  1015.  1021.  1022.  1021.  1018.  1015.  1012.  1011.  1010.
 01-JUN-1950 /  3:   988.   989.   994.  1002.  1011.  1019.  1022.  1021.  1017.  1014.  1011.  1010.  1009.
 01-JUN-1951 /  4:   990.   995.  1003.  1010.  1017.  1021.  1022.  1020.  1017.  1014.  1011.  1011.  1010.
 01-JUN-1952 /  5:   988.   990.   998.  1006.  1013.  1020.  1023.  1022.  1018.  1014.  1012.  1010.  1010.
 01-JUN-1953 /  6:   990.   994.  1002.  1009.  1017.  1022.  1024.  1022.  1019.  1015.  1012.  1011.  1010.
 01-JUN-1954 /  7:   988.   990.   997.  1005.  1013.  1019.  1022.  1021.  1017.  1013.  1011.  1009.  1008.
 01-JUN-1955 /  8:   989.   994.  1001.  1007.  1014.  1020.  1022.  1020.  1017.  1013.  1011.  1009.  1009.
 01-JUN-1956 /  9:   988.   993.  1002.  1010.  1017.  1022.  1024.  1022.  1018.  1014.  1011.  1009.  1009.
 01-JUN-1957 / 10:   989.   992.   999.  1007.  1014.  1020.  1023.  1021.  1018.  1013.  1011.  1009.  1008.
 01-JUN-1958 / 11:   986.   991.   998.  1005.  1012.  1018.  1021.  1020.  1017.  1013.  1010.  1009.  1008.
 01-JUN-1959 / 12:   988.   991.   996.  1003.  1011.  1018.  1021.  1020.  1017.  1013.  1010.  1009.  1008.
 01-JUN-1960 / 13:   988.   989.   994.  1001.  1011.  1019.  1022.  1021.  1018.  1013.  1010.  1009.  1009.
 01-JUN-1961 / 14:   985.   990.   998.  1006.  1014.  1020.  1022.  1021.  1017.  1014.  1011.  1009.  1009.
 01-JUN-1962 / 15:   987.   991.   998.  1006.  1013.  1019.  1021.  1020.  1017.  1013.  1010.  1009.  1009.
 01-JUN-1963 / 16:   991.   993.   999.  1006.  1013.  1018.  1021.  1020.  1018.  1014.  1011.  1009.  1009.
 01-JUN-1964 / 17:   989.   987.   990.   995.  1004.  1013.  1018.  1019.  1017.  1013.  1010.  1009.  1008.
 01-JUN-1965 / 18:   989.   991.   999.  1008.  1017.  1023.  1024.  1022.  1018.  1014.  1012.  1010.  1010.
 01-JUN-1966 / 19:   989.   993.  1001.  1010.  1018.  1023.  1024.  1022.  1018.  1014.  1011.  1009.  1009.
 01-JUN-1967 / 20:   987.   987.   993.  1001.  1011.  1019.  1023.  1022.  1018.  1014.  1011.  1010.  1009.
 01-JUN-1968 / 21:   990.   994.  1001.  1008.  1016.  1022.  1024.  1023.  1019.  1015.  1012.  1010.  1010.
 01-JUN-1969 / 22:   985.   988.   996.  1005.  1015.  1021.  1023.  1022.  1018.  1014.  1011.  1010.  1010.
 01-JUN-1970 / 23:   986.   992.  1000.  1008.  1016.  1021.  1023.  1021.  1018.  1013.  1011.  1009.  1009.
 01-JUN-1971 / 24:   989.   991.   996.  1005.  1014.  1020.  1022.  1020.  1017.  1013.  1011.  1010.  1009.
 01-JUN-1972 / 25:   984.   987.   996.  1005.  1014.  1021.  1023.  1021.  1018.  1014.  1011.  1010.  1009.
 01-JUN-1973 / 26:   988.   993.  1000.  1008.  1015.  1021.  1022.  1020.  1016.  1012.  1010.  1009.  1009.
 01-JUN-1974 / 27:   988.   992.   998.  1005.  1012.  1018.  1021.  1020.  1017.  1013.  1011.  1010.  1009.
 01-JUN-1975 / 28:   986.   991.   999.  1008.  1015.  1020.  1021.  1020.  1017.  1013.  1010.  1009.  1009.
 01-JUN-1976 / 29:   984.   989.   997.  1007.  1016.  1022.  1023.  1022.  1018.  1014.  1011.  1010.  1009.
 01-JUN-1977 / 30:   986.   989.   996.  1004.  1012.  1019.  1021.  1020.  1017.  1014.  1011.  1009.  1009.
 01-JUN-1978 / 31:   987.   992.  1001.  1010.  1018.  1023.  1024.  1022.  1019.  1015.  1012.  1010.  1010.
 01-JUN-1979 / 32:   974.   986.   999.  1010.  1018.  1024.  1024.  1022.  1019.  1015.  1012.  1011.  1010.
 01-JUN-1980 / 33:   980.   982.   991.  1001.  1012.  1020.  1024.  1023.  1019.  1015.  1012.  1010.  1010.
 01-JUN-1981 / 34:   987.   990.   998.  1007.  1015.  1021.  1023.  1021.  1018.  1014.  1011.  1010.  1009.
 01-JUN-1982 / 35:   983.   987.   996.  1006.  1015.  1022.  1025.  1023.  1020.  1015.  1012.  1010.  1010.
 01-JUN-1983 / 36:   984.   989.   997.  1006.  1014.  1018.  1020.  1019.  1016.  1013.  1011.  1010.  1010.
 01-JUN-1984 / 37:   982.   988.   996.  1005.  1013.  1019.  1022.  1021.  1017.  1013.  1010.  1010.  1009.
 01-JUN-1985 / 38:   978.   984.   994.  1005.  1014.  1020.  1022.  1021.  1018.  1014.  1011.  1010.  1010.
 01-JUN-1986 / 39:   986.   993.  1001.  1009.  1017.  1022.  1023.  1022.  1019.  1015.  1012.  1010.  1010.
 01-JUN-1987 / 40:   981.   987.   997.  1007.  1016.  1022.  1024.  1022.  1018.  1014.  1012.  1010.  1010.
 01-JUN-1988 / 41:   979.   982.   990.   999.  1009.  1017.  1021.  1021.  1018.  1014.  1011.  1010.  1009.
 01-JUN-1989 / 42:   979.   986.   997.  1008.  1018.  1024.  1025.  1023.  1018.  1014.  1011.  1010.  1010.
 01-JUN-1990 / 43:   983.   988.   998.  1008.  1017.  1023.  1025.  1022.  1019.  1014.  1012.  1011.  1010.
 01-JUN-1991 / 44:   980.   984.   993.  1003.  1013.  1019.  1022.  1021.  1018.  1014.  1012.  1010.  1010.
 01-JUN-1992 / 45:   985.   987.   993.  1001.  1011.  1018.  1022.  1021.  1018.  1014.  1011.  1010.  1010.
 01-JUN-1993 / 46:   976.   984.   995.  1006.  1016.  1022.  1024.  1022.  1019.  1015.  1012.  1010.  1010.
 01-JUN-1994 / 47:   978.   984.   993.  1003.  1013.  1021.  1024.  1023.  1019.  1015.  1012.  1010.  1009.
 01-JUN-1995 / 48:   983.   988.   994.  1003.  1013.  1020.  1023.  1022.  1019.  1014.  1011.  1009.  1008.
 01-JUN-1996 / 49:   984.   989.   998.  1007.  1014.  1020.  1022.  1021.  1018.  1013.  1011.  1010.  1010.
 01-JUN-1997 / 50:   978.   985.   996.  1007.  1016.  1023.  1026.  1024.  1020.  1016.  1013.  1011.  1010.
 01-JUN-1998 / 51:   980.   987.   997.  1006.  1015.  1021.  1023.  1022.  1018.  1014.  1011.  1009.  1009.
 01-JUN-1999 / 52:   980.   983.   991.  1000.  1010.  1018.  1022.  1022.  1019.  1015.  1012.  1011.  1010.
 01-JUN-2000 / 53:   980.   985.   993.  1002.  1012.  1019.  1022.  1021.  1018.  1013.  1010.  1009.  1009.
 01-JUN-2001 / 54:   978.   983.   993.  1003.  1012.  1019.  1022.  1021.  1018.  1014.  1011.  1010.  1009.
 01-JUN-2002 / 55:   982.   987.   995.  1006.  1015.  1021.  1023.  1021.  1018.  1014.  1012.  1010.  1010.
 01-JUN-2003 / 56:   986.   993.  1001.  1010.  1016.  1020.  1022.  1021.  1018.  1014.  1012.  1010.  1009.
 01-JUN-2004 / 57:   981.   987.   997.  1007.  1016.  1023.  1025.  1023.  1020.  1015.  1012.  1010.  1010.

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement