#!/bin/csh # First draw network and label the nodes psxy table_5.11 -R0/7/0/7 -JX3.4/3.5 -B2f1WSNe -Sc0.05 -G0 -P -K -Y6.9 >! example_14.ps awk '{printf "%lg %s 6 0 0 5 %lg\n", $1+0.08, $2, $3}' table_5.11 | pstext -R -JX -O -K -N >> example_14.ps blockmean table_5.11 -R0/7/0/7 -I1 >! mean.xyz # Then draw blocmean cells rm -f tmp foreach x (0.5 1.5 2.5 3.5 4.5 5.5 6.5) (echo '> new line'; echo $x 0; echo $x 7) >>! tmp (echo '> new line'; echo 0 $x; echo 7 $x) >>! tmp end psxy -R -JX -B2f1eSNw -M tmp -W1ta -O -K -X3.6 >> example_14.ps psxy -R -JX -B2f1eSNw mean.xyz -Ss0.05 -G0 -O -K >> example_14.ps awk '{printf "%lg %s 6 0 0 5 %lg\n", $1+0.1, $2, $3}' mean.xyz | pstext -R -JX -O -K -W255o -C0.01/0.01 -N >> example_14.ps # Then surface and contour the data surface mean.xyz -R -I1 -Gdata.grd -V grdcontour data.grd -JX -B2f1WSne -C25 -A50 -G3/10 -S4 -O -K -X-3.6 -Y-3.9 -V >> example_14.ps psxy -R -JX mean.xyz -Ss0.05 -G0 -O -K >> example_14.ps # Fit bicubic trend to data and compare to gridded surface grdtrend data.grd -N10 -Ttrend.grd -V grdcontour trend.grd -JX -B2f1wSne -C25 -A50 -G3/10 -S4 -O -K -X3.6 >> example_14.ps project -C0/0 -E7/7 -G0.1 >! track psxy -R -JX track -W4to -O -K >> example_14.ps # Sample along diagonal grdtrack track -Gdata.grd | cut -f3,4 >! data.d grdtrack track -Gtrend.grd | cut -f3,4 >! trend.d psxy `minmax data.d trend.d -I0.5/25` -JX7/1.5 data.d -W4 -O -K -X-3.6 -Y-2 -B1/50WSne >> example_14.ps psxy -R -JX trend.d -W2ta -O -U"Example 14 in Cookbook" >> example_14.ps \rm mean.xyz track tmp *.grd *.d .gmtcommands