The guider software uses a camera to take images, analyze for offsets, and drive the telescope to remove the offsets. The guider also has utilities to setup a guide star. While the guider is running, users can tweak guide parameters.
The Shack-Hartmann is meant to be as simple as possible. It sets the stage according to the type of object to observe, and it exposes the camera and writes images.
Centroid a star position. This also sets the guide star to the centroided star.
Take an open-shutter exposure.
Take an exposure and locate the stars sorted by the best.
Turn on the guider. The mode is either manual, boresight, or field, and the other paramters are over ridden as needed. Tweaks can be done later.
Turn off the guider. If an exposure is in progress, this does not wait for it to finish.
Change something with a tweak. Some things that can change are gstar, binning, windowing, and star fit parameters.
Displays help for the commands. Does not take any arguments.
Replay a guider directory
returns many status keywords
setMask [filename], load a mask file. Reload existing mask if no file is specified
The guider has three guiding modes: boresight, field guide star, and manual. Some guiders are strictly field guide star and manual, such as the NA2 guider. The guider uses a star tracking package. Two other tracking packages are on the drawing table: quad cell and correlation. Generally, the tracker takes a CCD x, y position to find a reference star, and then uses that star's position as the tracked position. Offsets are applied to the telescope to keep the star centered on that position. In boresight mode, the reference position is gotten by asking the tcc for the current value for each frame.
Tweak commands adust the the guider while it is guiding. The tweaks are cached in the guider, and applied at the start of the next exposure. The guider uses the telescope for computed and un-computed offsets. If a user slews or stops the telescope axes, the guider will stop. When the telescope is moving, the guider either waits for the motion to stop or defer (skip) the exposure. When the move completes, the guider is notified, and if waiting for the move to complete, the machine will transition to the next state, which is usually to loop back and re-run the guide state. The guider runs until the machine receives a guide off command. The guide off command does not wait for the camera expose to complete, and the machine quickly transitions to Idle. This is a bug and needs to solved. Preferably, the exposure can be aborted as part of turning off the guide. The guider tracks a guide star. A user can select a guide star, and it will guide until a reasonable centroid is no longer found. When a guide star is not found, the guide star missing sound is played. If the guide star is missing for 2 times in a row, the guider tries the best star in the field on the next loop. The guider will keep trying for a reference star until a retry count, currently 5, is reached, and the guider goes to manual mode. The user can switch back to guide mode by selecting the mode and clicking apply on TUI.
User talks to guider in hub protocol, which then calls the guider that has a guide machine. The guide machine is a camera and a tracker, for now a star tracker, and the telescope to calculate and update the pointing offsets.
The guide machine is a hierarchical finite state machine, which is great for describing a precise complicated sequence. The 3.5m guide machine is the following. On the top level, there is Idle, Expose, CenterOn, and Guide. The machine has objects representing the tcc, an exposure, a tracker, and it has callbacks generating new events. For example, a move is started by the guider, which goes through the tcc, and the tcc is calling back on all move changes. When an offset is made, I can clear a flag, make the move, and wait for the callback that the move is done set the flag. There are a number of examples where code is cooperating to set events as the machine goes through its sequence. MAX_RETRIES = 5 # number of times to retry acquiring a guide MAX_MOVE_FAILS = 5 # FIX - put in configuration file
A daemon is created that listens for events published to a queue, and when an event arrives, it passes the event to the state machine. There are three input sources: a user, telescope motion, and a camera. The input sources send events to the machine. The event data structure actually is an event type and a context object which is name=value dictionary.
The expose state is a generic expose sequence that uses callbacks to customize the exposure.
The CenterOn state is used to center the guide star on the boresight. When CenterOn runs, it sets the guide mode to boresight.
The CenterOn state is entered from the Idle state on a "centerup" event. It uses much of the machinery the guide loop uses, but, it runs only once.
The sequence of events are: 1) analyse previous frame and find the star to center up on the boresight. 2) offset the telescope 3) wait for telescope move to complete 4) take an exposure and run findstars 5) done - go back to Idle
The guide loop is entered from the Idle state on a 'guide on' event. It will execute the do_guide_on() method during the transition. When the guide loop is entered, the setupLoop() method is run.. The initial state transitions to the Expose state automatically All the paths after the Expose state lead to the final state, which loops around and back into the guide state. 'guide off' can interrupt the machine and transition to the Idle state after calling the do_guide_off().