#!/bin/bash
file=${1-tmp}
#
# convert data in $file.dat to gridded representation using GMT nearneighbor
#
reg=-R-45/45/-45/45		# region
proj=-JH0/7			# projection for plotting
inc=-I1			# resolution of grid file


# grid using nearneighbor
nearneighbor -N4 -S1500K  $file.data $reg $inc -G$file.nn.grd > /dev/null

# reuse colormap from _surface!

s=nn

grdimage -Y0 -K $file.$s.grd -C$file.cpt $reg $proj -Ba45f5WeSn:."$s": > $file.$s.ps
psxy $file.data -Sc0.02 -G0 -O $reg $proj  >> $file.$s.ps
