Hi,
after reading the man page for the -s option of grdtrack, I wonder if the behavior generated by the script below is really the intention - I might be confused here, so sorry if this is dumb.
If I have two columns on input, -s does what it should, remove the NaN output. If I have three input columns, then I would have expected -s to operate on the last, i.e. the interpolated, new, 4th value, instead (consistent with the man pages, but not clear about the logic there to me), it lets NaNs through, unless I use -s3. But why 3? that’s the input column, which isn’t NaN, and I guess I’m not sure where to start counting. Seems like a feature, but maybe a confusing one?
Thanks!
T
Script:
#!/bin/bash
cat <<EOF | xyz2grd -R0/1/0/1 -I1 -Gtmp.grd
0 0 1
0 1 NaN
1 0 NaN
1 1 1
EOF
echo original grid
grd2xyz tmp.grd
sup=-s
echo grdtrack two columns NaN suppressed -s
cat <<EOF | grdtrack -Gtmp.grd -s
0 0
0 1
1 0
1 1
EOF
echo
for sup in -s -s2 -s3 -s4;do
echo grdtrack three columns NaN suppressed $sup
cat <<EOF | grdtrack -Gtmp.grd $sup
0 0 0
0 1 0
1 0 0
1 1 0
EOF
done
Output:
./test_nan
original grid
0 1 NaN
1 1 1
0 0 1
1 0 NaN
grdtrack two columns NaN suppressed -s
0 0 1
1 1 1
grdtrack three columns NaN suppressed -s
0 0 0 1
0 1 0 NaN
1 0 0 NaN
1 1 0 1
grdtrack three columns NaN suppressed -s2
0 0 0 1
0 1 0 NaN
1 0 0 NaN
1 1 0 1
grdtrack three columns NaN suppressed -s3
0 0 0 1
1 1 0 1
grdtrack three columns NaN suppressed -s4
0 0 0 1
0 1 0 NaN
1 0 0 NaN
1 1 0 1