Re: cursor,xi,yi,/normal [message #61081] |
Thu, 03 July 2008 06:50 |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Jul 3, 3:26 pm, Spon <christoph.b...@gmail.com> wrote:
> On Jul 3, 2:16 pm, d.po...@gmail.com wrote:
>
>
>
>> Chris
>> thanks your cod works well.but which one is the output coordinate?
>> i put
>> print,array
>> but there is some error
>> any help?
>> D
>
> Save the entire chunk of code as 'grapharray.pro', compile it and call
> it as an IDL function:
> Output = Grapharray(Xvalues, Yvalues)
>
> When the program returns (after you right-click in the window), your
> array will be stored in the Output variable.
>
> Also, this line:
> Diffs = XDiffs + YDiffs
>
> Should probably read:
> Diffs = SQRT(XDiffs^2 + YDiffs^2)
>
> Good luck,
> Chris
thanks Chris. it works very well
D
|
|
|
Re: cursor,xi,yi,/normal [message #61083 is a reply to message #61081] |
Thu, 03 July 2008 06:26  |
Spon
Messages: 178 Registered: September 2007
|
Senior Member |
|
|
On Jul 3, 2:16 pm, d.po...@gmail.com wrote:
>
> Chris
> thanks your cod works well.but which one is the output coordinate?
> i put
> print,array
> but there is some error
> any help?
> D
Save the entire chunk of code as 'grapharray.pro', compile it and call
it as an IDL function:
Output = Grapharray(Xvalues, Yvalues)
When the program returns (after you right-click in the window), your
array will be stored in the Output variable.
Also, this line:
Diffs = XDiffs + YDiffs
Should probably read:
Diffs = SQRT(XDiffs^2 + YDiffs^2)
Good luck,
Chris
|
|
|
Re: cursor,xi,yi,/normal [message #61085 is a reply to message #61083] |
Thu, 03 July 2008 06:16  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Jul 3, 2:20 pm, Spon <christoph.b...@gmail.com> wrote:
> On Jul 3, 1:13 pm, David Fanning <n...@dfanning.com> wrote:
>
>
>
>> It's "catalyst", rather than "analyst", but that's
>> the basic idea. :-)
>
> So if a catalyst makes things happen faster, does that mean an analyst
> is *meant* to make things happen slower??
>
> That explains a few things ;-)
>
> Chris
Chris
thanks your cod works well.but which one is the output coordinate?
i put
print,array
but there is some error
any help?
D
|
|
|
Re: cursor,xi,yi,/normal [message #61088 is a reply to message #61085] |
Thu, 03 July 2008 05:20  |
Spon
Messages: 178 Registered: September 2007
|
Senior Member |
|
|
On Jul 3, 1:13 pm, David Fanning <n...@dfanning.com> wrote:
>
> It's "catalyst", rather than "analyst", but that's
> the basic idea. :-)
So if a catalyst makes things happen faster, does that mean an analyst
is *meant* to make things happen slower??
That explains a few things ;-)
Chris
|
|
|
Re: cursor,xi,yi,/normal [message #61089 is a reply to message #61088] |
Thu, 03 July 2008 05:13  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Spon writes:
> I guess I also restored the analyst.sav file, but I'm not sure if
> that's necessary if you have everything set up right:
> CD, [Coyote Library Folder]
> RESTORE, 'analyst.sav'
It's "catalyst", rather than "analyst", but that's
the basic idea. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: cursor,xi,yi,/normal [message #61090 is a reply to message #61089] |
Thu, 03 July 2008 05:03  |
Spon
Messages: 178 Registered: September 2007
|
Senior Member |
|
|
On Jul 3, 12:23 pm, d.po...@gmail.com wrote:
> On Jul 3, 1:04 pm, Spon <christoph.b...@gmail.com> wrote:
>
>> On Jul 3, 11:40 am, David Fanning <n...@dfanning.com> wrote:
>
>>> Spon writes:
>>>> I was about to point Dave to David Fanning's ANNOTATEWINDOW, but I
>>>> can't get it to work, even after updating my Coyote library.
>
>>>> I get the following error:
>>>> % Attempt to call undefined procedure/function: 'COLORTOOL__DEFINE'.
>>>> % Error occurred at: ANNOTATEWINDOW 186
>
>>>> Searching David's site and the IDL helpfiles, I can't seem to find
>>>> mention of the ColorTool object class anywhere. What am I missing?
>
>>> Are you sure you are using the latest catalyst.sav version?
>>> I did, long ago, have a version out there there was missing
>>> this Catalyst Library object. But the latest appears to have
>>> it.
>
>>> I should probably update this, as I have made lots of changes
>>> lately, but I'm enjoying the beach this week. :-)
>
>>> Cheers,
>
>>> David
>>> --
>>> David Fanning, Ph.D.
>>> Fanning Software Consulting, Inc.
>>> Coyote's Guide to IDL Programming (www.dfanning.com)
>>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
>> Thanks, that's got it. Enjoy your holiday David!
>> C
>
> Chris
> i have got that error also. how we can fix it?
> Dave
I just fixed it by downloading the latest version of David's entire
library from
http://www.dfanning.com/programs/coyoteprograms.zip
Into a folder on my !Path
I guess I also restored the analyst.sav file, but I'm not sure if
that's necessary if you have everything set up right:
CD, [Coyote Library Folder]
RESTORE, 'analyst.sav'
Regards,
Chris
PS Here's a simple version of what I use to do what I think you want.
It's not efficient, with all those Wait calls and unnecessary
concatenations, but it works:
Function GraphArray, X, Y
Window, /Free, Title = $
'Left click to store values, right click when done.'
WIndex = !Window
Loop:
Plot, X, Y
Cursor, xp, yp, /Data, /Down
; Right button or kill/change window to quit:
If !Mouse.Button Eq 4 Or !Window NE WIndex Then Begin
Print, 'Returning.'
If !Window Eq WIndex Then WDelete
If N_elements(Array) Eq 0 Then Return, 0
Return, Transpose(Array)
Endif
; Draw X where user clicked
OPlot, [0,xp], [0,yp], PSym=2
; Work out nearest point on graph line
XDiffs = Abs(X - xp)
YDiffs = Abs(Y - yp)
Diffs = XDiffs + YDiffs
Void = Min(Diffs, Index)
NX = X[Index]
NY = Y[Index]
NearPt = [ NX, NY ]
; Draw a diamond on actual datapoint stored to array.
OPlot, [0,NX], [0,NY], PSym=4
Wait, 1.5
; Store values
If N_Elements(Array) Eq 0 Then $
Array = Transpose(NearPt) Else $
Array = [Array, Transpose(NearPt)]
Goto, Loop
End
|
|
|
Re: cursor,xi,yi,/normal [message #61091 is a reply to message #61090] |
Thu, 03 July 2008 04:23  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Jul 3, 1:04 pm, Spon <christoph.b...@gmail.com> wrote:
> On Jul 3, 11:40 am, David Fanning <n...@dfanning.com> wrote:
>
>
>
>> Spon writes:
>>> I was about to point Dave to David Fanning's ANNOTATEWINDOW, but I
>>> can't get it to work, even after updating my Coyote library.
>
>>> I get the following error:
>>> % Attempt to call undefined procedure/function: 'COLORTOOL__DEFINE'.
>>> % Error occurred at: ANNOTATEWINDOW 186
>
>>> Searching David's site and the IDL helpfiles, I can't seem to find
>>> mention of the ColorTool object class anywhere. What am I missing?
>
>> Are you sure you are using the latest catalyst.sav version?
>> I did, long ago, have a version out there there was missing
>> this Catalyst Library object. But the latest appears to have
>> it.
>
>> I should probably update this, as I have made lots of changes
>> lately, but I'm enjoying the beach this week. :-)
>
>> Cheers,
>
>> David
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming (www.dfanning.com)
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> Thanks, that's got it. Enjoy your holiday David!
> C
Chris
i have got that error also. how we can fix it?
Dave
|
|
|
Re: cursor,xi,yi,/normal [message #61092 is a reply to message #61091] |
Thu, 03 July 2008 04:04  |
Spon
Messages: 178 Registered: September 2007
|
Senior Member |
|
|
On Jul 3, 11:40 am, David Fanning <n...@dfanning.com> wrote:
> Spon writes:
>> I was about to point Dave to David Fanning's ANNOTATEWINDOW, but I
>> can't get it to work, even after updating my Coyote library.
>
>> I get the following error:
>> % Attempt to call undefined procedure/function: 'COLORTOOL__DEFINE'.
>> % Error occurred at: ANNOTATEWINDOW 186
>
>> Searching David's site and the IDL helpfiles, I can't seem to find
>> mention of the ColorTool object class anywhere. What am I missing?
>
> Are you sure you are using the latest catalyst.sav version?
> I did, long ago, have a version out there there was missing
> this Catalyst Library object. But the latest appears to have
> it.
>
> I should probably update this, as I have made lots of changes
> lately, but I'm enjoying the beach this week. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Thanks, that's got it. Enjoy your holiday David!
C
|
|
|
Re: cursor,xi,yi,/normal [message #61094 is a reply to message #61092] |
Thu, 03 July 2008 03:40  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Spon writes:
> I was about to point Dave to David Fanning's ANNOTATEWINDOW, but I
> can't get it to work, even after updating my Coyote library.
>
> I get the following error:
> % Attempt to call undefined procedure/function: 'COLORTOOL__DEFINE'.
> % Error occurred at: ANNOTATEWINDOW 186
>
> Searching David's site and the IDL helpfiles, I can't seem to find
> mention of the ColorTool object class anywhere. What am I missing?
Are you sure you are using the latest catalyst.sav version?
I did, long ago, have a version out there there was missing
this Catalyst Library object. But the latest appears to have
it.
I should probably update this, as I have made lots of changes
lately, but I'm enjoying the beach this week. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: cursor,xi,yi,/normal [message #61096 is a reply to message #61094] |
Thu, 03 July 2008 03:28  |
Spon
Messages: 178 Registered: September 2007
|
Senior Member |
|
|
On Jul 3, 10:11 am, d.po...@gmail.com wrote:
> Folks
> I want to get couple of (x,y)’s from a single plot. I know we can do
> it by:
> cursor,xi,yi,/normal
> but what I want to do is selecting some(x,y) and putting them in an
> array (2 dimensional arry):
> plot,x,f(x)->get (x,y)-> put them in an array -> when I close the
> window then finish this.
> Any help?
> Dave
I was about to point Dave to David Fanning's ANNOTATEWINDOW, but I
can't get it to work, even after updating my Coyote library.
I get the following error:
% Attempt to call undefined procedure/function: 'COLORTOOL__DEFINE'.
% Error occurred at: ANNOTATEWINDOW 186
Searching David's site and the IDL helpfiles, I can't seem to find
mention of the ColorTool object class anywhere. What am I missing?
Chris
|
|
|