#! /bin/csh

set dates = ( 1 2 3 4 )
set nu= ( 1 2 3 4 )
set dates[1]=
set nu[1]=104
set dates[2]=960125
set nu[2]=78
set dates[3]=951127
set nu[3]=130
set dates[4]=951004
set nu[4]=113


set j=3
foreach dirs ( nov2795 )
goto SKIPPED
set i=21
while ( $i <= $nu[$j] )
giftopnm -image ${i} ./bref1/BREF_${dates[$j]}.gif > radar.pnm
pnmcut 500 658 100 13 radar.pnm > date.pnm
pnmcut 262 212 379 318 radar.pnm > wfrnt.pnm
ppmtomap wfrnt.pnm > map.pnm
pnmscale -xysize 455 382 wfrnt.pnm > ewfrnt.pnm
pnmpaste date.pnm 5 1 ewfrnt.pnm > final.pnm
ppmquant -map map.pnm final.pnm | ppmtogif > ./bref2/bref${i}.gif
@ i = $i + 1
end
exit
SKIPPED:
set i=17
while ( $i <= $nu[$j] )
giftopnm -image ${i} ./vel1/VEL_${dates[$j]}.gif > radar.pnm
pnmcut 500 658 110 13 radar.pnm > date.pnm
pnmcut 262 212 379 318 radar.pnm > wfrnt.pnm
ppmtomap wfrnt.pnm > map.pnm
pnmscale -xysize 455 382 wfrnt.pnm > ewfrnt.pnm
pnmpaste date.pnm 5 1 ewfrnt.pnm > final.pnm
ppmquant -map map.pnm final.pnm | ppmtogif > ./vel2/vel${i}.gif
@ i = $i + 1
end
@ j = $j + 1
end




exit









#pnminvert cut.pnm > crop.pnm
#ppmtopgm crop.pnm > crop.pgm
#pgmtopbm crop.pgm > crop.pbm
#pbmtoascii crop.pbm > test${i}.txt

