Sequence Structure - ac4lt/autonomous-nina-sequence GitHub Wiki
The sequence itself is inside a container called "loop forever(ish)". The "(ish)" is because the sequence will run for as many nights as you configure in the max_cycles variable (set in the custom variable initialization template). By default this is 1 but you can set it as high as you like. It is recommended that you do let the sequence end occasionally. At this point, restart Nina and you can install any plugin or application updates if desired. For example, if max_cycles is set to 100 then the sequence will run for 100 nights or until Target Scheduler runs out of active projects.
The section before the loop container is primarily for initialization. The "initialization" container is where all sequence variables are defined. Next, the "custom variable initialization" template is called setting defaults that are specific to the observatory. This should be customized for your observatory. In it you define what exposure lengths you are using for darks, what types of darks you use, what gains and offsets you use, and other setting that are specific to each set of equipment.
Within Loop Forever(ish) there are several other containers each dedicated to a single purpose.
- check option consistency
- handle dawn through noon
- handle noon through nautical dusk
- handle astronomical dusk, night and astronomical dawn
- report work
- handle nautical and civil dawn
Each "handle ..." container is responsible for a different time of day. It is structured the way it is because the "day" for Nina starts at noon.
Check Option Consistency
This container is responsible for producing warnings if darks have been requested but no windows have been configured to acquire them. It also produces a warning if at least one flat window has been enabled.
handle dawn through noon, handle noon through nautical dusk, handle nautical and civil dawn
These three containers are all structured the same way. They all call the template "handle non-imaging time period". That template is what is responsible for handling all the non-imaging time. It does the following:
- Ask Target Scheduler to get flats if needed (if daytime flat collection is enabled).
- Get darks if darks have been requested
- Wait until the time period expires
While in the wait period, the user can set the variable "need_darks" to True (1) to trigger dark collection. If possible, the sequence will power up the equipment and collect the number and type of configured dark frames (set in "custom variable initialization") until completion or the time period expires. If the time period does expire, the sequence will continue acquiring darks in subsequent time periods until it completes. Darks will be stored in a folder named "calibration".
The simplest way to trigger darks is through the Powerups Pane on the imaging tab. Set the value to True or 1 and the sequence will get darks at the next chance.
handle astronomical dusk, night, and astronomical dawn
This container is responsible for all light frame acquisition. If conditions are safe it calls Target Scheduler which handles all the data collection. Since Target Scheduler permits operations during astronomical twilight, the sequence covers that time period although most people restrict operation to astronomical night.
If conditions are unsafe, then the sequence parks the telescope and goes into a wait state. If unsafe flat collection is enabled, the sequence will ask Target Scheduler if any flats are needed. These are only collected when the roof is closed to avoid possibly disturbing other users in a shared observatory if you happen to define unsafe conditions more conservatively than other users. If flats compete or are not needed then darks are collected if unsafe dark collection is enabled and darks have been requested. If darks complete or were not requested then the sequence waits until safe conditions exist (or nautical dawn occurs). As with the non-imaging-period containers, the user can trigger darks by setting "need_darks" to True (1).
If conditions become safe then control is returned to Target Scheduler.
report work
At the end of the night the sequence reports back on which targets were worked on. Which, if any, completed light frame acquisition and also increments the cycle count.