Processing an Aperture Mask for TRES in IRAF

The tres.tmakeref task creates files for flattening images with multiple apertures (and orders, in the case of TRES) and templates for the extraction of spectra from the apertures which are present. If the instrument has not been changed since the last run, it can be run automatically (interact=no), but if changes have been made in the fibers or optical bench, it should be run interactively (interact=yes). This example shows how to process a flat field exposure with two apertures present. It can be run automatically n ttres on the sum or average flat image produced bye that task.

Click on graphs for larger versions, back arrow in browser to this page.
Commands in brackets are used in cursor mode.

tres> del database/apflatmb*
tres> tmakeref 201.FLAT_sum_0034_0043.fits interact+
add flatmb12.fits,FLATFILE = 2008.1216/201.FLAT_sum_0034_0043.fits
flatmb12.fits updated
TMAKEFLAT: flatmb12.fits -> flatmb12.flat.fits
Edit apertures for flatmb12?  (yes):
This puts you in the apextract.apedit IRAF task

102 "aperture" display (2 fibers 51 orders each)

Zoom in on the problem area where, in this case, the first order was assigned to the wrong peak using cursor commands: [w] zoom [e] lower left [e] upper right

zoomed aperture display

Use [d] to delete wrong order 1

zoomed aperture display

Mark correct peak using [m]

zoomed aperture display

Type [a] to affect all orders
Type [z] to resize all orders

zoomed aperture display

Type [w] [a] to show all of the orders

102 "aperture" display (2 fibers 51 orders each)

Check the other end, too: [w](zoom) [e](lower left) [e](upper right)

zoomed aperture display

Type [w] [a] to show all of the orders

102 "aperture" display (2 fibers 51 orders each)

Check the middle, too: [w](zoom) [e](lower left) [e](upper right)

zoomed aperture display

[q] to quit, [yes] or [cr] to exit and save apertures

This puts you in the apextract.aptrace IRAF task

Recenter apertures for flatmb12?  (yes):
Resize apertures for flatmb12?  (yes):
Trace apertures for flatmb12?  (yes):
Fit traced positions for flatmb12 interactively?  (yes):YES

Trace for blue order

Type [q] to advance through the 102 apertures/orders which are displayed.

Trace for red order
[q] to quit, [yes] or [cr] to exit and save aperture traces

This puts you in the apextract.apflatten IRAF task

Flatten apertures in flatmb12?  (yes): 
Fit spectra from flatmb12 interactively?  (yes): 
Fit spectrum for aperture 1 for flatmb12.fits interactively?  (yes): YES
Trace for blue order
Trace for order crossing amplifiers
Trace for red order with fringing
Trace for order with bad fit to fringing with spline3 order=5
[:o 4] [f]

Trace for order with better fit to fringing with spline3 order=4

Trace for order with bad fit to fringing with spline3 order=4
[:o 2] [f]

Trace for order with better fit to fringing with spline3 order=2

Trace for order with bad fit to fringing with spline3 order=4
[:o 1] [f]

Trace for order with better fit to fringing with spline3 order=1

Flattened image is then retraced--all future images for this night will be flattened with the same flattening image before spectra are extracted.

We're back in apextract.aptrace

TMAKEFLAT: 2009-Feb-27 12:28 order 5 fit to flatmb12.fits
TFLAT1: flatmb12.fits -> flatmb12.flattened.fits using flatmb12.flat.fits
TFLAT1: Original flatmb12.fits => Unflat/
Recenter apertures for flatmb12?  (yes): 
Resize apertures for flatmb12?  (yes): 
Trace apertures for flatmb12?  (yes): YES
Fit traced positions for flatmb12 interactively?  (yes): 
Fit curve to aperture 1 of flatmb12 interactively  (yes): YES
Trace for blue order
Trace for red aperture

[q] to quit, [yes] or [cr] to exit and save aperture traces

tres.tmakeref splits the order masks into two apertures if fibers 1 (nominal object) and 2 (nominal sky) are present.

tres> ll flatmb*
lrwxrwxrwx 1 mink tdc      13 Feb 27 13:06 flatmb1.fits -> flatmb12.fits
-rw-r--r-- 1 mink tdc 9446400 Feb 27 13:05 flatmb12.fits
-rw-r--r-- 1 mink tdc 9446400 Feb 27 13:05 flatmb12.flat.fits
-rw-r--r-- 1 mink tdc 9446400 Feb 27 13:05 flatmb12u.fits
lrwxrwxrwx 1 mink tdc      13 Feb 27 13:06 flatmb2.fits -> flatmb12.fits

tres> ll database/apflatmb*
-rw-r--r-- 1 mink tdc 21997 Feb 27 13:06 database/apflatmb1
-rw-r--r-- 1 mink tdc 44224 Feb 27 13:06 database/apflatmb12
-rw-r--r-- 1 mink tdc 21999 Feb 27 13:06 database/apflatmb2
[Back to the beginning] [TRES IRAF Reduction Pipeline] [TRES Home Page]