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

Home » Public Forums » archive » Re: 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
Re: plotting free form ascii data [message #25578] Tue, 03 July 2001 15:58 Go to next message
patrick is currently offline  patrick
Messages: 15
Registered: July 2001
Junior Member
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?

Regards,

Patrick
Re: plotting free form ascii data [message #25598 is a reply to message #25578] Mon, 02 July 2001 14:36 Go to previous messageGo to next message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
patrick@es.ucsc.edu writes:
>
> 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?

Oh, dear. "xdata" is a curious name for a data file.
Can you show us the commands you are using, please. :-)

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 #25673 is a reply to message #25578] Tue, 03 July 2001 20:25 Go to previous message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
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
Re: plotting free form ascii data [message #25674 is a reply to message #25578] Tue, 03 July 2001 19:06 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
patrick@es.ucsc.edu (Patrick McEnaney) writes:
>
> What is the correct way to call wv_applet?

Umm, with it in your path?

Seriously, have you checked that your path is correct? Can you
.compile WV_APPLET? Can you call it from the command line? If yes to
all these questions then there is something more fundamentally wrong,
but my guess is that you need to be sure the little "+" is on the
front of the IDL library directory.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Plot into an array
Next Topic: Re: IDLWAVE 4.9: "Cannot open load file: idlw-shell"

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

Current Time: Wed Oct 08 13:18:40 PDT 2025

Total time taken to generate the page: 0.00486 seconds