Re: Extract Data from Point on Plot [message #64882] |
Thu, 29 January 2009 14:42  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
mrjejones@gmail.com writes:
> Just for more clarification, I am reading this information from a
> netCDF file into IDL and doing a "plots" to draw it over a map_set. I
> just want to give the coordinate in the PS (x,y coords) and get the
> lat, long, and albedo for that pixel.
This is pretty much what I do for a living these days,
although I have pretty much completely given up on
MAP_SET for much of anything. The secret is being
able to set up a coordinate system for a rectangular
area of the graphics display. This could be an image,
a line plot, a contour plot, etc. For a map coordinate
system, I use the MAPCOORD object in the Catalyst
Library. Normally, I use this in conjunction with
a ScaleImage object, which has a method (via the
CatImage object) to convert a location in the local (map)
coordinate system into a location in a pixel coordinate
system, so it can obtain the value of that pixel.
I don't expect you to dive into the Catalyst Library,
but you can see the guts of this system at work in
TVINFO, which works with TVIMAGE to allow you to click
on any displayed image and get the value of the image
at that location. (More or less, of course, since this
works no matter what resolution you are displaying your
image in.)
I should be charging you thousands of dollars for this
information, but I'll give it away to you for free, since
Matt Savoie spilled the beans to me and didn't charge me.
The real secret is using SCALE_VECTOR together with
VALUE_LOCATE to locate the correct pixel value. It is so
slick it is embarrassing to think it only took Matt and me
a combined 35 years to think of it. :-(
Here are some articles to read. They all use this idea:
http://www.dfanning.com/catalyst/imgwin.html
http://www.dfanning.com/catalyst/maponimage.html
http://www.dfanning.com/graphics_tips/tvinfo.html
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|