Back to Programs

align-mask

align-mask uses a direct or dispersed image of a slitmask to improve on the (1) scale (2) rotation (3) x,y offset values given in an existing dewar offset file, and, for a dispersed image, to improve on the disperser misalignment value given in an observation definition file. Output is a new dewar offset file, and a modified observation definition file.  align-mask predicts the locations of slit images in a ccd frame, searches near each predicted location for the expected slit image, and calculates offsets for each. From the set of offsets, the program solves for the focal plane scale, rotation angle, x,y offsets, and disperser misalignment which will minimize the median errors.  align-mask can be used with any image, however if the initial offsets are large, a preliminary pass through adjust-mask may be needed to enable align-mask to reliably match predicted with actual slit positions.

 

USAGE

align-mask -o observset -f framename

INPUT

framename is a set of image files containing a direct or dispersed image of a slitmask. observset.obsdef is the name of an existing observation definition file which describes the observing setup used for the frame and specifies an existing dewar offset file

OUTPUT

framename.dewoff, a new dewar offset file., observset.obsdef, an updated observation definition file.

PARAMETERS

searchbox

half-width of search range (in pixels)

magfactor

magnification factor (in plot) of offset vectors

lamfile

file with list of comparison lines to use with dispersed image

naver

number of neighboring vectors to average in plot (normally =1)

threshold

minimum strength of apertures/lines used, as multiple of background

siglimit

line rejection threshold

maxflux

maximum flux

width

width of plot window, in inches (defaults to 5.0)

misalign

fit for disperser misalignment?

use_holes

Include alignment holes in analysis?

auto

automatic mode? Iterate without user interaction

 

Details:

When first invoked, align-mask calculates the predicted positions of all slit images, then searches near these positions for the images. Only slit images stronger that threshold x background are included (a useful value of threshold is a few tenths, if your frame has not had bias subtracted- which you normally should do). If you are using a dispersed (rather than direct) image, align- mask searches for the images of each spectral line listed in lamfile. If you expect the initial alignment to be pretty good, start with parameters searchbox = 10 and magfactor = 100. A plot of the position errors for all apertures found is first presented, and might look something like ths(for atypically large offsets)

 
68 matches found. sigma =   1.95 pixels. Continue?

 

If it does, answer “y”, and the fitting process will begin. However, if the initial plot looks like this:

then the dewar offset file is very far wrong. In this case, answer “n”, and use adjust-mask to make preliminary corrections, then return to align-mask for final adjustments.

align-mask can be run in two modes. In auto mode, three iterations of the fit to all parameters are made and you will be presented with the final result, to accept or reject. If accepted, align-mask will create a new dewar offset file, which is given the name of the image that was used, and update the observation definition file with the name of the new dewar offset file and- if you are working with a dispersed image and you requested a fit to disperser misalignment- the updated value for disperse misalignment.

If you are not running in auto mode, you will be presented with each step of the fit, and can chose to apply or reject the corrections. Very small corrections are probably meaningless, but there is no harm in accepting them. At any point in the process, you can quit by typing “q”.

Notes

 

Back to Programs