#!/bin/sh
#
# get-satpics:
#
# Copyright (c) 2000 Chris Lightfoot. All rights reserved.
#
# $Id: get-satpics,v 1.1 2000/05/01 14:03:27 chris Exp chris $
#
# $Log: get-satpics,v $
# Revision 1.1  2000/05/01 14:03:27  chris
# Initial revision
#
#

B=../../tools

progname='get-satpics'
urlbase='http://www.sat.dundee.ac.uk'

export http_proxy=http://10.32.76.1:81/

for i in AI EI JI WI XI; do
  if [ ! -f $i.jpg ]; then
  wget -O $i.jpg http://www.sat.dundee.ac.uk/pdus/$i/latest.jpg
  fi
  if [ ! -f $i.pgm ]; then
  djpeg $i.jpg | pnmscale -width 2048 -height 2048 > $i.pgm
  fi
  if [ ! -f $i.pc.pgm ]; then
  $B/satcamtopc $i.pgm > $i.pc.pgm
  fi
done

if [ ! -f W.pgm ]; then
  pbmmake -white 2048 1024 | pnmscale 1.0 > W.pgm
fi

$B/mergesats AI.pc.pgm W.pgm W.pgm W.pgm W.pgm > At.pgm
$B/mergesats W.pgm EI.pc.pgm W.pgm W.pgm W.pgm > Et.pgm
$B/mergesats W.pgm W.pgm JI.pc.pgm W.pgm W.pgm > Jt.pgm
$B/mergesats W.pgm W.pgm W.pgm WI.pc.pgm W.pgm > Wt.pgm
$B/mergesats W.pgm W.pgm W.pgm W.pgm XI.pc.pgm > Xt.pgm
