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

Home » Public Forums » archive » Re: ROI on map
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: ROI on map [message #50192] Tue, 19 September 2006 04:56
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Axel writes:

> Thanks, my widget programming is a bit rusty, so I was looking at the
> DEFROI function and was looking for something equivalent for a
> non-image "direct" graphic.

Well, widgets usually use "direct" graphics. At least mine
do.

I suppose you could do something like this in a regular
IDL window, but the code will be so convoluted and ugly
that it hardly seems worth it to me. Your widget programming
skills don't have to be very spectacular to make something
like this work, though. Something very, very basic is
probably enough. :-)

> I think I can work from your example though, thanks! When you say
> restore coordinate space you mean that I reset the system variables
> !X,!Y and !MAp to the saved values by
> simply setting:
> IDL> saved_map= !MAP
> IDL> e.g. plot,x,y
> IDL> !MAP=saved_map

That's what I mean. (Although, usually in the reversed
order of this.)

Plot, x, y
bangX = !X
bangY = !Y

Then, later in your program when you need to know this
data coordinate space is set up properly:

!X = bangx
!y = bangy

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: ROI on map [message #50194 is a reply to message #50192] Mon, 18 September 2006 22:29 Go to previous message
catwithhat is currently offline  catwithhat
Messages: 10
Registered: April 2006
Junior Member
David,

Thanks, my widget programming is a bit rusty, so I was looking at the
DEFROI function and was looking for something equivalent for a
non-image "direct" graphic.
I think I can work from your example though, thanks! When you say
restore coordinate space you mean that I reset the system variables
!X,!Y and !MAp to the saved values by
simply setting:
IDL> saved_map= !MAP
IDL> e.g. plot,x,y
IDL> !MAP=saved_map
?
Axel

David Fanning wrote:
> catwithhat writes:
>
>> Does anyone have a routine that allows you to define a region of
>> interest. ROI on a map projection? (direct graphics). For example,I
>> would define a map project, overlay a contour plot and then want to
>> interactively select region. The routine would return the vertices of
>> the perimeter of the polygon.
>
> And the problem is....what!?
>
> This is no different from drawing any other line on
> a draw widget. Convert your positions (returned in
> DEVICE coordinates) to your map coordinates with
> CONVERT_COORD. Just be sure you save your data
> coordinate space (!X, !Y, and !MAP) after you
> draw your map so you can restore it before you
> do the coordinate conversion.
>
> This article might help:
>
> http://www.dfanning.com/widget_tips/line_on_image.html
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: ROI on map [message #50204 is a reply to message #50194] Mon, 18 September 2006 10:55 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
catwithhat writes:

> Does anyone have a routine that allows you to define a region of
> interest. ROI on a map projection? (direct graphics). For example,I
> would define a map project, overlay a contour plot and then want to
> interactively select region. The routine would return the vertices of
> the perimeter of the polygon.

And the problem is....what!?

This is no different from drawing any other line on
a draw widget. Convert your positions (returned in
DEVICE coordinates) to your map coordinates with
CONVERT_COORD. Just be sure you save your data
coordinate space (!X, !Y, and !MAP) after you
draw your map so you can restore it before you
do the coordinate conversion.

This article might help:

http://www.dfanning.com/widget_tips/line_on_image.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: can i read multiple files?
Next Topic: Re: Can I do this with call_procedure/call_function, or do I have to use execute?

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

Current Time: Thu Oct 16 20:47:42 PDT 2025

Total time taken to generate the page: 1.15041 seconds