Re: rebin with missing data? [message #10207] |
Tue, 28 October 1997 00:00 |
Stein Vidar Hagfors H
Messages: 32 Registered: May 1997
|
Member |
|
|
i001@justwright.com wrote:
>
> Hello,
>
> Does anyone have a routine to resize an array that contains missing data,
> please? The missing data value us that I use corrupts the real data in the
> in-built resizing routines.
>
> If anybody has one, I'd be very grateful for it.
Hi,
I don't have any existing routine per se, but I've done something
similar before with the interpolate routine to do some morphing.
Given e.g., IMAGE=fltarr(100,100), where missing values are flagged
with the value MISSING.
Then, do the following (this assumes that at least one pixel in IMAGE is
missing - otherwise just skip everything!).
mask = make_array(size=size(image))
ix = where(image eq missing)
mask(ix) = 1.0
image = rebin(image,sz1,sz2) ;; Where sz1, sz2 are the final sizes
mask = rebin(mask,sz1,sz2) ;;
;; Now, find all pixels influenced by the missing values:
ix = where(mask)
image(mask) = missing ;; Flag them as missing
That should be it, basically...
|
|
|