[cig-commits] commit: update grdmap.sh: fix bug in mercator projections, fix output files of base maps.

Mercurial hg at geodynamics.org
Mon Aug 27 20:18:10 PDT 2012


changeset:   139:75355ca57041
tag:         tip
user:        Sylvain Barbot <sbarbot at caltech.edu>
date:        Mon Aug 27 20:18:04 2012 -0700
files:       util/grdmap.sh
description:
update grdmap.sh: fix bug in mercator projections, fix output files of base maps.


diff -r 687a7da383ea -r 75355ca57041 util/grdmap.sh
--- a/util/grdmap.sh	Fri Jul 20 12:53:56 2012 -0700
+++ b/util/grdmap.sh	Mon Aug 27 20:18:04 2012 -0700
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 ##############################################
 # script map.sh
@@ -147,7 +147,7 @@ do
 	u) uset=1;unit=$OPTARG;;
 	v) vset=1;SIZE=$OPTARG;VECTOR=$OPTARG"c";;
 	x) xset=1;;
-	E) Eset=1;PSFILE=$OPTARG;;
+	E) Eset=1;PSFILE=$(dirname $OPTARG)/$(basename $OPTARG .ps).ps;;
 	Y) Yset=1;Yshift=$OPTARG;;
 	esac
 done
@@ -281,7 +281,7 @@ while [ "$#" != "0" -o "$Eset" == "1" ];
 		else
 			# geographic coordinates
 			HEIGHT=4i
-			PROJ="M0/0/$HEIGHT"
+			PROJ="M$HEIGHT"
 		        AXIS=-B${tick}:"":/${tick}:""::."$title":WSne
 		fi
 
@@ -309,7 +309,6 @@ while [ "$#" != "0" -o "$Eset" == "1" ];
 			# tick marks
 			if [ "$tset" != "1" ]; then
 				tick=`echo $bds | awk -F "/" '{s=1;print ($2-$1)/s/4}'`
-				echo $tick
 			fi
 			tickf=`echo $tick | awk '{print $1/2}'`
 
@@ -346,10 +345,10 @@ while [ "$#" != "0" -o "$Eset" == "1" ];
 	
 	if [ "$xset" != "1" ]; then
 		#display -trim $PSFILE &
-		#gv -spartan $PSFILE &
+		#gv -geometry +0+0 -spartan $PSFILE &
 		ps2pdf -sPAPERSIZE="a4" $PSFILE $PDFFILE
 		echo $self": Converted to pdf file "$PDFFILE
-		xpdf -paper "A5" $PDFFILE -z 100 -g 565x655 >& /dev/null &
+		xpdf -geometry +0+0 -paper "A5" $PDFFILE -z 100 -g 565x655 >& /dev/null &
 	fi
 	
 	if [ "$#" != "0" ];then



More information about the CIG-COMMITS mailing list