Loading ASCII data into an array [message #45803] |
Sat, 15 October 2005 07:45 |
noekains@gmail.com
Messages: 3 Registered: October 2005
|
Junior Member |
|
|
Hi,
I'm a new IDL-convert and I am still struggling a bit with some of the
features.
I would like to load a large - 26 columns, 41063 rows - ASCII file into
a 26 columns 41063 rows array in order to be able to access individual
elements afterwards. I've been trying to use the read_ascii procedure
to do this, using
data=read_ascii('aqu1.asc', data_start=13)
but this then defines an anonymous structure with 26 fields. When I'm
trying to access an element of the data array other than [0,0], I get
the message "Attempt to subscript DATA with <INT ( 8)> is
out of range."
I've also tried creating a template with the ascii_template command,
but I get the same problem. Another thing I tried was to create a [26,
41063] floating points array, then using
OpenR, lun, 'aqu1.asc', /Get_Lun
ReadF, lun, data
Free_Lun, lun
but I then get the message
READF: Input conversion error. Unit: 100, File: C:\RSI\IDL61\aqu1.asc
Is there anyway to simply load the ASCII data into an array, in the
same way as you get simple arrays when you load image data with
procedures such as read_jpeg or read_dicom ?
Apologies for the long message!
Many thanks for the help,
Noah
|
|
|