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

Home » Public Forums » archive » Re: cursor command
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: cursor command [message #83784 is a reply to message #83783] Tue, 02 April 2013 18:07 Go to previous messageGo to previous message
Russell Ryan is currently offline  Russell Ryan
Messages: 122
Registered: May 2012
Senior Member
Ok that helps trying to zero in on the problem. But there's still some confusing things.

What do you mean by "image profile"?

What do you mean by "starting x/y and ending x/y positions"? Starting/ending of what?

How do you expect or want the cursor procedure to help with these things?

To me, it sounds like you might want to plot a contour plot. Then use the cursor to trace out the contour lines and save those x,y values for later use. If so, then I think you're wasting your time with cursor (though this can be done).

Let me know, I have a feeling we're close to answering your problem.

Russell



On Tuesday, April 2, 2013 7:41:48 PM UTC-4, gpet...@ucsc.edu wrote:
> On Tuesday, April 2, 2013 12:04:50 PM UTC-7, rr...@stsci.edu wrote:
>
>> Two things.
>
>>
>
>>
>
>>
>
>> (1) Of course you get an error. Did you read the webpage I sent you? It says that cursor has two *MANDATORY* outputs, and you only gave it one. So, of course it's going to throw an error.
>
>>
>
>>
>
>>
>
>> (2) Again, you didn't really answer the question. What are you trying to do? Because your code seems to say you want to contour the image *INSIDE* the while loop? That doesn't make any sense to me. It seems you probably want to contour the image *OUTSIDE* the while loop, then move the cursor around inside the plot window? If so, then you still need to ask yourself what you want those (x,y) pairs *FOR*? Do you want the return the value of the contour, that seems logical? If so, then you need to first plot the contour. Then start the while loop. You've got the logic correct there. Look at the webpage I sent you, you need to give cursor a variable for the x and y separately, then a variable specifying *WHEN* to return (ie. does cursor return when you press a mouse button? does it return constantly? does it return when you release the mouse button?) Then set the units. You've set device, which I doubt is what you want (but might be). The device coordinates tell you the position *IN PIXELS* in the device, but the plot need not be anywhere in the device (in fact you can set that in contour). I'm guessing you probably want /data, but that's just a hunch. Either way, this call to cursor (once you get it right), goes inside the while loop (presumably). Then I suppose you want to do something with those x y variables? If so, then that goes there.
>
>>
>
>>
>
>>
>
>> Good Luck,
>
>>
>
>> Russell
>
>>
>
>>
>
>>
>
>> On Tuesday, April 2, 2013 2:42:51 PM UTC-4, gpet...@ucsc.edu wrote:
>
>>
>
>>> On Tuesday, April 2, 2013 11:04:48 AM UTC-7, rr...@stsci.edu wrote:
>
>>
>
>>>
>
>>
>
>>>> On Tuesday, April 2, 2013 1:57:36 PM UTC-4, gpet...@ucsc.edu wrote:
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > On Tuesday, April 2, 2013 10:04:49 AM UTC-7, gpet...@ucsc.edu wrote:
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > > Can you use the cursor command on a 2d contour map?
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > Could anyone explain how this procedure works.I am not really finding anything on the internet.
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> Cursor is a way of grabbing an (x,y) coordinate pair from the mouse action. You have options on when (x,y) is returned, for example is it returned when you press the mouse button, when you release the button, or move the mouse, etc. (as set by the wait variable). The (x,y) pair will be returned in whatever units you like (whether normal, device, or data), which is useful depending on your purpose.
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> http://www.exelisvis.com/docs/CURSOR_Procedure.html
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> As for your question about contour. I assume you're using the contour procedure (as opposed to the contour function). In which case, what you do next depends on what you want from the (x,y) pair --- and I can't answer that for you. Do you want the value of the contour plot? or do you want the position of the plot (in the window)? The answer to these questions (and other related ones), will dictate how you set the wait variable and the units you use (though you can change the units using convert_coords afterward, should you need all the units for some reason).
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> Good luck,
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> Russell
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> openr, lun, 'arial.txt',/get_lun
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> data=dindgen(824,914)
>
>>
>
>>>
>
>>
>
>>> readf, lun, data
>
>>
>
>>>
>
>>
>
>>> close,lun
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> rotatedata=ROTATE(data,2)
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> window, 1, retain=2
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> While (!mouse.button Ne 4) DO BEGIN
>
>>
>
>>>
>
>>
>
>>> cursor, data, /device
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> contour, rotatedata
>
>>
>
>>>
>
>>
>
>>> ENDWHILE
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> end
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> The error I receive is: CURSOR: Incorrect number of arguments.
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> I am not sure what to do with this.
>
>
>
> Okay, let me give you a summary of what I am trying to accomplish. I have created a contour plot from a 2 dimensional data set. Now I am trying to take image profiles of this data. So far the only way for me to get a profile is by just looking at my graph and estimating where the starting x and y locations and the ending x and y locations, thus I am trying to be more accurate using cursor.
>
>
>
>
>
> I think my question lies on how to properly separate the x and the y values from the 2d data array. I have done this
>
>
>
> openr, lun, 'arial.txt',/get_lun
>
>
>
> data=dindgen(824,914)
>
> readf, lun, data
>
> close,lun
>
>
>
>
>
>
>
> For i=0, 823 Do Begin
>
> FOR j=0, 913 Do Begin
>
> x=data(i,*)
>
> y=data(*,j)
>
> endfor
>
> endfor
>
>
>
>
>
>
>
> window, 1, retain=2
>
>
>
> contour, rotatedata
>
>
>
>
>
> While (!mouse.button Ne 4) DO BEGIN
>
> cursor, x, y, /data
>
>
>
> ENDWHILE
>
>
>
>
>
>
>
> However, when I try this nothing happens.
>
>
>
>
>
> On the website you gave my I am not sure what this does in the example code they provide? could this be one section I am doing wrong?
>
>
>
> PLOTS,[X,X1], [Y,Y1], /NORMAL
>
>
>
> X = X1 & Y = Y1
>
>
>
>
>
> Thanks, Georgia
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: map_do_segments: map file: plow not found
Next Topic: How to parse the output of restore, filename, /ver

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

Current Time: Wed Oct 08 16:12:35 PDT 2025

Total time taken to generate the page: 0.00269 seconds