Re: Map_Image and interpolation [message #18231 is a reply to message #18215] |
Wed, 08 December 1999 00:00   |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Ben Tupper (Ben_member@newsguy.com) writes:
> Uhoh. You have said the very same thing to me before. Generally, as you have
> learned recently, I often don't know my point either.
Oh, good, then we can have another one of those moot discussions. :-)
> I can indeed plot the ship locations on the warped grid correctly. No problem
> with MAP_SET, MAP_IMAGE, PLOTS, etc. What I want to do is make a profile plot
> of depth between consecutive ship locations. In order to do so, I MUST do
> interpolation between two locations on the warped grid.
Now here is where I fail to follow your argument. Because
my first reaction is this: why in the WORLD would you want
to do the interpolation between two locations on the
warped grid!? That would be the *last* place I think
I would want to do an interpolation. For one thing,
the warped grid is not really the data. It's a
representation of the data, in the same way that
a TVed image is a representation of the image and
not the image itself. A profile of scaled image
data, for example, would be essentially meaningless;
you want a profile of the *real* image data.
I would do an interpolation along the line (or
arc, probably) of the bathymetric grid, and then
project that line (or arc, which would turn into
a line in the projection) onto the map projection.
How do you know which pixels to light up? The ones
Map_Set *tells* you to light up.
> Now a certain person
> with an excellent IDL Tips Web site (think Canis latrans) has a page that
> suggest something like the following for interpolating values off an image
> (grid, ...)between points (x1,y1) and (x2,y2)
>
>
> nPoints = Round(ABS(x2-x1+1) > ABS(y2-y1+1.))
> xloc = X1 + (X2-X1) * Findgen(nPoints) / (nPoints - 1)
> yloc = Y1 + (Y2-Y1) * Findgen(nPoints) / (nPoints - 1)
> Z = Interpolate(WarpedGrid, xloc, yloc)
>
> (or maybe I could do Z = WarpedGrid[xloc,yloc])
>
> So, the question is... if I have a coordinate like (-68.503, 44.056), how do I
> convert that into the appropriate subscript locations on the warped grid?
The simple answer is: by running it through the map projection.
You may not readily know is specific XY location, but you can
certainly light it up.
> You might be wondering why the points must be interpolated from the warped image
> and not the original...
Indeed, I'm wondering ...
> Well, the warped image has been flattened onto a 2d
> surface while the original is for a sphere(its grid spacing is 0.0416667 arc
> seconds.)
Well, I'm ready to concede the simple algorithm you
found on my web page may not be what you want for an arc,
but I think you might find an equivalent arc-interpolation
scheme on Ray Sterner's web page. (That's where I found
this algorithm.) Or, it would be easy enough, I think,
to come up with one of your own. (Let's let the lurkers
come up with something. :-)
The point is, the curved line in real space will turn into
a straight line on the map projection in just the same way
that the curved image turned into a flat image.
I always enjoy these conversations, Ben. I don't always
understand them. But I do enjoy them. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|