Re: IDL string input HELP!! [message #40185 is a reply to message #40056] |
Wed, 14 July 2004 09:59  |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
RichW wrote:
> I have a IDL program that reads in ASCII data and is to plot 2 columns of
> the 8 that are in the file. Right now, I am using makeplot & read_ascii in
> my code, which is fine except when it wants to read in the times - which
> are given in the form HH:MM:SS.MS. When IDL outputs the ASCII data in a
> terminal window, the time will come up as HH.0000, which is not good. It
> was recommend to me to read in the date as a string, but I didn't work. I
> am sure I messed it up. Any help or suggestions would be appreciated. Here
> is the code that I have so far:
>
> PRO makeplot, ac_ho_mfi_86586_revised
> a = read_ascii(ac_ho_mfi_86586_revised)
> print, a.field1
> x = a.field1(1, *)
> y = a.field1(3, *)
> plot, x, y, psym = 4
>
> end
>
Hi,
I suggest that you look at the ASCII_TEMPLATE function to define your data file.
Assign 'string' to the timestamp column. Once you read in the data using the
template, your will have to transform HH:MM:SS to a numerical value - search
with GOOGLE on this newsgroup for time transformations.
Ben
|
|
|