Calibrating MAlign  

Below is described the techniques used to calibrate the scale and position angle needed to run MAlign for a given instrument. The basic steps are: initialize a parameter file, take an image with pmfm mode and a single segment kicked out, start up the MAlign software and display the image, correct the parameters in the file, kill and restart the MAlign software and double check that the image orientation is correct. One then can proceed with identifying the segments to confirm that the scale is correct.

Background

The Malign software must be configured properly for the instrument taking the images. This configuration is accomplished by reading in parameters from a file. The files can be found by logging in to the appropriate machine (for K1 log into okoe as k1tel, for K2 log into kalama as k2tel) and going to the directory /kroot/rel/default. The parameter files should be called Malign_source.lris, etc.

Initializing the parameter file

Usually one would copy an existing MAlign parameter file as a starting point.

There are four relevant parameters in the parameter file. They are the pixel scale (GSTACK_PLATE_SCALE) in pixels per arcsecond, a rotational angle (GSTACK_ANGLE) in degrees, a flip or handedness (GSTACK_FLIP), and a default focus mode size (GSTACK_FOCUS_MODE). It may be easiest to start with the parameters shown below. Note that GSTACK_FLIP is used as an "on/off" switch. By typing "unsetenv GSTACK_FLIP" the environment variable is "undefined," and the switch is turned off. The scale parameter should be calculated beforehand from the known pixel scale of the detector. Note that if the detector is to be binned, the number of binned pixels per arcsec should be used. If the rotation angle is set to zero, it makes the math later on very simple. However, there may be some reason to set it to a nonzero value, if one has a preconceived notion of its true value. The default value of focus mode is used only if the true value is not found in the file header.

Take an image

You will take an image with the primary in focus mode and one segment kicked out. The image size must be 512x512 or smaller. This may require either using a subarray of the entire detector or binning the detector pixels. Remember, too, that prescan or postscan regions of the image are included in the 512 size.

Put pmfm mode into the primary, using either the ACS GUI (preferred) or typing set pmfm x in the ACS CLI, where x is the desired move in nm. Note that the appropriate value of pmfm varies from case to case. Values between 250 and 500 are typical. To perform the MAlign calibration you must put in a positive value!

Kick out segment 21. This segment is chosen because it is easy to identify and the resulting pattern will be unambiguous. If, for example, a corner segment is kicked out, the flip of the image will be ambiguous. To kick the segment out, in the ACS CLI type

set actu delta 62 10000

This moves actuator 62 10,000 nm, or about 2 arcsec, enough to unambiguously identify the hole left behind by the moved segment. Later on you will remove this offset by set actu delta 62 -10000.

If possible, set the rotator to p.a. 0° in stationary mode. Take an image (of 512x512 pixels or less). For CCDs it may help to reduce the number of pre- and/or post-scan pixels, to maximize your imaging area while still keeping the total image size under 512x512.

Start up MAlign

Start the MAlign software by going to the telescope operator account, typing "cd align" and then cd'ing to the appropriate subdirectory. The software is started by typing

align {instrument} {data_path}

where instrument is the instrument name (ssc, lris, esi, etc.), and data_path is the pathname to an image file (e.g. /s/scratch100/lris/malign1.fits). Read in the image taken, and display it. Note that if the image header does not contain the pmfm you will need to type it into the box provided on the MAlign GUI. If the image header does not contain the value of ROTPPOSN, the rotator physical angle, it will assume it is zero. Usually only visiting instruments will lack these header keywords.

In the displayed image, first identify the "hole" left in the otherwise symmetric pattern by the missing segment 21. Make sure you use SAOimage for this! If you use the normal display for the instrument (such as FIGDISP), it may have a mirror-reversed image or even a rotated image. This can lead you to deduce incorrect values for the MAlign parameters!

The corner segment next to the hole is segment 22. If the hole is counterclockwise (CCW) from the corner segment, you need to flip the segment image map by setting

setenv GSTACK_FLIP ""

in the parameter file. After you do this, quit the MAlign software and restart it, reading and displaying the image again. (You do not need a new image.) The hole should now be clockwise (CW) from the nearest corner segment.

 

Fig. 1. The hole at the left is from the missing segment 21 (which happens to be sitting right on top of segment 6 in this frame). Below it is segment 22. Since the hole is clockwise from segment 22, GSTACK_FLIP must remain "unset". If this image were taken with ROTPPOSN=0 and GSTACK_ANGLE=0, the segment map on MAlign should show segment 22 at the top, rather than 120° from the top as the image shows it. In this case, GSTACK_ANGLE should be changed to 120.

 

Once the flip is correct, you calibrate the angle. Estimate the angle from vertical CCW to the corner segment nearest the hole (which will be segment 22). Add this angle to GSTACK_ANGLE in the parameter file.

You should be done with the first steps, and can confirm by killing and restarting the software, reading and displaying the image again, and confirming that the hole and the corner segment next to it correspond to segments 21 and 22, respectively, in the segment orientation map.

 

Fig. 2. The segment map shown in MAlign. In this case GSTACK_ANGLE = 0 and GSTACK_FLIP is unset ("off"). If this were correct, the image should show the hole in the position of segment 21, and the nearest corner segment (22) should be at the top of the pattern. The ultimate goal is to get the image to correspond to this segment map for positive pmfm values.

Once you have confirmed that the segment map and the image correspond at this rotation angle, check the sense of the rotation. Rotate by 15 degrees, take a new image, and read it into SAOImage. Did the segment map and image rotate in the same direction?

If the answer is yes, you are done. You can try identifying the segments automatically by clicking the "AUTO" button on the MAlign GUI, putting the cursor in the middle of the focus mode pattern on the image, and hitting the space bar. If the automatic identification fails, you could have the wrong scale factor in the file; check to make sure that the units are pixels/arcsec (not arcsec/pixel), and that the value is appropriate for the binning in use.

If the segment map and image agree at some orientation, but not at others, then the sign of ROTPPOSN is being treated wrong. This is a mysterious state known to exist only in ESI. See John Gathright and/or Bob Goodrich for sympathy, if not help.

Clean up by putting segment 21 back in the stack. On the ACS CLI type set actu delta 62 -10000. Set the focus mode (PMFM) to zero.


Bob Goodrich
Last modified: 12 November 1998.