# set arcticSid = 65535 set predictedSid = 0 # main point is we do NOT want to count pings outside the given region # need lots of sig figs to keep surface from moaning gmtset D_FORMAT = %.16lg if ($#argv != 5) then echo "usage: `basename $0` bathymetryFile W E S N" echo " example: `basename $0` ../grd/w140n40.Bathymetry.grd -140 -100 -10 40" echo exit endif set ifile = $1; shift set w = $1; shift set e = $1; shift set s = $1; shift set n = $1; shift set opts = "$*" set stem = `basename -s .grd $ifile` # NOTE: grd must be PIXEL" # deal with csh nonsense of not groking plus sign (+21 must be 21) set w = `echo $w | awk '{ printf "%.16lg\n", $1 }'` set e = `echo $e | awk '{ printf "%.16lg\n", $1 }'` set s = `echo $s | awk '{ printf "%.16lg\n", $1 }'` set n = `echo $n | awk '{ printf "%.16lg\n", $1 }'` grdcut ../grd/$stem.sid.grd -G/tmp/$stem.cnt.grd \ -Rg$w/$e/$s/$n -fg -V \ >& /dev/null # Remove any pings where the sid of the predicted or arctic was used grdmath /tmp/$stem.cnt.grd $predictedSid NAN $arcticSid NAN \ = /tmp/$stem.hit.grd # how many are left??? grdinfo /tmp/$stem.hit.grd -L2 \ | grep "set to NaN" exit grdcut ../grd/$stem.Bathymetry.grd -G/tmp/$stem.cnt.grd \ -Rg$w/$e/$s/$n -fg -V \ >& /dev/null grdinfo /tmp/$stem.cnt.grd -L2 \ | grep NaN