# DIM_CONTROL: Crab tracking and data taking
.! echo
.! echo `date -u`  "----------------------------------------------------" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.! echo `date -u`  "Data taking and tracking script for Crab starting up... " >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.! echo `date -u`  "----------------------------------------------------" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log

# changing tracking to Crab Wobble 1
.! echo `date -u`  "moving telescope to wobble position 1" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.! echo `date -u`  "...waiting for drivectrl to be ready to move" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.s DRIVE_CONTROL 5
.w 5000
DRIVE_CONTROL/TRACK_SOURCE 0.6 50 Crab
.! echo `date -u`  "...sent tracking command" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log

# Wait for drivectrl to repley that its tracking the given source
.s DRIVE_CONTROL 6
.! echo `date -u`  "...moving" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.s DRIVE_CONTROL 7
.! echo `date -u`  "...tracking above written wobble position" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.! echo `date -u`  "...waiting 30 sec for drive to calm downe" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.! echo
.w 30000

# starting data taking of Crab Wobble 1
.x ScriptsForDimCtrl/IsReadyForDataTaking
.! echo `date -u` "...now I would take data...waiting 6 sec " >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.w 6000

# Stop tracking
.w 3000
DRIVE_CONTROL/STOP
.s DRIVE_CONTROL 5
.! echo
.! echo `date -u` "...stopped tracking of above wobble position" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.! echo `date -u` "----------------------------------------------------" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.! echo

# changing tracking to Crab Wobble 2
.! echo
.! echo `date -u`  "Moving telescope to wobble Position 2" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.! echo `date -u`  "...waiting for drivectrl to be ready to move" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.s DRIVE_CONTROL 5
.w 5000
DRIVE_CONTROL/TRACK_SOURCE 0.6 -130 Crab
.! echo `date -u`  "...sent tracking command" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log

# Wait for drivectrl to reply that its tracking the given source
.s DRIVE_CONTROL 6
.! echo `date -u`  "...moving" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.s DRIVE_CONTROL 7
.! echo `date -u`  "...tracking above written wobble position" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.! echo `date -u`  "...waiting 30 sec for drive to calm downe" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.! echo
.w 30000

# data taking to Crab Wobble 2
.x ScriptsForDimCtrl/IsReadyForDataTaking
.! echo `date -u` "...now I would take data...waiting 6 sec " >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.w 6000

# Stop tracking
.w 3000
DRIVE_CONTROL/STOP
.s DRIVE_CONTROL 5
.! echo
.! echo `date -u` "...stopped tracking of Crab at above wobble position" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.! echo `date -u` "----------------------------------------------------" >> ~/FACT++/ScriptsForDimCtrl/DataTaking.log
.! echo

