guider module

The guider module is a client that handles guiding the telescope based on continually taking images with a guide camera, and keeping the position of an object at the same location on the detector.

Currently, it is designed to acquire and guide on the brightest object in the (small) guider field of view. The exposure time is automatically adjusted to provide desired count level.

The centering algorithm is designed to work even if the object is positioned over an aperture where light is lost, e.g., down a fiber. This is accomplished using an algorithm developed for SDSS, where the center of an object is defined as the location at which the variance of counts in a series of circular annuli is minimized, where pixels in the aperture are masked out and not included in the variance calculation.

Guiding is implemented with a PI loop, with adjustible proportional and integral constants. The guiding corrections are measured from each exposure, but are averaged over series of shorter exposures before a correction is applied.

A minimum number of counts is required to determine a correction.

The module defines a Guider object which can be instantiated and has multiple methods. Basic sequence is to first instantiate it with a desired position; this can be the fiber hole, and an accurate position for the hole can be automatically determined using a calibration channel image. Then the object is acquired; the brightest object is found and then moved to the desired position. Guiding then repeats calling the guide() method, which determines offset, and makes corrections based on parameter of the Guider object (exptime, number of frames to average, number of corrections to average before applying offset, PI proportionality constants, etc.

The main() method listens for comands on localhost port 5000. The commands can be one of start, stop, pause, or resume. The start command can take keywords to set parameters of the Guider object.

To start the guider, simply issue the command:

guider

Module functions