[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Congrid but with shift of origin
Joe Means <joe.means@orst.edu> writes:
> Hello group,
> I need idl code to resample an array that is a digital terrain model
> and often need the origin to be shifted by fractions of a cell in x and
> y directions. Congrid cannot handle the latter, as I read the
> documentation. I'll bet someone has a program that does this. Can some
> one point me to such help.
You probably want the INTERPOLATE function. After all, that's what
CONGRID uses. INTERPOLATE may sound complicated from the
documentation, but it's not really.
All you have to do is rescale your resampled x and y coordinates to be
pixel values, which can be fractional. INTERPOLATE considers the
image measurement to occur at the *left* edge of the pixel, but this
only important if you use the MISSING keyword.
The only other important thing is for you to remember to use the GRID
keyword which will make INTERPOLATE construct a grid of interpolates
rather than a 1-d slice.
Good luck,
Craig
--
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------