[Thread Prev][Thread Next][Index]

Re: [ferret_users] ASCII DATA TO NETCDF



Hi,

Your file has non-numeric fields, with each record starting with "I / *:", and with some fields containing "..."

The command "COLUMNS", which is an alias for SET DATA/format=delimited, allows you to read more than 20 variables from an ascii file. It also allows for reading text and date/time variables as well as numeric ones. The command can automatically analyze the types of the different fields. So,

yes? columns/delimiter=" " 09_iPrf111.txt
yes? show data
currently SET data sets:
1> ./09_iPrf111.txt (default)
name title I J K L
V1 V1 1:8818 ... ... ...
V2 V2 1:8818 ... ... ...
V3 V3 1:8818 ... ... ...
V4 V4 1:8818 ... ... ...
V5 V5 1:8818 ... ... ...
V6 V6 1:8818 ... ... ...
V7 V7 1:8818 ... ... ...
V8 V8 1:8818 ... ... ...
V9 V9 1:8818 ... ... ...
V10 V10 1:8818 ... ... ...
V11 V11 1:8818 ... ... ...
V12 V12 1:8818 ... ... ...
V13 V13 1:8818 ... ... ...
V14 V14 1:8818 ... ... ...
V15 V15 1:8818 ... ... ...
V16 V16 1:8818 ... ... ...
V17 V17 1:8818 ... ... ...
V18 V18 1:8818 ... ... ...
V19 V19 1:8818 ... ... ...
V20 V20 1:8818 ... ... ...
V21 V21 1:8818 ... ... ...
V22 V22 1:8818 ... ... ...
V23 V23 1:8818 ... ... ...
V24 V24 1:8818 ... ... ...
V25 V25 1:8818 ... ... ...
V26 V26 1:8818 ... ... ...
V27 V27 1:8818 ... ... ...

yes? list/i=1:10 v1,v2,v3,v4,v5
DATA SET: ./09_iPrf111.txt
X: 0.5 to 10.5
Column 1: V1
Column 2: V2
Column 3: V3
Column 4: V4
Column 5: V5
V1 V2 V3 V4 V5
1 / 1: "I" "/" "*:" 116890. 21.14
2 / 2: "I" "/" "*:" 116891. -28.35
3 / 3: "I" "/" "*:" 116892. -19.15
4 / 4: "I" "/" "*:" 116893. -25.67
5 / 5: "I" "/" "*:" 116894. -23.39
6 / 6: "I" "/" "*:" 116895. 0.07
7 / 7: "I" "/" "*:" 116896. 28.81
etc.

So your data is in the variables v4,v5,...

Because missing-data in your file being shown as "...", those variables will be detected as text type variables. I would suggest that you use an editor to change "..." to some value that won't be in the data, for instance -1.e34, or -99999. (These are the things that NetCDF does for us automatically that need to be handled specifically for ASCII data.) Then in your Ferret script you would use commands like this to handle the missing data

yes? set variable/bad=-99999 v4
yes? set variable/bad=-99999 v5

and so forth. SET VARIABLE can also be used to give the variables units, names, and titles.



On 7/24/2017 1:55 AM, Gopal Mondal wrote:
Hi ferreeters, hi develo,pers

I can't list the variables from the attached file, In this file variable are inserted in collumn, 24 variables are there. Finally I want te mke it a netcdf file with starting date 01-01-2007. I want to list one by one collumn, In ferret I tried with the following comands
Please help me
list v1
**TMAP ERR: Success
Last or next-to-last record read:
I / *: 116890. 21.14 -141.1 0.04169 12.00 8.000 82558. 237.7 60.40 1
Data set: ./09_iPrf111.txt
Data file: ./09_iPrf111.txt
*** NOTE: ASCII file reading: Insufficient memory reading variable 21
yes? list v1
**TMAP ERR: Success
during SKIP reads
Data set: ./09_iPrf111.txt
Data file: ./09_iPrf111.txt
*** NOTE: ASCII file reading: Insufficient memory reading variable 21
yes? file/var=v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19 09_iPrf111.txt
yes? list v1
**TMAP ERR: Success
Last or next-to-last record read:
I / *: 116890. 21.14 -141.1 0.04169 12.00 8.000 82558. 237.7 60.40 1
Data set: ./09_iPrf111.txt
Data file: ./09_iPrf111.txt
*** NOTE: ASCII file reading: Insufficient memory reading variable 20



[Thread Prev][Thread Next][Index]