Start Up and Shut Down Procedures
=================================

Observing Modes
---------------
* Idle
  
    This is the state that the observatory is in following the Shutdown Sequence
    In this state, all of the equipment is powered on but closed/parked and ACP,
    Scheduler, and Clarity are running but not connected to the telescope. 

    When the system is in Idle Mode, the following will be true:

    * The *observatory* user is logged into the observatory computer.
    * The only software running is:
      
      * ACP
      * Scheduler
      * Clarity II
      
    * ACP is disconnected from the telescope, dome, and camera.
    * Clarity II is receiving and displaying data from the weather station
    * ACP is connected to Clarity II and receiving weather information
    * The 'Dispatcher Running' checkbox in Scheduler is unchecked and
      Scheduler's status line reads 'Disabled.'
    * The telescope is parked.
    * The dome is closed and parked.
        
* Manual 
  
    Use this observing mode for outreach events and observing with the
    introductory Astronomy students.  All aspects of telescope pointing and
    image acquisition are handled manually using Starry Night and MaximDL as the
    main interface.

* Semi-Automated 

    This observing mode is used when an operator wishes to interactively control
    the timing and sequencing of a set of observations while automating
    pointing, image acquisition, and plate solutions.  

* Automated 

    Automated Observing Mode allows the telescope to perform completely
    unattended observations.  Control of precise timing and sequencing of
    observations is handed over to the Scheduler.


Manual Observing Startup Sequence
---------------------------------
#. Ensure that the system is in Idle mode.  
#. If you don't want to be interrupted by weather alerts (meaning that YOU have to be alert!):

    #. Shut down Scheduler.
    #. Choose 'Weather->Disconnect' from the ACP menu.  

    Note: If Scheduler is running, it will automatically reconnect ACP to the
    weather, so Scheduler must be shut down first. 

#. Run the 'StartupObs.js' script.

    # In ACP, press the 'Browse' button.  
    # Choose  'C:\Program Files\ACP Scheduler\StartupObs.js'
    # Press the 'Run' button in ACP

#. The following will be true if the script has run successfully:

    * MaximDL is running.
    * The camera is connected and the cooler is turned on.
    * FocusMax is running.
    * ACP is connected to the telescope. When ACP is connected, the telescope's
      position and the time will appear in the upper part of ACP's display.
    * SmartDome is running and the current dome status is displayed.

#. Open the dome by choosing 'Dome->Open' from the ACP menu bar.
#. Start Starry Night and connect it to the telescope.
#. Run an autofocus cycle.
    #. Choose 'Browse' in the ACP window
    #. Choose 'C:\Program Files\ACP Obs Control\Scripts\AutoFocus.vbs'
    #. Press 'Run' in the ACP window.
    #. Watch the show!

#. You are ready to observe!

Automated Observing Startup Sequence
------------------------------------
#. Ensure that the system is in Idle mode.
#. Start 'Lights.py'
#. Check the 'Dispatcher Running' checkbox in Scheduler
#. If it's past sundown, watch for a few minutes to ensure that things are
   starting up properly.
#. If it's more than an hour before sundown, watch to make sure that the
   Scheduler status chages to 'Sleeping.'
#. Walk away!

Shutdown Sequence
-----------------
#. If Starry Night is running
    #. Disconnect Starry Night from the telescope

        *IMPORTANT!*:
        You MUST disconnect the telescope in Starry Night before doing ANYTHING else!

    #. Shut down Starry Night

#. If Scheduler is running and the 'Dispatcher Running' checkbox is checked

    #. Uncheck 'Dispatcher Running'
    #. Wait for Scheduler status to read 'Disabled'

#. If Scheduler is running and Scheduler's status reads 'Dead', Shut down
   Scheduler and proceed to the next step.

#. If Scheduler is not running, start up Scheduler and wait for the Status line
   to read 'Disabled' and for the 'Dispatcher Running' label to activate (it is
   initially grayed out).

#. Verify that ACP is running.
#. Verify that ACP is connected to the weather station.
#. If an autofocus cycle is running, allow it to finish

    *Note:*  You can abort the autofocus cycle by pressing the 'Stop' button in
    FocusMax, but FocusMax is sometimes stubborn.  If you have time, just wait
    for it to finish.  

#. If any scripts other than autofocus are running in Scheduler, stop them by pressing 'Abort' in ACP
#. Run the shutdown script

    #. In ACP, press the 'Browse' button.  
    #. Choose  'C:\Program Files\ACP Scheduler\ShutdownObs.js'
    #. Press the 'Run' button in ACP

#. After ShutdownObs.js has finished, verify that the following is true:

    # The telescope is parked.
    # The dome is parked and closed.
    # MaximDL, FocusMax, and SmartDome are no longer running.
    # Clarity II is still running.

Cold Start Power Up
-------------------
Power up the observatory when all equipment is powered off.

#. Power up computer in the control room. Let it boot up while you're powering
    up the other equipment.

#. Power up the telescope mount. The power switch is located in the telescope Pier.

#. Plug in the camera. The power cord is attached to one of the handles on the camera body.

#. Plug in the lower dome control box. The lower control box and power cord are
    on the west wall of the dome room.

#. Turn on the upper dome control box. The breaker is mounted on the north side
    of the dome ring.

#. Log into the computer

    | **Username**: observatory
    | **Password**: cdk17