Re: Reading in a header with blank lines [message #40973] |
Mon, 20 September 2004 03:51 |
lloyd
Messages: 16 Registered: February 2003
|
Junior Member |
|
|
Yeah I tried this originally, and it didn't work. Tried it again as I
may of made a mistake the first time, and it works with no problems
(obviously I had done something stupid again).
Thanks very much,
Lloyd
|
|
|
Re: Reading in a header with blank lines [message #40974 is a reply to message #40973] |
Mon, 20 September 2004 03:51  |
lloyd
Messages: 16 Registered: February 2003
|
Junior Member |
|
|
Yeah I tried this originally, and it didn't work. Tried it again as I
may of made a mistake the first time, and it works with no problems
(obviously I had done something stupid again).
Thanks very much,
Lloyd
|
|
|
Re: Reading in a header with blank lines [message #40976 is a reply to message #40974] |
Sun, 19 September 2004 23:44  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Lloyd Watkin writes:
> I'm trying to read in an ascii file which has a 73 line header. I've
> tried to read it in to an array by doing:
>
> header = fltarr(73)
> open, lun, filename, /GET_LUN
> readf, temp
>
> The problem is that the header contains some blank lines and so I am
> getting a type conversion error on trying to read in the data.
Read the header as a string array, not as a float array.
Later, if you need numbers out of the header, use READS
to read them from your string array.
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
|
|
|