[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plotting free form ascii data

Raphael Kudela (aka Patrick) writes:

> You are correct, my original problem was that the READ_ASCII function
> didn't like my file name. After I fixed that issue I tried passing the
> ascii data to the wv_applet function which controls the wavelet tookit.
> Since the previous post Ronn Kling noted that it is an add on package that
> I don't believe my department has the license for. No big deal really, what
> I am basically interested in is how to plot the data after it's been read
> by READ_ASCII? I don't believe I need the toolkit for this but I'm not
> experienced enough to be certain. The online help indicates the READ_ASCII
> places the data in a structure variable, which I assume does not need to be
> defined independently?

Well, I don't know how you defined your data file fields, 
but suppose you had two columns of data and you named 
the fields "pressure", and "temperature". Then the structure
that is returned from READ_ASCII has fields with these
two names:

   IDL> Help, data, /Structure
   ** Structure <14248a0>, 2 tags, length=800, data length=800, refs=1:
      TEMPERATURE     FLOAT     Array[100]
      PRESSURE        FLOAT     Array[100]

You could plot the data like this:

   IDL> Plot, data.temperature, data.pressure

Unfortunately, you won't know what name the data
fields were given, since you are allowing the user
to change them every time the data is read (a really
bad idea, IMHO). So you will have to resort to assuming
structure positions, like this:

   IDL> Plot, data.(0), data.(1)

If it were me, I wouldn't be reading the data with
READ_ASCII. Or, at the very least, I wouldn't be
allowing the user to change the template every time.

But I think you really need a good IDL programming
book. As of this week, there are at least two good
ones. I'd search Amazon under "IDL Programming". Be
sure NOT to order any that have to do with the "Interface
Definition Language". You are looking for "Interactive
Data Language".



David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155