comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: rebin with missing data?

Re: rebin with missing data?
type: item
description: 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...
creator: Stein Vidar Hagfors H
date: 1997-10-28T08:00:00-00:00