#!/usr/bin/ksh
#
# overplot_reprocess.ksh 
#
#  Overplot reprocessing is somewhat unreliable.  This script splits into day length runs and logs progress
# 
#

THMSOC=/disks/socware/thmsoc_dp_current
THEMISDATA="/disks/themisdata"
LOGDIR="${THEMISDATA}/process_logs"
PROCESSDATE=$(date '+%y%m%d')
LOGFILE=${LOGDIR}/overplots/reprocess_over_${PROCESSDATE}_$$

sdate="2007-02-16"
ssec=$(date --date="$sdate UTC" -u +%s)

((days = 1300))
((day = 0))
while ((day < days))
do
  ((secs = ssec+day*60*60*24))
  date=$(date --date="1970-01-01 UTC $secs seconds" -u +%Y-%m-%d)
  $THMSOC/src/ksh/overplot.ksh -d $date -n 1
  echo $date >> $LOGFILE
  ((day = day+1))
done


