X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 23 Feb 2007 02:33 PM by  anon
bad case of "not calling a spade a spade"
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
23 Feb 2007 02:33 PM
    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

    Deleted User



    New Member


    Posts:
    New Member


    --
    05 Mar 2007 11:48 AM
    I rotated time and series by 270 degrees with rotate(time,3) and the problem is solved. It even got rid of that phantom dimension.
    You are not authorized to post a reply.