head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	93.05.18.18.21.58;	author craig;	state Exp;
branches;
next	;


desc
@script to get the latest tle files from archive.afit.af.mil
run sunsat, and output a list of epheremuses and plots
@


1.1
log
@Initial revision
@
text
@#! /bin/csh
#
# get the daily two line element files
#

cd ~/space/sat/tle

rm -f errfile

set GMT=`date -u +%d%h%y`
set DAY=`date -u +%d`
set MON=`date -u +%m`
set YEAR=`date -u +19%y`

/usr/local/bin/ncftp  << E_O_F >&errfile
  set verbose -1
  set progress-reports 0
  open -r -g 15 archive.afit.af.mil
  cd pub/space
  mget *.tle
  get tle.new
  quit
E_O_F

if (-e tle.new) then
    grep -v Current tle.new > last.tle
    rm tle.new
endif

# now run sunsat on the tle files

sunsat $DAY $MON $YEAR visual.tle >& sunsatlog.$GMT
sunsat $DAY $MON $YEAR tvro.tle >>& sunsatlog.$GMT
sunsat $DAY $MON $YEAR other.tle >>& sunsatlog.$GMT
sunsat $DAY $MON $YEAR last.tle >>& sunsatlog.$GMT

# mail the log to me

if (!(-z sunsatlog.$GMT)) then
    Mail -s "sunsat results" craig < sunsatlog.$GMT
endif

# generate and print the plots

if (!(-z sunplot)) then
    plotgen sunplot plottmp
endif

if (-e plottmp.000) then
    gnuplot plottmp.drv
endif

rm -f sunplot plottmp.*

exit
@
