#!/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"

rm contour.ps

#  create a basemap to work on
#     
psbasemap -B -R$BOX -J$MAP_PROJ \
     $SHIFT -V -K -P > contour.ps
#
# contour every all 100 meters
#
#psxy -R$BOX -J$MAP_PROJ \
#    con*.xyz -M -W2/0/0/0 \
#    -V -K -O >> contour.ps

#contour selected intervals
#
cat con0200.xyz con0500.xyz con1000.xyz con1500.xyz \
    con2000.xyz con2500.xyz con3000.xyz con3500.xyz | \
psxy -R$BOX -J$MAP_PROJ \
    -M -W2/0/0/0 \
    -V -K -O >> contour.ps

#  label key islands in area
#
pstext -R -Jm -G255/0/0 -N -V -K -O <<EOF>> contour.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 >> contour.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/0/255/0 \
 -Ba1g1f2/a1g1f2:."SO GLOBEC Bathymetry from contours":WeSn \
     -V -O -U/0/-0.5/"by Tom Bolmer" >> contour.ps

#  view the figure
#          
gs contour.ps
