#!/bin/sh

rm .gmtdefaults
gmtset BASEMAP_AXES WeSn
gmtset DEGREE_FORMAT 3
gmtset BASEMAP_TYPE PLAIN
gmtset COLOR_NAN 255/255/255
gmtset COLOR_FOREGROUND 255/255/255
gmtset COLOR_BACKGROUND 0/0/0
gmtset ANOT_FONT_SIZE 10
gmtset HEADER_FONT_SIZE 12

MAP_PROJ="m.45"
SHIFT=" -X1. -Y2.0"
BOX="-78/-65/-71/-65"
FILE="/fal10/mb/grids/surface_12/surface_12_2_C0_topo30_T25.surface"
GRAD="surface_12_4_C5_topo30_hist_grad.grd"

#   create shaded relief information
#
#grdhisteq -V -N $FILE -Gsurface_12_4_C5_topo30_hist.grd
#grdgradient -V -A0 -Nt surface_12_4_C5_topo30_hist.grd -G$GRAD

rm shaded.ps

#  make color scale
#
makecpt -Crainbow -T-4500/0/25 -V  > contour.cpt

#  plot color image
#
grdimage -R$BOX -J$MAP_PROJ \
     $FILE -I$GRAD \
     -Ccontour.cpt \
     $SHIFT -V -K -P > shaded.ps

#  plot color bar
#          
psscale -Ccontour.cpt -B250:"Topograhpy (meters)": \
     -D3.0/-0.8/6.0/.25h -E -V -O -K >> shaded.ps

#  label key islands in area
#
pstext -R -Jm -N -V -K -O <<EOF>> shaded.ps
 -75.15 -69.90 12   0.0  7 MC Charcot Island
 -70.00 -69.75 12 290.0  7 MC Alexander Island
 -68.40 -67.20 12  70.0  7 MC Adelaide Island
 -73.50 -69.50 12   0.0  7 BL Rothschild Island
EOF

#  Add the SCAR ice extent line
#
psxy -R$BOX -J$MAP_PROJ -M /fal10/mb/BAS/SCAR_ice.psxy \
   -W3/0/0/255 \
   -V -O -K >> shaded.ps

#  Add the SCAR coast line
#  Add lat & long labels and title to plot
#
psxy -R$BOX -J$MAP_PROJ -M /fal10/mb/BAS/SCAR_coast.psxy \
 -W3 \
 -Ba1g1f2/a1g1f2:."SO GLOBEC Bathymetry":WeSn \
     -V -O -U/0/-0.5/"by Tom Bolmer" >> shaded.ps

#  view the figure
#     
gs shaded.ps
