#! /bin/csh -f


set dir1 = /Users/jjbecker/Desktop/SRTM15+V7/grd
set dir2 = /Volumes/DEM_Copy_2/jj\ original\ from\ Speedy\ Chef/Desktop/SRTM15+/SRTM15+V7/grd
set fileType = grd

echo "$dir1/*.$fileType"
echo "$dir2/*.$fileType"

foreach file1 (`ls $dir1/*.$fileType`)
	set stem = `basename $file1`
#	echo $stem
	grdmath $dir1/$stem $dir1/$stem SUB = /tmp/$stem.diff.grd
	grdinfo /tmp/$stem.diff.grd | grep z_min
end

exit

#	if(`head -1 $i | awk '{ printf "%05d\n", $7 }' | grep -f - $badlist | wc -l` > 0) then
	if(0 == 0) then
		grdmath $file /Users/jbecker/Desktop/bak/grd/$stem SUB = ./foo.grd
	else
	endif
exit
end

exit

bin2grd e020n40.Bathymetry.srtm  020  060 -10  40
bin2grd e020n90.Bathymetry.srtm  020  060  40  90
bin2grd e020s10.Bathymetry.srtm  020  060 -60 -10
bin2grd e060n40.Bathymetry.srtm  060  100 -10  40
bin2grd e060n90.Bathymetry.srtm  060  100  40  90
bin2grd e060s10.Bathymetry.srtm  060  100 -60 -10
bin2grd e100n40.Bathymetry.srtm  100  140 -10  40
bin2grd e100n90.Bathymetry.srtm  100  140  40  90
bin2grd e100s10.Bathymetry.srtm  100  140 -60 -10
bin2grd e140n40.Bathymetry.srtm  140  180 -10  40
bin2grd e140n90.Bathymetry.srtm  140  180  40  90
bin2grd e140s10.Bathymetry.srtm  140  180 -60 -10
bin2grd w020n40.Bathymetry.srtm -020  020 -10  40
bin2grd w020n90.Bathymetry.srtm -020  020  40  90
bin2grd w020s10.Bathymetry.srtm -020  020 -60 -10
bin2grd w060n40.Bathymetry.srtm -060 -020 -10  40
bin2grd w060n90.Bathymetry.srtm -060 -020  40  90
bin2grd w060s10.Bathymetry.srtm -060 -020 -60 -10
bin2grd w100n40.Bathymetry.srtm -100 -060 -10  40
bin2grd w100n90.Bathymetry.srtm -100 -060  40  90
bin2grd w100s10.Bathymetry.srtm -100 -060 -60 -10
bin2grd w140n40.Bathymetry.srtm -140 -100 -10  40
bin2grd w140n90.Bathymetry.srtm -140 -100  40  90
bin2grd w140s10.Bathymetry.srtm -140 -100 -60 -10
bin2grd w180n40.Bathymetry.srtm -180 -140 -10  40
bin2grd w180n90.Bathymetry.srtm -180 -140  40  90
bin2grd w180s10.Bathymetry.srtm -180 -140 -60 -10
bin2grd w180s60.Bathymetry.srtm -180 -120 -90 -60
bin2grd w120s60.Bathymetry.srtm -120 -060 -90 -60
bin2grd w060s60.Bathymetry.srtm -060  000 -90 -60
bin2grd w000s60.Bathymetry.srtm  000  060 -90 -60
bin2grd e060s60.Bathymetry.srtm  060  120 -90 -60
bin2grd e120s60.Bathymetry.srtm  120  180 -90 -60

exit

