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

Home » Public Forums » archive » Re: Find out which area is covered in a map plot
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: Find out which area is covered in a map plot [message #70087] Fri, 12 March 2010 10:13 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
M. Suklitsch writes:

> Once in a while I run into the problem that I want to know which area
> is actually displayed in a map projection.
>
> For example, I have a Lambert projection displaying Europe and want to
> plot wind barbs (using Coyote's WINDBARB routine) on top of it.
> Problem is, the wind data is on a regular grid, which means that at
> least in the corners (depending on the projection etc.) wind barbs
> outside the map get plotted (see http://martin.suklitsch.at/img/1.1999051700.png
> for an example of what I mean).
>
> Therefore my question: is there a way to get the outermost lat/lon
> values of the projection? If I had this information I could use
> IDLgrROI to obtain the indices within my wind array which are located
> within the map, set all others to NaN and plot the barbs as usual....

This will depend on how you are setting up your
map projection (not with MAP_SET, I hope!!).

You can *probably* find the range in the map structure's
uv_box field. I only ever use my MapCoord object to
set up map projections, and with that you can just
get the data range directly:

mapCoord -> GetProperty, XRANGE=xr, YRANGE=yr

These coordinates will be in XY (or UV) space, which is
where *you* want to be, too, although it is more likely
you are working in lat/lon space. If so, you will have
to convert your lat/lon values to XY values using (for
example) MAP_PROJ_FORWARD before you can perform the
proper clipping.

Windbarb is *very* old. It could probably do with some
work to bring it into the 21st century. :-)

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: Find out which area is covered in a map plot [message #70162 is a reply to message #70087] Mon, 15 March 2010 00:37 Go to previous message
M. Suklitsch is currently offline  M. Suklitsch
Messages: 12
Registered: August 2008
Junior Member
> This will depend on how you are setting up your
> map projection (not with MAP_SET, I hope!!).
>
> You can *probably* find the range in the map structure's
> uv_box field. I only ever use my MapCoord object to
> set up map projections, and with that you can just
> get the data range directly:
>
>    mapCoord -> GetProperty, XRANGE=xr, YRANGE=yr
>
> These coordinates will be in XY (or UV) space, which is
> where *you* want to be, too, although it is more likely
> you are working in lat/lon space. If so, you will have
> to convert your lat/lon values to XY values using (for
> example) MAP_PROJ_FORWARD before you can perform the
> proper clipping.
>
> Windbarb is *very* old. It could probably do with some
> work to bring it into the 21st century. :-)
>
> Cheers,
>
> David
>

Thanks, David. Though I must admit it seems I have missed the spot
where it says "using MAP_SET is bad". ;-)

Anyway, there's obviously *no* easy way to get the information I need,
that's the main message I get from your reply.


Cheers,
Martin
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: How to read data with format codes?
Next Topic: IDL out of range error

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

Current Time: Wed Oct 08 18:41:53 PDT 2025

Total time taken to generate the page: 0.00565 seconds