Imcombine arguments (apart from input and output ) :

  bias darks flats frames
combine median median average average
scale none none median none
zero median median none median
weight none none median none
reject none none avsigclip avsigclip
offsets -- -- -- file.sh

A) Bias / darks / flats

1) Filename into text file, general pattern (assume structure 2012-01-16/raw/ ).

ls SNX*r.fit > ../2012X_r.lis
ls dark*120.fit > ../dark120.lis
ls flat*r.fit >../flatr.lis
ls dark*d0_1.fit > ../bias1.lis
ls dark*d0_2.fit > ../bias2.lis
--> go up, cd .. before next step (!)

2) Master bias (for each binning, other arguments above)
imcombine raw/@bias1.lis output=bias1

3) Master darks (for each exp time and binning, other arguments above)
imcombine raw/@dark120.lis output=dark120

4) Master flats ( for SNe only 2x2 binning used, do for each filter)
*bias subtract flats: imarith raw/@flatr.lis "-" bias2.fits d@flatr.lis
*combine to make flat (arguments above): imcombine d@flatr.lis output=flatr
*normalise flat: imstat flatr --> number (MEAN) --> then imarith flatr "/" number flatr
*delete intermediate: imdelete d@flatr.lis

B) Images

5) Subtract dark from all frames (V,R 120 sec darks, but B 300 sec ! ): imarith raw/@2012X_r.lis "-" dark120.fits d@2012X_r.lis

6) Divide by flat : imarith d@2012X_r.lis "/" flatr.fits fd@2012X_r.lis (can check for cloudy frames by imstat fd@2012X_r.lis , those with outstanding mean should be inspected before xreg). Now its worth to inspect each frame and ensure that we are not using something of much poorer quality than others, if any such frames exist, remove from the .lis file before xregister. This is best done from the terminal, by opening simultaneously multiple frames, eg. =ds9 fdSN2012B0*r.fit & =

7) Register with cross-correlation: xregister fd@2012X_r.lis reference=fdSN2012X_001r.fit (or any other image in that series) regions="[200:500,400:750]" (or '[*,*]" ) =shifts=2012X_r.shifts xwindow=21 ywindow=21
fields 2012X_r.shifts fields=2,3 > 2012X_r.sh

7a) If xregister fails, for instance because it picks up hot pixels, or there are not enough stars, we can use more robust procedure: in IRAF display (image frame 1) and then imexam (image frame 1) to work out the center of each star location by hitting a when cursor is pointing on the star - this gives xy positions of the centre. Highlight the xgterm output in IRAF by left mouse button, and in terminal write cat > file and press the middle mouse button, which pastes the highlighted text. Press Ctrl-D to close the input. Then in IRAF lpar imcentroid, set coords=(file) , boxsize=(small size of shift that we expect from frame inspection). Now in IRAF imcentroid fd@images.lis fdimage001.fits coords=file Highlight the shifts with left click of mouse, if IRAF did it well, then the error is small and consistent throughout frames and stars. In terminal, cat > shiftfile and press middle mouse button to paste, ctrl-D to exit. In terminal, write awk '{print $2, $4}' shiftfile > shifts.sh ( we are picking columns 2 and 4 because the output of imcentroid has $1 image, $2 x-shift, $3 Err, $4 y-shift, $5 Err, $6 N, $7 interval). Now in IRAF we can use shifts.sh as offsets in imcombine

8) Combine the frames together imcombine fd@2012X_r.lis output=SN2012X_r_20120116.fits (other arguments above - note offsets=2012B_r.sh)

9) Subtract the sky getsky SN2012X_r_20120116.fits
imarith SN2012X_r_20120116.fits "-" (number mean) 2012X_r_20120116.fits

10) Copy to common directory

-- ChrisS - 16 Feb 2012
Topic revision: r5 - 06 Mar 2012, ChrisS
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback