#!/bin/sh # # drft06rr_smtmap - Make a high-res map for one seamount target # # usage: drft06rr_smtmap [-f] # # Paul Wessel, 20-NOV-2001 if [ $# -eq 0 ]; then echo "usage: drft06rr_smtmap SMTID [-f]" >&2 exit fi prefix=drft06rr DIR=$prefix/smts SMT=$1 PLOT=$prefix.smt$SMT.map if [ $# -eq 1 ] && [ -f $DIR/$PLOT.jpg ]; then echo "drft06rr_smtmap: Map already exists, use -f to force a new map" >&2 exit fi # Dtermine which box this seamount is inside box=`echo $SMT | awk '{if ($1 == "'$SMT'") print $2}' drft06rr_smts.lis` if [ "X$box" = "X" ]; then echo "drft06rr_smtmap: Seamount $SMT not registered yet" >&2 exit fi echo "drft06rr_smtmap: Working on Seamount $SMT" >&2 # Get the region for this seamount target: R=`echo $SMT | awk '{if ($1 == "'$SMT'") printf "-R%s/%s/%s/%s\n", $3, $4, $5, $6}' drft06rr_smts.lis` W=6i makecpt -Crainbow -T-6000/0/500 -Z > t.cpt grdimage $R -JM$W -Ct.cpt gridding/grids/drft06rr.box$box.mb+ss.0.001.grd -Igridding/grids/drft06rr.box$box.mb+ss.0.001.int.grd -P -Ba10mg5mWSne -K -Y1.5 > $PLOT.ps if [ `ls -l $PLOT.ps | awk '{print $5}'` -eq 0 ]; then echo "drft06rr_smtmap: Cannot make map yet for Seamount $SMT" >&2 rm -f $PLOT.ps exit fi # Loop over all dredges inside this target and draw the trace + add the ID tag: for ID in `awk '{ if ($2 == "'$SMT'") print $1}' drft06rr_dredges.lis`; do # For each dredge, get average location, plot dredge line, and plot dredge ID in middle if [ ! -f dredges/$ID.xyt ]; then echo "dredges/$ID.xyt not available yet, skipped" continue; fi key=`awk '{if ($1 == "'$ID'") print $NF}' drft06rr_dredges.lis` gmtmath dredges/$ID.xyt -f0x,1y,2T -S MEAN = tmp lon=`cut -f1 tmp` lat=`cut -f2 tmp` psxy -R -JM -O -K -Sc0.025 -G0 dredges/$ID.xyt -f0x,1y,2T >> $PLOT.ps if [ "X$key" = "XD" ]; then # Dredge with datable samples echo $lon $lat $ID | awk '{printf "%s %s 9 0 0 CM %s\n", $1, $2, $3}' | pstext -R -JM -O -K -C0.02/0.02 -W255/0/0o0.5p >> $PLOT.ps else echo $lon $lat $ID | awk '{printf "%s %s 9 0 0 CM %s\n", $1, $2, $3}' | pstext -R -JM -O -K -C0.02/0.02 -W220/180/0o0.5p >> $PLOT.ps fi done psscale -D3/-0.4/$W/0.1ih -Ct.cpt -O -B/:m: >> $PLOT.ps convert -density 100x100 -page 1000x1000 -crop 0x0 $PLOT.ps $DIR/$PLOT.jpg convert -density 600x600 -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 t.cpt tmp