| Re: interpolation for resizing [message #64166 is a reply to message #64163] |
Tue, 02 December 2008 15:28   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
bryan.s.hong@gmail.com writes:
> I have a 100 X 100 spatial image to be resized to 1000*1000.
> The data of this image is surface temperature and includes some part
> of ocean.
> Because I want to exclude data of ocean area during interpolation, I'm
> trying to resize it using "interpolate".
> But I cannot understand the IDL help pages for the 'interpolate'.
> Could anyone help me with a simple command line for this job?
I don't think this is what you want to do.
Just use CONGRID (or REBIN) to resize your
image. (CONGRID uses INTERPOLATE to do the
interpolation, so you can see how it is done,
if you read the code.) Then mask out your ocean
pixels in the usual way, with the WHERE function.
bigImage = Congrid(image, 1000, 1000)
oceanPixels = Where(bigimage EQ 9999, count)
IF count GT 0 THEN image[oceanPixels] = 0
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|