#!/bin/bash # ASSUMES GMT 5 PARFILE=$1 TRAXIS=$2 MASKOUT=$3 source $PARFILE ln -s /radar3/flex/age/age_mask/${TRAXIS} traxis.xy gmt gmtselect traxis.xy $RLBOUNDS > age_mask_ll.xy case "$MASKOUT" in # assumes trench axis is running WEST to EAST N) echo "Masking out to the NORTH of the trench" tail -n1 age_mask_ll.xy | awk -v LON="$ELON" '{print $1,$LON}' >> age_mask_ll.xy echo "${ELON} ${NLAT}" >> age_mask_ll.xy echo "${WLON} ${NLAT}" >> age_mask_ll.xy head -n1 age_mask_ll.xy | awk -v LON="$WLON" '{print $1,$LON}' >> age_mask_ll.xy head -n1 age_mask_ll.xy >> age_mask_ll.xy ;; # assumes trench axis is running NORTH to SOUTH E) echo "Masking out to the EAST of the trench" tail -n1 age_mask_ll.xy | awk -v LAT="$SLAT" '{print $LAT,$2}' >> age_mask_ll.xy echo "${ELON} ${SLAT}" >> age_mask_ll.xy echo "${ELON} ${NLAT}" >> age_mask_ll.xy head -n1 age_mask_ll.xy | awk -v LAT="$NLAT" '{print $LAT,$2}' >> age_mask_ll.xy head -n1 age_mask_ll.xy >> age_mask_ll.xy ;; # assumes trench axis is running EAST to WEST S) echo "Masking out to the SOUTH of the trench" tail -n1 age_mask_ll.xy | awk -v LON="$WLON" '{print $1,$LON}' >> age_mask_ll.xy echo "${WLON} ${SLAT}" >> age_mask_ll.xy echo "${ELON} ${SLAT}" >> age_mask_ll.xy head -n1 age_mask_ll.xy | awk -v LON="$ELON" '{print $1,$LON}' >> age_mask_ll.xy head -n1 age_mask_ll.xy >> age_mask_ll.xy ;; # assumes trench axis is running SOUTH to NORTH W) echo "Masking out to the WEST of the trench" tail -n1 age_mask_ll.xy | awk -v LAT="$NLAT" '{print $LAT,$2}' >> age_mask_ll.xy echo "${WLON} ${NLAT}" >> age_mask_ll.xy echo "${WLON} ${SLAT}" >> age_mask_ll.xy head -n1 age_mask_ll.xy | awk -v LAT="$SLAT" '{print $LAT,$2}' >> age_mask_ll.xy head -n1 age_mask_ll.xy >> age_mask_ll.xy ;; esac rm traxis.xy