#! /bin/csh 

foreach dirs ( may0297 )
set i = 0
set files=`ls *wfrnt.gif`

set xa=263
set ya=111
set xb=813
set yb=481

@ xc = $xb - $xa
@ yc = $yb - $ya 

foreach filed ( $files )
@ i = $i + 1
set day=`echo ${filed} | cut -c1-6`
set hour=`echo ${filed} | cut -c7-8`
set minu=`echo ${filed} | cut -c9-10`
echo $day $hour $minu
set dates=`leg.pl 7 ${day} ${hour} ${minu} F00`
set title=`echo ${dates}`

pbmtext -font /usr/openwin/share/src/fonts/100dpi/luBS10.bdf $title > tmp.pbm
pbmtopgm 1 1 tmp.pbm > tmp.pgm
pgmtoppm -map ~sfhalvor/bin/map.tbl tmp.pgm > tmp.ppm 
giftopnm ${filed} > wfrnt.pnm
#pnmcut 140 154 590 575 wfrnt.pnm > ewfrnt.pnm
pnmcut $xa $ya $xc $yc wfrnt.pnm > ewfrnt.pnm
pnmpaste tmp.ppm 1 1 ewfrnt.pnm > final.pnm
ppmtogif final.pnm > wfrnt${i}.gif
rm *.pbm 
rm *.pnm *.ppm
end
end
exit

