#!/bin/csh

set input = 2015_Whittaker_Model.xyz
set region = -97/-67/0/20

# make grdfile
xyz2grd $input -R${region} -I.5/.5 -Gddp.grd

# make gradients
grdgradient ddp.grd -A0/270 -Gddp.gradients -Ne0.6

# make  color palette table
makecpt -I -Cbhw2_sunsetx -Z -T150/475/5 >! ddp.cpt

# plot the model
grdimage ddp.grd -P -K -R -Cddp.cpt -JX4.5i -Ei100  -Iddp.gradients -X1.5i -Y3.0i >! ddp_height.ps
grdcontour ddp.grd -JX -R -W.1/50/50/50 -C50 -P -S4 -O -K -A50f6t -G1.0i/20 -Djunk >> ddp_height.ps
pscoast -R -JX4.5d -Di -B5g1000f5nSeW -W1/4/0/0/0 -P -O -K -A12000 >> ddp_height.ps
psscale -D5.0i/2.25i/3.5i/.3i -O -K -Cddp.cpt -Iddp.gradients -B50:"D'' height":/:km: >> ddp_height.ps

# rm temporary files
#/bin/rm junk*.xyz ddp.grd ddp.cpt ddp.gradients

gs -sDEVICE=x11 ddp_height.ps

