Re: Find out which area is covered in a map plot [message #70087] |
Fri, 12 March 2010 10:13  |
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.")
|
|
|