comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » plotting free form ascii data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
plotting free form ascii data [message #25599] Mon, 02 July 2001 14:11 Go to next message
patrick is currently offline  patrick
Messages: 15
Registered: July 2001
Junior Member
Greetings-

I'm attempting to write a gui script to plot free form ascii data.
I've utilized the ascii_template and read_ascii functions but the
program hangs after hitting finished on the ascii_template gui and
returns an error:

% READ_ASCII: File name must be a string.
% Execution halted at: READ_ASCII 792
/auto/soft/idl/idl_5.4/lib/read_ascii.pro
% PLOTINTERACTIVE_READ 31
/home/swifs/training/idlinterm/interplot2.pro
% XMANAGER_EVLOOP_STANDARD 478
/auto/soft/idl/idl_5.4/lib/xmanager.pro
% XMANAGER 708
/auto/soft/idl/idl_5.4/lib/xmanager.pro
% PLOTINTERACTIVE 209
/home/swifs/training/idlinterm/interplot2.pro
% $MAIN$

I'm using a variable name xdata, very simple and yes, a string. What
gives?

Also, I'm curious as to the best way to pass this to the PLOT
function?

Any suggestions welcome,

Patrick
Re: plotting free form ascii data [message #25640 is a reply to message #25599] Thu, 05 July 2001 20:16 Go to previous messageGo to next message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Patrick writes:

> I have your book and two others from the courses I've taken at RSI. I'll review
> them again for plotting examples.

Humm. Maybe we ought to review that book and course material. You
would think a plot would have been covered somewhere. :-(

Cheers,

David

--
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
Re: plotting free form ascii data [message #25643 is a reply to message #25599] Thu, 05 July 2001 16:24 Go to previous messageGo to next message
Raphael Kudela is currently offline  Raphael Kudela
Messages: 2
Registered: July 2001
Junior Member
I have your book and two others from the courses I've taken at RSI. I'll review
them again for plotting examples.

Patrick
Re: plotting free form ascii data [message #25646 is a reply to message #25599] Thu, 05 July 2001 11:57 Go to previous messageGo to next message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
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".

Cheers,

David

--
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
Re: plotting free form ascii data [message #25647 is a reply to message #25599] Thu, 05 July 2001 11:22 Go to previous messageGo to next message
Raphael Kudela is currently offline  Raphael Kudela
Messages: 2
Registered: July 2001
Junior Member
Dr. Fanning-

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?

Cheers,

Patrick

David Fanning wrote:

> Patrick writes:
>
>> sorry for the brevity on the last post. What I have currently is:
>> pro plotinteractive_doplot, pstate
>> plot, (*pstate).profile_data, LINESTYLE = (*pstate).linestyle
>> end
>>
>> pro plotinteractive_read, event
>> widget_control, event.top, GET_UVALUE = pstate
>> ; read in the data for the 1-D plot from a free-form ascii
>> ; matrix.
>>
>> profile_data = read_ascii(test,
>> template=ascii_template(test,BROWSE_LINES=4241), $
>> DATA_START=13)
>>
>> ; call the wavelet toolkit:
>> plotinteractive_wvtoolkit, pstate
>>
>> end
>>
>> ;pro plotinteractive_draw, event
>>
>> ;widget_control, event.top, GET_UVALUE = pstate
>> ; check for motion events.
>> ;if (event.type eq 2) then begin
>> ; convert the coordinates from device to data
>> ; datac = convert_coord(event.x, event.y, /DEVICE, /TO_DATA)
>> ; statusstr = strtrim(datac[0], 2) + ',' + strtrim(datac[1],2)
>> ; widget_control, (*pstate).status, SET_VALUE = statusstr
>> ;endif
>>
>> ;end
>>
>>
>> pro plotinteractive_quit, event
>> widget_control, event.top, GET_UVALUE = pstate
>> ; kill the widget.
>> ptr_free, pstate
>> widget_control, event.top, /DESTROY
>>
>> end
>>
>> pro plotinteractive_wvtoolkit, event
>> ;widget_control, event.top, GET_UVALUE = pState
>> WV_APPLET, ARRAY=profile_data, GROUP_LEADER=winID
>>
>> ; call the do routine to replot.
>> plotinteractive_doplot, pstate
>>
>> end
>>
>> --the program proceeds until it gets to pro plotinteractive_wvtoolkit
>> then stops. Giving the error:
>> % XMANAGER: Caught unexpected error from client application. Message
>> follows...
>> % Attempt to call undefined procedure/function: 'WV_APPLET'.
>> % Execution halted at: PLOTINTERACTIVE_WVTOOLKIT 42
>> /home/swifs/training/idlinterm/interplot4.pro
>> % PLOTINTERACTIVE_READ 14
>> /home/swifs/training/idlinterm/interplot4.pro
>> % XMANAGER_EVLOOP_STANDARD 478
>> /auto/soft/idl/idl_5.4/lib/xmanager.pro
>> % XMANAGER 708
>> /auto/soft/idl/idl_5.4/lib/xmanager.pro
>> % PLOTINTERACTIVE 101
>> /home/swifs/training/idlinterm/interplot4.pro
>> % $MAIN$
>>
>> What is the correct way to call wv_applet?
>
> I don't know how WV_APPLET should be called.
> I've never heard of it. Is this an IDL program in
> your path?
>
> But I thought the original problem was that
> READ_ASCII didn't like the filename. I can well
> believe this, since in the example:
>
>> profile_data = read_ascii(test, $
>> template=ascii_template(test,BROWSE_LINES=4241), $
>> DATA_START=13)
>
> the variable "test" is nowhere defined in this
> procedure. This should be the name of a data file,
> for example:
>
> test = 'mydata.dat'
>
> I'd be saving up for a good book on widget
> programming, too. I'm not sure the example
> you are following is going to get you too far. :-)
>
> Cheers,
>
> David
> --
> 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
sec : U Re: plotting free form ascii data [message #25663 is a reply to message #25599] Wed, 04 July 2001 21:34 Go to previous messageGo to next message
Andrew Cool is currently offline  Andrew Cool
Messages: 219
Registered: January 1996
Senior Member
David Fanning wrote:
>
> Patrick writes:
>
snip
>>
>> --the program proceeds until it gets to pro plotinteractive_wvtoolkit
>> then stops. Giving the error:
>> % XMANAGER: Caught unexpected error from client application. Message
>> follows...
>> % Attempt to call undefined procedure/function: 'WV_APPLET'.
>> % Execution halted at: PLOTINTERACTIVE_WVTOOLKIT 42
>> /home/swifs/training/idlinterm/interplot4.pro
>> % PLOTINTERACTIVE_READ 14
>> /home/swifs/training/idlinterm/interplot4.pro
>> % XMANAGER_EVLOOP_STANDARD 478
>> /auto/soft/idl/idl_5.4/lib/xmanager.pro
>> % XMANAGER 708
>> /auto/soft/idl/idl_5.4/lib/xmanager.pro
>> % PLOTINTERACTIVE 101
>> /home/swifs/training/idlinterm/interplot4.pro
>> % $MAIN$
>>
>> What is the correct way to call wv_applet?
>
> I don't know how WV_APPLET should be called.
> I've never heard of it. Is this an IDL program in
> your path?
>
> Cheers,
>
> David

David & Patrick,

I think the WV_APPLET must be part of the WAVELETS TOOLKIT GUI,
for which you need a licence to run it.

However, Wayne Landsman pointed out back in April that some of the
WAVELET TOOLKIT routines are callable outside of the GUI...

> Um, I'm not sure whether I should be advertising this, but at least some
> of the low-level procedures in $IDL_DIR/lib/wavelet/source do not
> require a toolkit license. You just won't be able to use any of the GUI
> features.
>
> WV_CWT - Compute the continuous wavelet transform for one-dimensional
> arrays.
> WV_DENOISE - Use the wavelet transform to filter a 1 or 2-dimensional
> array.
> WV_FN_COIFLET - Return the Coiflet wavelet coefficients.
> WV_FN_DAUBECHIES - Return the Daubechies wavelet coefficients.
> WV_FN_GAUSSIAN - Return the Gaussian-derivative wavelet.
> WV_FN_HAAR - Return the Haar wavelet coefficients.
> WV_FN_MORLET - Return the Morlet wavelet.
> WV_FN_PAUL - Return the Paul wavelet.
> WV_FN_SYMLET - Return the Symlet wavelet coefficients.
>
> Also the "Numerical Recipes" implementation of some Daubechies wavelet
> coefficients has long been available as the intrinsic function WTN.
>
> --Wayne Landsman landsman@mpb.gsfc.nasa.gov


Andrew Cool

------------------------------------------------------------ ---------
Andrew D. Cool .->-.
Electromagnetics & Propagation Group `-<-'
Surveillance Systems Division Transmitted on
Defence Science & Technology Organisation 100% recycled
PO Box 1500, Salisbury electrons
South Australia 5108

Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
Email : andrew.cool@dsto.defence.gov.au
------------------------------------------------------------ ---------
Re: sec : U Re: plotting free form ascii data [message #26061 is a reply to message #25663] Tue, 31 July 2001 03:15 Go to previous message
Marcus O'Brien is currently offline  Marcus O'Brien
Messages: 16
Registered: October 2000
Junior Member
andrew cool wrote:

> David Fanning wrote:
>>
>> Patrick writes:
>>
> snip
>>>
>>> --the program proceeds until it gets to pro plotinteractive_wvtoolkit
>>> then stops. Giving the error:
>>> % XMANAGER: Caught unexpected error from client application. Message
>>> follows...
>>> % Attempt to call undefined procedure/function: 'WV_APPLET'.
>>> % Execution halted at: PLOTINTERACTIVE_WVTOOLKIT 42
>>> /home/swifs/training/idlinterm/interplot4.pro
>>> % PLOTINTERACTIVE_READ 14
>>> /home/swifs/training/idlinterm/interplot4.pro
>>> % XMANAGER_EVLOOP_STANDARD 478
>>> /auto/soft/idl/idl_5.4/lib/xmanager.pro
>>> % XMANAGER 708
>>> /auto/soft/idl/idl_5.4/lib/xmanager.pro
>>> % PLOTINTERACTIVE 101
>>> /home/swifs/training/idlinterm/interplot4.pro
>>> % $MAIN$
>>>
>>> What is the correct way to call wv_applet?
>>
>> I don't know how WV_APPLET should be called.
>> I've never heard of it. Is this an IDL program in
>> your path?
>>
>> Cheers,
>>
>> David
>
> David & Patrick,
>
> I think the WV_APPLET must be part of the WAVELETS TOOLKIT GUI,
> for which you need a licence to run it.
>
> However, Wayne Landsman pointed out back in April that some of the
> WAVELET TOOLKIT routines are callable outside of the GUI...
>
>> Um, I'm not sure whether I should be advertising this, but at least some
>> of the low-level procedures in $IDL_DIR/lib/wavelet/source do not
>> require a toolkit license. You just won't be able to use any of the GUI
>> features.
>>
>> WV_CWT - Compute the continuous wavelet transform for one-dimensional
>> arrays.
>> WV_DENOISE - Use the wavelet transform to filter a 1 or 2-dimensional
>> array.
>> WV_FN_COIFLET - Return the Coiflet wavelet coefficients.
>> WV_FN_DAUBECHIES - Return the Daubechies wavelet coefficients.
>> WV_FN_GAUSSIAN - Return the Gaussian-derivative wavelet.
>> WV_FN_HAAR - Return the Haar wavelet coefficients.
>> WV_FN_MORLET - Return the Morlet wavelet.
>> WV_FN_PAUL - Return the Paul wavelet.
>> WV_FN_SYMLET - Return the Symlet wavelet coefficients.
>>
>> Also the "Numerical Recipes" implementation of some Daubechies wavelet
>> coefficients has long been available as the intrinsic function WTN.
>>
>> --Wayne Landsman landsman@mpb.gsfc.nasa.gov
>
> Andrew Cool
>
> ------------------------------------------------------------ ---------
> Andrew D. Cool .->-.
> Electromagnetics & Propagation Group `-<-'
> Surveillance Systems Division Transmitted on
> Defence Science & Technology Organisation 100% recycled
> PO Box 1500, Salisbury electrons
> South Australia 5108
>
> Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
> Email : andrew.cool@dsto.defence.gov.au
> ------------------------------------------------------------ ---------

Just had a go with WV_DENOISE in idl5.4, gives a license error, RSI must have
fixed it :(

Marc
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Using C++ DLM's With IDL?
Next Topic: Question about tutorial in 1D Gaussian Filter

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:53:43 PDT 2025

Total time taken to generate the page: 0.00686 seconds