#!/usr/bin/env bash
#

GSSCH="${HOME}/satnogs/sas"
GS=(431 2173 2176)
GSC=(1696)
LOGLEVEL="${1:-WARNING}"

echo "#-------------------------------------------------------------------------------"
echo "#"
echo "#  Running satnogs-auto-schedular: $(date)"
echo "#"

for ID in "${GS[@]}"
do
  if [ ! -z "${ID}" ]; then
    echo "#  Schedule Circular obs for Ground Station: ${ID}"
    echo "#"
    "${HOME}"/satnogs/virtenv/bin/python \
    "${GSSCH}"/schedule_single_station.py -s "${ID}" \
    -d 1.5 -f -P "${HOME}"/satnogs/etc/priority_"${ID}".txt \
    -r 20 -l "${LOGLEVEL}"
  else
    echo "#  No Circular Ground Stations"
    echo "#"
  fi
done

for ID in "${GSC[@]}"
do
  if [ ! -z "${ID}" ]; then
    echo "#  Schedule Cardinal point obs for Ground Station: ${ID}"
    echo "#"
    "${HOME}"/satnogs/virtenv/bin/python \
    "${GSSCH}"/schedule_single_station.py -s "${ID}" \
    -d 1.5 -f -P "${HOME}"/satnogs/etc/priority_"${ID}".txt \
    -r 45 -b 190 -e 350 -T -l "${LOGLEVEL}"
  else
    echo "#  No Cardinal Ground Stations"
    echo "#"
  fi
done

echo "#"
echo "#  Done running satnogs-auto-schedular: $(date)"
echo "#"
echo "#-------------------------------------------------------------------------------"

