Ccd mosaic
From MediaWiki
Montage
Download at: http://montage.ipac.caltech.edu/docs/download.html
Simple script called mosaic.sh:
#!/bin/bash mkdir rawdirFILTER projdirFILTER diffdirFILTER corrdirFILTER finalFILTER cd rawdirFILTER/ ln -s ../IMAGES . cd .. mImgtbl rawdirFILTER imagesFILTER.tbl mMakeHdr imagesFILTER.tbl templateFILTER.hdr mProjExec -p rawdirFILTER imagesFILTER.tbl templateFILTER.hdr projdirFILTER statsFILTER.tbl mImgtbl projdirFILTER imagesFILTER.tbl mAdd -p projdirFILTER imagesFILTER.tbl templateFILTER.hdr finalFILTER/uncorrectedFILTER.fits mViewer -ct 1 -gray finalFILTER/uncorrectedFILTER.fits -1s max gaussian-log -out finalFILTER/uncorrectedFILTER.png mOverlaps imagesFILTER.tbl diffsFILTER.tbl mDiffExec -p projdirFILTER diffsFILTER.tbl templateFILTER.hdr diffdirFILTER mFitExec diffsFILTER.tbl fitsFILTER.tbl diffdirFILTER mFILTERgModel imagesFILTER.tbl fitsFILTER.tbl correctionsFILTER.tbl mFILTERgExec -p projdirFILTER imagesFILTER.tbl correctionsFILTER.tbl corrdirFILTER mAdd -p corrdirFILTER imagesFILTER.tbl templateFILTER.hdr finalFILTER/mosaicFILTER.fits mViewer -ct 1 -gray finalFILTER/mosaicFILTER.fits -1s max gaussian-log -out finalFILTER.png
Then simply if images are called images* and FILTER is B:
sed -e 's/FILTER/B/g' -e 's/IMAGES/images*.fit/g' mosaic.sh > mosaicB.sh
And start the script with:
/bin/bash mosaicB.sh
It will take a while ...
MSCRED
Great tutorial at: http://www.ifa.hawaii.edu/~rgal/science/lfcred/lfc_red.html
The steps are the following:
- Create object list
ls images*.fit > img.list
- Create BPM
- Create COLD bad pixel map:
imstat master_flat field=midpt #lower=0.9*midpt imexpr " (a < lower) ? 1 : 0" coldV.pl a=master_flat
- Create HOT pixel map:
imstat dark_current_ofthesameexposure.fits # upper = 0.75*mean + 3*stdev imexpr "(a > upper) ? 1 : 0" hot.pl a=dark_current_ofthesameexposure.fits
- Final BPM mask = HOT and COLD
imexpr "max(a,b)" bpm.pl a=cold.pl b=hot.pl
- Add BPM to the header of each image:
hedit @image.list BPM bpm.pl add+ ver-
- Create object masks:
set masktype = pl nproto !sed -e 's/^/mask_/g' -e 's/.fit/.pl/g' img.list > mask.list objmask @img.list @mask.list masks="!BPM" hsigma=10 lsigma=5 minpix=40 ngrow=5 # Check if all objects are found in mask_images*.fit images, if not change hsigma and lsigma and eventually minpix.
- Find the background in the part of the images (the same part-it's easiest) - replace [xmin:xmax,ymin:ymax] with coordinates of some rectangular region without objects:
## In terminal awk '{print "iterstat",$1"[xmin:xmax,ymin:ymax] print+ ver-"}' img.list > goiter.cl ## In IRAF stsdas hst_calib nicmos cl < goiter.cl > iterout.txt !sed 's/=/ /g' iterout.txt | awk '{print $9}' > foo ## In terminal paste b.list fooB > boundariesB echo "mscred" > gomos.cl # Change below the ref_image.fit to your reference image: should be the same for all observations on every night in all filters used awk '{print "mscimage",$1,"mos_"$1," wcssour=\"image\" reference=\"ref_image.fit\" interpo=\"sinc17\" boundary=\"constant\" constant="$2}' boundaries >> gomos.cl # In IRAF cl < gomos.cl
- Fit 2D surfaces to the images and correct them for these gradients:
## In terminal ls mos_images*.fit > skysubin.list sed s/.fit/out.fit/g skysubin.list > skysubout.list ## In IRAF mscskysub @skysubin.list @skysubout.list 2 2 xmed=300 ymed=300 median_per=50 lower=3 upper=3 regions="mask" mask="BPM"
- Finally, stack the images:
## In IRAF !ls mos_images*fit_bpm.pl > bpm.list mscstack @skysubout.list msc.fit bpmask=@bpm.list comb=ave reject=avsigclip masktype=goodvalue maskvalue=0 scale=exposure zero=median statsec=[xmin:xmax,ymin:ymax] lthresh=100 hthresh=60000 rdnoise=12.5 gain=1.25 # These images may be of different exposure time, thus the scale keyword is set to exposure.