I’ve obtained terrain data from the remote dataset earth relief. However the area of interest contains an artifact anomaly. I have removed the anomalous heights with NaN values. My code and graphics are below. What module do I use to replace the NaN values with interpolated values? I don’t want to modify the remaining valid heights at all.
gmt begin Artifact png
gmt makecpt -Cjet -T4000/5000
gmt subplot begin 2x1 -Ff20c/20c -B+n
:: Image 1 - SRTM data with Artifact
gmt subplot set 0,0
gmt grdview @earth_relief_03s.grd -R137:11:00/137:11:48/-4:05:24/-4:04:36 -JM -p330/30 -Qs -JZ10c
gmt grd2xyz @earth_relief_03s.grd > artifact-03s.csv
:: @pause
:: Manually replace Artifact heights with NaN and save as 'artifact-removed-03s.csv'
:: Image 2 - SRTM data with Artifact Removed
gmt subplot set 1,0
gmt xyz2grd artifact-removed-03s.csv -Gartifact-removed-03s.grd -I03s
gmt grdview artifact-removed-03s.grd -JM -p330/30 -Qs -JZ10c
gmt subplot end
gmt end show
Thanks Esteban, that’s exactly what I was after. I’m a little embarrassed as I had been looking in all the wrong places. Thanks for pointing me in the right direction.
For the benefit of anyone else that might be going down the same path, here’s what the two options (nearest neighbor and bicubic spline) look like: