Summary

The new AUTOPANE keyword allows DEIMOS to read out direct images and alignment images much faster than before, typically by a factor of two. This document describes the various modes of AUTOPANE operation.

Background

We have recently added to the DEIMOS deiccd keyword service a new keyword, AUTOPANE, enabling more efficient acquisition of DEIMOS direct images. Use of the AUTOPANE modes MaskArea and AlignArea (see definitions below) should result in very significant savings in CCD readout time, image file disk writing time, and image file disk consumption for all DEIMOS direct images. The AlignArea mode provides even further reductions in all of these factors for DEIMOS alignment images, thus speeding up slit mask alignment. (For further details regarding these savings, see the appendices at the end of this document).

AUTOPANE Modes

Depending on the selected AUTOPANE mode, the deiccd WINDOW keyword (which controls the size of the science mosaic readout window) will be reset automatically at the start of each DEIMOS science mosaic exposure as follows:

AUTOPANE Mode Action
Manual (0) This is identical to the current mode of operation, i.e., the WINDOW keyword (which controls the size of the science mosaic readout window) is NOT automatically reset at the start of each science mosaic exposure. Instead, the deiccd WINDOW keyword is manually set by the user via the GUI (or by scripts, such as MIRA, via keywords). So long as the AUTOPANE mode remains set to MANUAL, the current setting of the WINDOW keyword will persist until the user writes a new value to the it.
FullFrame (1) At the start of every science mosaic exposure, the WINDOW keyword is automatically reset to provide a full frame readout (WINDOW=0,0,0,2048,4096), i.e., one that reads out all 4096 rows from each of the selected CCDs.
MaskArea (2) At the start of every science mosaic DIRECT image (i.e., either the mirror slider is selected or a grating slider is selected and tilted to 0-order) exposure, the WINDOW keyword is automatically reset to provide a readout window (in rows) that corresponds to the image of the slitmask form outline for the currently selected grating/mirror and slider.
AlignArea (3) At the start of every science mosaic DIRECT image exposure:
  1. If there is no slitmask inserted or if the inserted slitmask has no alignment boxes defined (e.g., the LongSlit or GOH-X masks), then the WINDOW keyword is automatically reset to provide a readout window (in rows) that corresponds to the image of the slitmask form outline for the currently selected grating/ mirror and slider (same as in MaskArea mode).
  2. If there is a slitmask inserted and that slit mask has alignment boxes defined, then the WINDOW keyword is automatically reset to provide the smallest readout window (in rows) that contains the images of all of the alignment boxes for that slitmask.
AUTOPANE Modes

Note that for non-direct images (e.g., grating tilt is not at 0-order and/or mosaic readout mode is SPECTRAL) or non-illuminated images (i.e., OBSTYPE is DARK or BIAS), if the AUTOPANE mode is MaskArea or AlignArea, then the WINDOW keyword will be set for full-frame readout.

Setting AUTOPANE

There are three ways to set AUTOPANE to a new value:

Status

The AUTOPANE keyword is now implemented in the deiccd keyword libraries on polo and keamano. All AUTOPANE modes are now fully operational. The third mode (MaskArea) is operational for a subset of the various combinations of gratings/mirror and sliders, i.e., for those combinations for which the optimal direct imaging readout window has been measured:

The MaskArea mode will become fully operational once optimal direct imaging readout windows have been measured for all of the combinations of gratings and sliders. (As soon as each new optimal readout window is measured, it is a simple matter to update the AUTOPANE software to utilize it.) In the meantime, when the MaskArea mode is used with a grating/slider combination that has not yet had its optimal readout window measured, the WINDOW keyword will be set (at the start of the exposure) to provide a full-frame readout (i.e., all 4096 rows from each of the selected CCDs).

The fourth AUTOPANE mode (AlignArea) will be implemented as time permits. All of the hooks needed to support this mode have been installed; the remaining implementation involves extending the capabilities of an existing C-shell script. I hope to have this mode fully operational in time for the DEIMOS run that is scheduled to begin on September 21. Protoype versions may be available for testing sometime in August. In the meantime, attempts to start an exposure with AUTOPANE set to AlignArea will result in an error message and rejection of the exposure start request. Accordingly, please don't attempt to use this mode until further notice.

NOTE: All existing DEIMOS observing scripts (e.g., the DEIMOS MIRA scripts) that perform windowed readouts of the science mosaic (i.e., by setting the deiccd WINDOW keyword) now should be modified to include the command

	 modify -s deiccd autopane=manual
prior to setting the WINDOW keyword. Those scripts that save and restore the prior value of the WINDOW keyword should also save and restore the prior value of the AUTOPANE keyword.

As noted earlier, the various AUTOPANE modes can be selected either from the GUI or by accessing the keyword directly (e.g., via a "modify" command in script). The automatic resetting of the WINDOW keyword is performed by a special script (watch_pane) that is invoked whenever a science mosaic exposure is started (regardless of whether that exposure was started from a GUI or from a script).


Appendix A: Observing Time Savings for MASKAREA Mode

Currently, when DEIMOS alignment images are taken, we read out all 4096 rows of each of the four CCDs that are illuminated in direct imaging mode. The total time required to read out each such image (in dual-amp mode) AND write it to disk is approximately 59 seconds. Note the we include the disk writing time, since the xbox program can't start analyzing an alignment image until it is fully written to disk.

Recent experiments have determined that if we set the CCD readout window so that we only read out the rows of the CCD mosaic that encompass the image of the outline of the slitmask form (approximately 2600 rows), the time required to read out and write the image to disk drops to 33 seconds (a savings of 26 seconds per alignment image). Since observers typically take between 20 to 30 alignment images each night, that translates to a savings of between 8.7 to 10 minutes of telescope time per night. Over a typical DEIMOS run of 9 nights, that works out to between 69 to 90 minutes of telescope time, which is significant.

Note that these savings not only would apply to DEIMOS alignment images but would also apply to ALL direct images. For those DEIMOS observing programs that consist entirely of direct imaging, the total savings in observing time and disk space will be even more significant.


Appendix B: Observing Time Savings for ALIGNAREA Mode

For most DEIMOS slitmasks it is sufficient to read significantly fewer rows for an alignment image and thus achieve an even greater savings in time (and disk space). If one computes an optimal readout window for each slitmask, that window should be sized just large enough so that it encompasses all of the alignment boxes defined on that slitmask. For example, for slitmask 1114.W, a window of 730 rows is sufficient to capture all of its alignment boxes; that window can be read out and written to disk in only 17 seconds.

A survey was made of all of the observational slitmasks (i.e., those slitmasks containing one or more alignment boxes) currently in the DEIMOS slitmask database as of late May 2003. For each such mask, we computed the approximate size of readout window that would be needed to capture the image of all of the alignment boxes defined on that mask. The average-sized window was 1227 rows, or less than half the number of rows that is needed to capture the outline of the slitmask form. A 1227-row DEIMOS mosaic image can be read out and written to disk in about 22 seconds, for a savings of 37 seconds per such image (compared to a full-frame readout).

The results of the database survey were tabulated into bins about 555 rows wide (which corresponds roughly to bins of 50 millimeters on the slitmask) and produced the following histogram:

% of masks Required a readout window of:
9% 0 to 555 rows
30% 556 to 1110 rows
40% 1111 to 1665 rows
20% 1666 to 2220 rows
1% 2221 to 2775 rows
Recall that about 2600 rows is sufficient to capture the image of the outline of the slitmask form.

Presented in cumulative form, this histogram shows:

% of masks Required a readout window of:
9% 555 rows or less
39% 1110 rows or less
79% 1665 rows or less
99% 2220 rows or less
100% 2600 rows or less
Based on these results, it is very clear that we could be saving significant amounts of time (and disk space) when reading out (and writing to disk) alignment images if we optimized the size of the readout window. We could accomplish these savings in two different phases:


Appendix C: Additional Features / Phase 3

Once phase 2 is completed, the watch_pane script will already be accessing the alignment box definitions from the relevant FITS chunk file and will already be applying the appropriate mapping function to convert the vertex coordinates for each alignment box from slitmask-design space to science mosaic pixel space. If that information could be made accessible to ds9, then ds9 could use its overlay plane to mark the outlines of the predicted alignment box positions on the displayed alignment image.

In addition, if the outlines of the predicted alignment box positions were available to ds9, we would then be in a position to implement an alternate image scaling algorithm in which only those pixels that are within a defined alignment box are used in computing the display color map scaling. Specifically, the predicted alignment box outlines could be used to auto-generate ds9-style boxes of the sort that would normally be generated by using Region->Box and drawing a box with the mouse.

Providing an adequately-scaled display for alignment boxes has been a vexing problem to date and one which Faber, Phillips, and Kibrick have repeatedly complained about; providing such an alternate image scaling would make the display of these alignment images much more useful.

We are planning to use the various PANE keywords to define the number (PANELIST) and geometry (PANEn) for each of the alignment boxes in terms of where (in science mosaic pixel space) they are predicted to appear in the alignment image. While this is a subtle modification of the original function these keywords were originally intended to perform, it is a reasonable one, after all, since the original purpose of the PANE keywords was to define the set of CCD pixels that would be read out for an alignment image.

As things now stand, although the PANE keywords are defined in the keyword library and in the CCD VME software and are also recorded in DEIMOS FITS headers, they are currently only placeholders, and have no effect on which CCD pixels are actually read out. Rather, the WINDOW keyword (which we had hoped to retire and replace with the PANE keywords) currently determines what subset of the pixels are read from the mosaic.

Thus, to summarize phase 3, we would modify the phase 2 version of the watch_pane script so that for each set of alignment box vertices that it maps into pixel space it would write those mapped values into a PANEn keyword and sets PANELIST to indicate which PANEn keywords have been set. For non-alignment images, the script would simply set PANELIST to null.

When ds9 is presented with an alignment image, it could then use the alignment box info gleaned from the PANELIST and PANEn keywords in the FITS header for that image to draw alignment box outlines and to restrict its image scaling computations to those pixels that fall within the alignment boxes defined by the PANEn keywords in the header.


See Also