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 end normally if Target Scheduler has no more active targets but, if RUN_CONTINUOUSLY is set to 1 and there are unfinished, active targets in the Target Scheduler database it will run forever.
Within Loop Forever(ish) there are several other containers each dedicated to a single purpose.
- check option consistency
- day loop
- evening flats
- wait for dark enough
- night loop
- turn flat panel off
- morning flats
- power off
- handle transition to next day
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.
Daytime Loop
This loop runs until 45 minutes until sunset. It will check (using a Target Scheduler instruction) every 15 minutes to see if flats need to be taken (if daytime is an allowable window). If darks are requested by the user (by setting need_darks to 1) then the loop will begin taking darks at the earliest opportunity (if daytime is an allowable window).
The loop will stop taking flats or darks if the roof opens. If the roof closes before the loop finishes it will resume.
Evening Flats
During the period from sunset + 15 minutes until nautical dusk - 2 minutes the sequence will acquire flats if requested
Wait For Dark Enough
This container simply waits until it is dark enough. It simply waits until 60 minutes before astronomical dusk. The reason for being so early is that if no flats or darks have been requested then the camera will need time to cool and stabilize.
Night Loop
This is where all the imaging and safety management happens.
Turn Flat Panel Off
If the window for getting flats during unsafe conditions is active then it is possible for that flat acquisition process to be interrupted if conditions become safe. Although the sequence tries to make sure the panel is turned off if that happens this is just some insurance to make sure it is off.
Morning Flats
If requested, flats are acquired between nautical dawn and sunrise - 15 minutes.
Power Off
The equipment is powered off here unless daytime darks or flats are still needed. In that case this doesn't power down.
Handle Transition To Next Day
NINA's day begins at sunrise. We need to wait until then before we let the loop complete so that we'll be ready to begin the next day's (and night's imaging). If daytime darks are requested we'll use this wait time to get a head start on the darks for the day.