#=====================================================
Borat Scripts Map
Last Modified: Feb. 26 2015

This file maps the file locations of the scripts used
by BORAT and rts2. They also include brief descriptions
of their functions. If any scripts are created or moved,
please update this file accordingly.

Note: The starting directory will be the intern home 
folder(/home/intern) and will be denoted by ~

Current Working Directory of RTS2:
/usr/src/rts2/trunk/rts-2/src
#=====================================================

Directories in Intern Home Directory
1. borat_docs - This directory contains documentation for operating borat. This file is actually a symbolic link whose target is /home/intern/Dev/borat/documentation
2. Dev - This directory is the parent directory to all of the development scripts, such as hardware and software
3. rts2 - Contains drivers and scripts for running rts2. It is a symbolic link whose target is /usr/src/rts2/trunk/rts-2
4. script_libs - Contains python libraries that are imported from rts2 scripts

Dev(~/Dev)
1. borat - Contains scripts essential to operating BORAT
2. solo6x10 - Driver directory for a BlueCherry Video capture card
(Details can be found at https://github.com/bluecherrydvr/solo6x10)

Borat(~/Dev/borat)
1. apply_rts2_changes.sh - Shell script that applies any changes made to rts2. Changes include: 
  a. pointing corrections in astrometry(img_astrometry.py)
  b. focus controller(ez4axis.cpp)
  c. borat compile script(borat_compile.sh)
2. documentation - Directory containing essential instrument documentation and operating procedures 
3. hardware - Directory containing different instrument driver and operating scripts
4. software - Directory containing software tools to ease borat operating process. Centralizes many scripts and backup data

Documentation(~/Dev/borat/documentation)
1. autofocus_notes.txt - Directions to run a simple autofocus routine and details on astrometry
2. AutostarSerialProtocol2007oct.pdf - Protocol document outlining the commands and instructions to remotely control a Meade telescope
3. Clarity_II_Manual.pdf - User Manual for the weather sensor
4. Ez4Axis_Focuser.pdf - User manual for the focuser controller/driver
5. ILO.txt - Directions on how to connect to the ILO machine
6. LX200GPS_manual.pdf - User manual for the Meade LX200GPS telescope(our telescope)
7. manual - Text version of Lee's rough and dirty BORAT manual.(Needs cleaning/prettifying; very helpful)
8. quick_commands.txt - Directions to run a rts2 command via command line(not very descriptive)
9. runningBORAT.txt - Mike's concise yet comprehensive instructions on how to run a perform a full routine with BORAT(very helpful)

Hardware(~/Dev/borat/hardware)
1. dome - Contains ahe(AutoHaven) driver and operating script for the dome
   a. ahe.cpp - Driver in C++
   b. ahe.h - Header for ahe driver
   c. dome.py - Python script for operating the dome
2. focuser - Contains driver and operating script for the focuser
   a. ez4axis.cpp - Focuser driver in C++
   b. focuser.py - Python script for operating the focuser
   c. makeFilepatch.diff - diff file for focuser's makefile revisions
   d. quicktest - Directory containing a python test script to test that data gets read correctly to the correct serial port
3. power_web_switch - Contains driver(module) and operating script for the web-controlled power switch
   a. borat_power.py - Python script for operating the power switch
   b. Cred.txt - temporary cred file needed for operating the switch
   c. dli.py - Python driver/module that is called from borat_power.py
4. serial_card - Contains driver software for the MCS99xx serial port express card
5. teld - contains driver software for the telescope
   a. lx200gps.cpp - Driver software written in c++
6. udev_rules - ? contains some configuration for custom defined usb protocols(needs clarification)
   a. 40-rts2.rules - Configuration file

Software(~/Dev/borat/software)
1. db_bkups - contains database backups for observed stars(antiquated)
2. fan_control - contains operating script for fan controller
   a. control.py - Python script for operating fan controller
   b. rts2json.py - Required library for control.py
3. handy_scripts - Collection of useful scripts needed for control of main telescope operations
   a. borat_compile.sh - Shell script used to compile borat files(need clarification)
   b. dome.py - Python script for operating the dome
   c. tele_lx200_control.py - Python script for operating the telescope operations(park, sleep, recover, etc.)
4. internet_benchmark - Contains scripts for testing current internet speed for borat
   a. internet_test.sh - Simple shell script that does a ping test to trace internet speed
   b. plot.py - Plots internet speed log files
5. nagios - Contains files related to the Nagios monitoring system
   a. nagios.cfg - Main configuration file for the Nagios system
   b. observatory - Directory containing nagios system settings for the      observatory
      1)commands - contains notification and ssh command configuration files
        a)notifications.cfg - Configuration file for sending notifications to certain contacts 
        b)ssh_commands.cfg - Configuration file for defining different ssh commands(is_alive, is_alive_ssh, cpu_load_ssh, etc.)  
      2)contacts - contains a contacts config file that has contact information used by the system to send notifications and alerts
      3)hosts - contains config files for routers, computers, and other device host address and groups
      4)old - Contains config files for a router, ip_camera and server(maybe antiquated)
      5)services - contains a configuration file with the different defined services the nagios system provides
   c. pull_config.sh - Shell script that pulls the latest from the main config directory to the local directory(~/Dev/borat/software/nagios) 
   d. push_config.sh - Shell script that copies the latest local changes to nagios to the main config directory(~/Dev/borat/software/nagios) 
6. rts2_config - Contains device and initializing information for rts2
   a. devices - File that maps the connected devices to the file location in /dev
   b. rts2.ini - Example master config file for RTS2(see for more details)
7. rts2saf - Directory for autofocuser scripts and configuration files
   a. rts2saf.cfg - Configuration file for the autofocuser.
8. rts2_scripts - Contains scripts used by rts2 for common tasks
   a. flats - Directory containing python and shell scripts for taking sky flats
      1) borat_flat.py - example configuration for taking flats
         Note: This file directs developers to flats.py. Its location is (~/Dev/borat/software/rts2_scripts/flats/python/lib/flats.py) 
      2) deploy.sh - Shell script which copies borat_flat.py and flats.py to the main rts-2 scripts directory(/usr/src/rts-2/trunk/rts-2/scripts) 
      3) python - contains flats.py and flats_test.py
        a)flats.py - Python script for optaining twilight skyflats
        b)flats_test.py - Python script for testing customizable flats configurations 
   b. img_astrometry.py - Python script for comparing a fits file against astrometry.net
   c. imgp_analysis.py - Python wrapper script called by IMGP after exposure is completed.
   d. rough_focus.py - Python script 
   e. rts2-astrometry.net - Needs explanation 
9. rts2web - Directory for running rts2 web interface
10. time_lapse - Contains stitch.sh that stiches multiple fits into a time_lapse video