#!/bin/bash

echo "Starting xpaccd and user interface."
echo


# Optionally ill any stale camera processes

#killall -9 ccd_monitor.sh  1>/dev/null 2>/dev/null
killall -9 xpaccd          1>/dev/null 2>/dev/null
killall -9 xmccd           1>/dev/null 2>/dev/null
#killall -9 xmccd1          1>/dev/null 2>/dev/null
killall -9 ds9             1>/dev/null 2>/dev/null
sleep 1

# Work in tonight

cd /home/john/data/tonight


# Start the camera xpa server 

xpaccd 1>/usr/local/observatory/logs/xpaccd.log 2>/usr/local/observatory/logs/xpaccd_error.log &

sleep 10


# Start the ccd image file monitor

#ccd_monitor.sh 1>/dev/null 2>/dev/null & 


# Start the user interface

xmccd &
sleep 10

# Set ds9 preferences

xpaset -p ds9 preserve scale yes
xpaset -p ds9 preserve pan yes
xpaset -p ds9 preserve regions yes
xpaset -p ds9 colorbar no
xpaset -p ds9 regions centroid radius 40

# Set ds9 for N up W right telescope pointing east

xpaset -p ds9 orient x
xpaset -p ds9 rotate 180






