reading data idl [message #92451] |
Fri, 18 December 2015 12:17  |
siumtesfai
Messages: 62 Registered: April 2013
|
Member |
|
|
Hi
I have problem reading text file with header in idl
my data sample is shown below
254 0 1 JUN 1957
1 13996 72456 39.07N 95.62W 269 99999
2 1000 2000 1640 15 7 0
3 TOP ms
9 9830 269 250 177 180 20
4 10000 117 99999 99999 99999 99999
4 8500 1527 153 83 345 20
4 7000 3143 41 8 352 20
4 5000 5809 -114 99999 37 30
4 4000 7490 -214 -280 268 80
4 3000 9551 -369 -444 229 110
4 2500 10786 -480 99999 232 160
4 2000 12219 -598 99999 247 250
4 1500 13981 -637 99999 245 180
4 1000 16513 -618 99999 230 60
254 0 2 JUN 1957
1 13996 72456 39.07N 95.62W 269 99999
2 1000 2000 1730 15 7 0
3 TOP ms
9 9870 269 214 96 20 100
4 10000 154 99999 99999 99999 99999
4 8500 1539 102 37 52 140
4 7000 3137 28 -94 58 80
4 5000 5785 -112 -141 331 40
4 4000 7467 -220 -246 199 40
4 3000 9515 -385 -422 208 90
4 2500 10742 -482 99999 212 180
4 2000 12174 -599 99999 220 250
4 1500 13939 -624 99999 246 190
4 1000 16465 -629 99999 275 70
sample code
nlines = FILE_LINES(filename)
sarr = STRARR(nlines)
OPENR, unit, filename,/GET_LUN
READF, unit, sarr
FREE_LUN, unit
==============
|
|
|
Re: reading data idl [message #92452 is a reply to message #92451] |
Fri, 18 December 2015 13:29   |
Phillip Bitzer
Messages: 223 Registered: June 2006
|
Senior Member |
|
|
On Friday, December 18, 2015 at 2:18:00 PM UTC-6, Sium T wrote:
> Hi
>
> I have problem reading text file with header in idl
>
> nlines = FILE_LINES(filename)
> sarr = STRARR(nlines)
> OPENR, unit, filename,/GET_LUN
> READF, unit, sarr
> FREE_LUN, unit
>
> ==============
What's the problem?
|
|
|
Re: reading data idl [message #92453 is a reply to message #92452] |
Fri, 18 December 2015 14:16  |
siumtesfai
Messages: 62 Registered: April 2013
|
Member |
|
|
On Friday, December 18, 2015 at 4:29:37 PM UTC-5, Phillip Bitzer wrote:
> On Friday, December 18, 2015 at 2:18:00 PM UTC-6, Sium T wrote:
>> Hi
>>
>> I have problem reading text file with header in idl
>>
>> nlines = FILE_LINES(filename)
>> sarr = STRARR(nlines)
>> OPENR, unit, filename,/GET_LUN
>> READF, unit, sarr
>> FREE_LUN, unit
>>
>> ==============
>
> What's the problem?
The problem is How I can put the data into an array with the following dimension
Data= [ pressure,Year, month]
Original data is daily data at several discrete pressure levels, year and month
Best regards
|
|
|