#! /bin/csh -f # gmtset D_FORMAT = %.16lg if ($#argv < 7) then echo "usage: `basename $0` xyzFile grd W E S N incInSec opts" echo " example: `basename $0` ../w140n40.xyzi foo.grd -141 -99 -11 41 30 -T0.35 -bid" echo " don't forget to have a 1 deg pad" echo echo " increment must be numerical seconds!!! i.e. 75 -NOT- 1.25m" echo exit endif # make predicted grid (surface at full res grid) set ifile = $1; shift set ofile = $1; shift set w = $1; shift set e = $1; shift set s = $1; shift set n = $1; shift set incInSec = $1; shift set opts = "$*" 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 }'` # Have to fiddle around to get pixel output from surface. # This is more subtle than it looks; the "surfaceRegion" # is a hacked version of "region", and we have to "toggle" # the header to pixel, but don't touch data. # # NOTE: surface only reads first 3 columns of data set inc = `echo $incInSec | awk '{ printf "-I%sc\n", $1 }'` set surfaceRegion = `csh -x jjSurfaceRegion_wrapper \ $w $e $s $n $incInSec $incInSec` echo "jjSurface: surface $ifile -G$ofile $surfaceRegion $inc -fg -V $opts" surface $ifile -G$ofile \ $surfaceRegion $inc -fg -V \ $opts grdinfo $ofile cp $ofile $ofile.node.grd grdedit -V $ofile -T grdinfo $ofile # as you might expect from this sort of hackery, # the region ends up slightly tweaked.... # have grdedit patch up the -R and -I parameters grdedit -V $ofile -R/$w/$e/$s/$n