This is a quirky problem. (I'm using IDL 6.1 on linux.) I've got a standard, comma-delimited text file with 2 columns I need made into 1D arrays. So this is what I do:
myData = read_ascii(filename, DATA_START=1, $ ; skipping line 1
DELIMITER=',', COUNT=n)
time = myData.field1[0,*] ; time array to hold column 1 of in-file
series = myData.field1[1,*] ; series array to hold column 2 of in-file
(First, an aside: It doesn't matter if I use the DELIMITER option or not; read_ascii still reads only one field, but that's a minor problem.) The above code creates two arrays, both 1 by 542, containing 2 dimensions. For example, the time array accepts calls for time[345] and time[0,345], and it returns the same thing. The problem? Well, when you want to concatenate these goofy arrays with a true 1D array, you get shot down with a dimension error. How do I solve this without ditching the read_ascii function?
Thanks, Chris
|