Interpolates the masked values of a flattened image. First the slit (columns 227-234) is filled with a linear interpolation of the average of columns 226 and 235 and their copies shifted +-1 pixel up and down. The result is then 2d convolved with a Gaussian filter of the form exp(-(r / 100)**2). All pixels at 0 values in the mask are replaced by the filtered result. The slit is then filled again, the result is clipped to zero, and then it is shifted +-0.5 pixels in Y and X and averaged to reduce the remaining video noise.
fill.py maskFolder fits-file, or fill.py maskFolder imageFolder outputFolder [min-fits-file max-fits-file]
Single file mode:
> fill.py 072407/intermediates 072407/flattened/im0215.a.fits reading 072407/intermediates/mask.fits
Multi-file mode does not use graphics, and writes a new set of filled images:
> fill.py 072407/intermediates 072407/flattened 072407/filled im0171.a.fits im0276.a.fits 072407/filled/im0171.a.fits 072407/filled/im0172.a.fits 072407/filled/im0173.a.fits 072407/filled/im0174.a.fits 072407/filled/im0175.a.fits 072407/filled/im0176.a.fits 072407/filled/im0177.a.fits 072407/filled/im0178.a.fits 072407/filled/im0179.a.fits 072407/filled/im0180.a.fits ...
The previous screenshot shows an example of 'fill.py' working well. Here are examples of it working less well:
and pretty good even though the mask (computed from 090807 1482-1491 and 1462-1471) has lots of bad pixels (glare from sunrise?):
©Sky Coyote 2007