#! /bin/csh 

set i = 0
set files=`ls ../vel1/*.gif`
foreach filed ( $files )
echo $filed
@ i = $i + 1
set day=`echo $filed | cut -c9-14`
set hour=`echo $filed | cut -c15-16`
set min=`echo $filed | cut -c17-18`
set dates=`leg.pl 7 ${day} ${hour} ${min} F000`
pbmtext $dates > title.pbm
#ppmquant -map mapt.tbl title.pbm > title.pnm
pnminvert title.pbm > title.pnm

giftopnm ${filed} > radar.pnm
#pnmcut 332 661 240 11 radar.pnm > date.pnm
pnmcut 262 212 379 318 radar.pnm > wfrnt.pnm
#pnmpaste title.pnm 1 1 wfrnt.pnm > ewfrnt.pnm
ppmtomap wfrnt.pnm > map.pnm
pnmscale -xysize 455 382 wfrnt.pnm > ewfrnt.pnm
pnmpaste title.pnm 1 1 ewfrnt.pnm > final.pnm
ppmquant -map map.pnm final.pnm | ppmtogif > vel${i}.gif
#rm *.pnm
end
exit

