#!/bin/sh # # drft06rr_boxmap - Make the map for a single box # # Make a map of a particular box area, given the box id as argument # If map exists, you must pass -f as 2nd arg to force plotting. # # Paul Wessel, 15-NOV-2001 # box=$1 prefix="drft06rr" PLOT="drft06rr.box$box.map" DIR=drft06rr/boxes if [ $# -eq 1 ] && [ -f $DIR/$PLOT.jpg ]; then echo "drft06rr_boxmap: Map $box already exists, use -f to force a new map" >&2 exit fi # Get the region for this box in $R R=`grep ^$box drft06rr_boxes.lis | awk '{printf "%lg/%lg/%lg/%lg\n", $2, $3, $4, $5}'` width=6.5 gmtset ANOT_FONT_SIZE +12p HEADER_OFFSET 0.2i PAPER_MEDIA letter #------------------------------------------------------- # Need the height of the map, the average latitude, and a few other dimensions: height=`grep ^$box drft06rr_boxes.lis | awk '{print $3, $5}' | mapproject -R$R -JM$width | awk '{print $2}'` lats=`grep ^$box drft06rr_boxes.lis | awk '{print 0.5 * ($4 + $5)}'` x0=`gmtmath -Q $width 0.5 MUL =` ys=`gmtmath -Q $height 0.4 SUB =` L=`gmtmath -Q $width 1 SUB =` # Pick rainbow color table makecpt -Crainbow -T-6000/0/500 -Z > $prefix.cpt psxy -R$R -JM$width -K /dev/null -Y2.6 -X1 -P > $PLOT.ps # Lay down the background course image grdimage -R -JM data/$prefix.grd -Idata/$prefix.int.grd -C$prefix.cpt -Ei -O -K >> $PLOT.ps if [ $box = F ] || [ $box = G ]; then # Use existing seabeam data for Easter area grdimage -R -JM -Idata/easter.grd.new.int.grd data/easter.grd.new -C$prefix.cpt -O -K >> $PLOT.ps fi if [ -f gridding/grids/drft06rr.box$box.mb+ss.0.003.grd ]; then # overlay new data if available yet grdimage -R -JM gridding/grids/drft06rr.box$box.mb+ss.0.003.grd -Igridding/grids/drft06rr.box$box.mb+ss.0.003.int.grd -C$prefix.cpt -O -K >> $PLOT.ps fi # Overlay coastlines and lots of symbols and lines: pscoast -R$R -JM -Dh -G100 -O -K -W0.25p >> $PLOT.ps psxy -R -JM $GMT_DATADIR/plate_boundaries_1996.d -M -O -K -W1p >> $PLOT.ps echo "282.95 -12.10" > lima.d psxy -R -JM -O -K -Sc0.15 -G0/255/0 -W0.25p lima.d >> $PLOT.ps psxy -R -JM 200nm_line.d -O -K -W2p/255/100/0 >> $PLOT.ps grep -v '^#' drft06rr_smts.lis | awk '{if ($2 == "'$box'") printf ">\n%s\t%s\n%s\t%s\n%s\t%s\n%s\t%s\n", $3, $5, $4, $5, $4, $6, $3, $6}' | psxy -R -JM -O -K -M -L -W0.75p/255/0/0 >> $PLOT.ps grep -v '^#' drft06rr_smts.lis | awk '{if ($2 == "'$box'") printf "%s %s 7 0 0 TL %s\n", $4, $5, $1}' | pstext -R -JM -O -K -N -Wo0.5p/255/0/0 -G255/0/0 -C0.015/0.015 -D0.015/-0.015 >> $PLOT.ps psxy -R -JM -O -K -Sc0.1 -W0.25p -G255 -H Bonatti_rocks.d misc_rocks.d Hydros_rocks.d Clark_and_Dymond_rocks.d glor07mv_no_rocks.d glor07mv_rocks.d Oconnor_rocks.d >> $PLOT.ps psxy -R -JM waypts.d -O -K -W1p/255/255/0 >> $PLOT.ps psxy -R -JM waypts.d -O -K -Sc0.175 -W0.25p/255/0/0 >> $PLOT.ps grep -v '#' waypts.d | awk '{print $1, $2, 10, 0, 1, "CM", $3}' | pstext -R -JM -O -K >> $PLOT.ps psxy -R -JM -O -K -St0.125i -G100/255/255 -W0.25p Bonatti_dates.d -H >> $PLOT.ps psxy Oconnor_dates.d -H -R -JM -O -K -St0.125i -G255/0/255 -W0.25p >> $PLOT.ps psxy glor07mv_dates.d -H -R -JM -O -K -St0.125i -G255 -W0.25p -B1g1f10m >> $PLOT.ps awk '{printf "%s %s 9 0 0 LM %s Ma\n", $1, $2, $3}' Bonatti_dates.d | pstext -H -R -JM -O -K -W255o0.25p -C0.02/0.02 -D0.2/0 >> $PLOT.ps awk '{printf "%s %s 9 0 0 LM %s Ma\n", $1, $2, $3}' Oconnor_dates.d | pstext -H -R -JM -O -K -W255o0.25p -C0.02/0.02 -D0.2/0 >> $PLOT.ps awk '{printf "%s %s 9 0 0 LM %s Ma\n", $1, $2, $3}' glor07mv_dates.d | pstext -H -R -JM -O -K -W255o0.25p -C0.02/0.02 -D0.2/0 >> $PLOT.ps echo "0 0 16 0 0 LB $box" | pstext -R0/$width/0/$height -Jx1 -O -K -G255/0/0 -D0.075/0.075 -W255o0.5p>> $PLOT.ps echo "0.85 $ys 1.5 0.65" | psxy -R0/$width/0/$height -Jx1 -O -K -Sr -G255 -W0.25p >> $PLOT.ps psbasemap -R$R -JM -O -K -Lfx0.8/$ys/$lats/100k >> $PLOT.ps # Plot Easter and Salas y Gomez locations echo "105:21.96W 26:28.44S" | psxy -R -JM -O -K -Sa0.2 -G255/255/0 -W0.25p >> $PLOT.ps echo "109:22.50W 27:07.02S" | psxy -R -JM -O -K -Sa0.2 -G255/0/0 -W0.25p >> $PLOT.ps psxy -R0/6/0/2 -Jx1 -O -K /dev/null -Y-2.3 >> $PLOT.ps # Add a map legend below the plot pslegend -R -Jx -O -K -Dx0/2/6.5/1.7/TL -F -G255 << EOF >> $PLOT.ps G -0.05i H 18 5 MAP LEGEND D 0.25 1p N 2 S 0.2 t 0.15i 255/0/255 0.25p 0.5 Dated samples from O\`Conner S 0.2 t 0.15i 255/255/255 0.25p 0.5 Dated samples from Gloria07mv S 0.2 t 0.15i 100/255/255 0.25p 0.5 Dated samples from Bonatti S 0.2 c 0.15i 255/255/255 0.25p 0.5 Published dredge locations S 0.2 a 0.15i 255/255/0 0.25p 0.5 Salas y Gomez Island S 0.2 a 0.15i 255/0/0 0.25p 0.5 Easter Island G 0.5 EOF psscale -C$prefix.cpt -D$x0/0.8/$L/0.2h -O -B/:m: >> $PLOT.ps rm $prefix.cpt lima.d # Create images, PDF, and EPS files: convert -density 100x100 -page 1000x1000 -crop 0x0 $PLOT.ps $DIR/$PLOT.jpg convert -density 300x300 -page 1000x1000 -crop 0x0 $PLOT.ps $DIR/$PLOT.hires.jpg ps2pdf $PLOT.ps $DIR/$PLOT.pdf ps2eps $PLOT.ps mv $PLOT.eps $DIR rm -f $PLOT.ps