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

Home » Public Forums » archive » interpolate over bad pixels
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: interpolate over bad pixels [message #44642 is a reply to message #44561] Wed, 29 June 2005 03:06 Go to previous messageGo to previous message
Jess is currently offline  Jess
Messages: 11
Registered: June 2005
Junior Member
Hi again Em,

This is what I'm now doing for the 1D arrays which works really well.
I'm sure its not the fastest, but it works fine. Below I've given the
syntax for a 2D example (sorry if its not quite right, as I haven't
tested this 2D one).

Create 3 arrays, one that contains just the indices of the good pixels,
second that contains just the values of the good pixels, and third that
contains the indices of all the pixels, eg.

; where not eq NAN
wh_good = WHERE(FINITE(orig_image))
; image with just good pixels
image_good = orig_image(wh_good)

; size of image
dimens = size(orig_image,/dimensions)
xnum = dimens[0]
ynum = dimens[1]
; indices of all pixels
wh_all = indgen(xnum,ynum)

; Then interpolate, to get corrected image
; eg. linear interpolation
image_corr = interpol(image_good,wh_good,wh_all)
; or for cubic spline
image_corr = interpol(image_good,wh_good,wh_all,/spline)

Have a look at the help on where, finite and interpol.

Cheers,
Jess
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Symbol's value as variable is void: idlwave-sys-dir
Next Topic: dialog_pickfile: changing default view in windows

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

Current Time: Sat Oct 11 15:37:27 PDT 2025

Total time taken to generate the page: 8.00179 seconds