AstroPy - makeflat.py - 9/3/07


Description

Makes mask, intercept, and slope images from a set of sky flats taken at two different exposure times. Note that using images made from only different numbers of coadds will not work: the two sets must have diferent exposure (integration) times. Each set of images is stacked and averaged. Pixel values outside of a threshold (usually 1.5 standard deviations from the mean) are removed from the masks, and the two masks are combined by multiplication ('and'-ing). The slope is computed as (av2 - av1) / (exposure2 - exposure1), and the intercept as av1 - slope * exposure1 where the mask is 1. Only an affine response is calculated for each pixel. Usually, the intercept values are negative.

Usage

makeflat.py parent-directory min-flat-file-name1 max-flat-file-name1 exposure1 min-flat-file-name2 max-flat-file-name2 exposure2

Examples

42: ~/Projects/Python/AstroPy > makeflat.py 072407 im0141.a.fits im0150.a.fits 0.25 im0161.a.fits im0170.a.fits 1.0
reading 072407/raw/im0141.a.fits
reading 072407/raw/im0142.a.fits
reading 072407/raw/im0143.a.fits
reading 072407/raw/im0144.a.fits
reading 072407/raw/im0145.a.fits
reading 072407/raw/im0146.a.fits
reading 072407/raw/im0147.a.fits
reading 072407/raw/im0148.a.fits
reading 072407/raw/im0149.a.fits
reading 072407/raw/im0150.a.fits
reading 072407/raw/im0161.a.fits
reading 072407/raw/im0162.a.fits
reading 072407/raw/im0163.a.fits
reading 072407/raw/im0164.a.fits
reading 072407/raw/im0165.a.fits
reading 072407/raw/im0166.a.fits
reading 072407/raw/im0167.a.fits
reading 072407/raw/im0168.a.fits
reading 072407/raw/im0169.a.fits
reading 072407/raw/im0170.a.fits
flat1 is (10, 512, 512), mean = 105.377964401, std = 84.6731618345
flat2 is (10, 512, 512), mean = 1222.54296875, std = 278.152408762
av1 is (512, 512), mean = 105.377964401, std = 83.702736997
av2 is (512, 512), mean = 1218.91552734, std = 274.226981714
mask1 is (512, 512), thresh = 1.5 stds, mask1 has 699 zeros
mask2 is (512, 512), thresh = 1.5 stds, mask2 has 9828 zeros
mask is (512, 512), mask has 10225 zeros
exposure1 = 0.25, exposure2 = 1.0
masked slope is (512, 512), mean = 1466.56517331
masked intercept is (512, 512), mean = -261.7508686
writing 072407/intermediates/mask.fits
writing 072407/intermediates/slope.fits
writing 072407/intermediates/intercept.fits



İSky Coyote 2007