comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: interpolation for resizing
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: interpolation for resizing [message #64163 is a reply to message #64162] Tue, 02 December 2008 20:04 Go to previous messageGo to previous message
Chris[6] is currently offline  Chris[6]
Messages: 84
Registered: July 2008
Member
On Dec 2, 1:28 pm, David Fanning <n...@dfanning.com> wrote:
> bryan.s.h...@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.")

One potential issue with this approach is that IDL may interpolate
between your 9999 values and your real data values when you expand the
array. If you set the 9999s to !values.f_nan beforehand, then the
interpolation will behave more sensibly.

chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Irregular Satellite data plotting
Next Topic: Assigning Coordinates in NetCDF

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 22:56:30 PDT 2025

Total time taken to generate the page: 0.63850 seconds