Code to automate nightly operations of the APF telescope