Permalink
Browse files

add scripts

  • Loading branch information...
1 parent 1ef9d43 commit ceb391ccc36b4fb8879b8f1ed4dd06924a2aee4d @seisman seisman committed Mar 24, 2016
@@ -0,0 +1,25 @@
+#!/bin/bash
+gmt pstext -R0/3/-0.1/1.5 -Jx1i -P -K -C0.2i -TO -Wthick -F+f36p,Helvetica-Bold << EOF > GMT_pstext_clearance.ps
+1.5 0.5 My Text
+EOF
+gmt pstext -R -J -O -K -C0 -Wthin,- -F+f36p,Helvetica-Bold << EOF >> GMT_pstext_clearance.ps
+1.5 0.5 My Text
+EOF
+gmt pstext -R -J -O -K -F+f9p+j << EOF >> GMT_pstext_clearance.ps
+2.00 0.80 LM dy
+2.52 0.65 CB dx
+0.56 0.75 LB r
+EOF
+gmt psxy -R -J -O << EOF >> GMT_pstext_clearance.ps
+>
+1.95 0.69
+1.95 0.89
+>
+2.42 0.60
+2.62 0.60
+>
+0.59 0.69
+0.46 0.82
+EOF
+
+rm gmt.*
View
@@ -0,0 +1,23 @@
+#
+# Makefile for all figures in GMT_Docs
+#
+OUT_DIR=../source/images
+PNG = $(patsubst %.sh, $(OUT_DIR)/%.png, $(wildcard *.sh))
+PDF = $(patsubst %.sh, $(OUT_DIR)/%.pdf, $(wildcard *.sh))
+
+all: $(OUT_DIR) $(PNG) $(PDF) clean
+
+%.ps: %.sh
+ sh $<
+
+$(OUT_DIR):
+ mkdir -p $(OUT_DIR)
+
+$(OUT_DIR)/%.png: %.ps
+ gmt psconvert -A -Tg -P -D$(OUT_DIR) $<
+
+$(OUT_DIR)/%.pdf: %.ps
+ gmt psconvert -A -Tf -P -D$(OUT_DIR) $<
+
+clean:
+ @rm -f *.ps
@@ -0,0 +1,34 @@
+#!/bin/bash
+# test/fitcircle/circles.sh
+#
+# Tests gmt fitcircle on spherical data points
+
+ps=fitcircle_ex1.ps
+
+# Fit great circle to red points and small circle to green points
+# Plot the best-fitting great and small circles as well as the
+# location of the mean locations and pole locations for both
+# the -L1 and -L2 options (i.e., -L3).
+
+gmt fitcircle gcircle.txt -L3 > g.txt
+gmt fitcircle scircle.txt -L3 -S > s.txt
+gpole1=`grep "L1 N Hemisphere" g.txt | gawk '{printf "%s/%s\n", $1, $2}'`
+gpole2=`grep "L2 N Hemisphere" g.txt | gawk '{printf "%s/%s\n", $1, $2}'`
+spole1=`grep "L1 Small Circle Pole" s.txt | gawk '{printf "%s/%s\n", $1, $2}'`
+spole2=`grep "L2 Small Circle Pole" s.txt | gawk '{printf "%s/%s\n", $1, $2}'`
+slat1=`grep "L1 Small Circle" s.txt | gawk '{print 90-$NF}'`
+slat2=`grep "L2 Small Circle" s.txt | gawk '{print 90-$NF}'`
+gmt psxy -Rg -JG-30/40/7i -P -Bg -K gcircle.txt -Sc0.04i -Gred -Xc -Yc > $ps
+gmt psxy -R -J -O -K scircle.txt -Sc0.04i -Ggreen >> $ps
+gmt project -G1 -T$gpole1 -L-180/180 | gmt psxy -R -J -O -K -W3p >> $ps
+gmt project -G1 -T$gpole2 -L-180/180 | gmt psxy -R -J -O -K -W1p,- >> $ps
+gmt project -G1/$slat1 -T$spole1 -L-180/180 | gmt psxy -R -J -O -K -W3p >> $ps
+gmt project -G1/$slat2 -T$spole2 -L-180/180 | gmt psxy -R -J -O -K -W1p,- >> $ps
+grep "Great Circle Pole" g.txt | gmt psxy -R -J -O -K -Sa0.2i -Gred -W0.25p >> $ps
+grep "Small Circle Pole" s.txt | gmt psxy -R -J -O -K -Sa0.2i -Ggreen -W0.25p >> $ps
+grep "L1 Average" g.txt | gmt psxy -R -J -O -K -Sa0.2i -Gyellow -W0.25p >> $ps
+grep "L2 Average" g.txt | gmt psxy -R -J -O -K -Sa0.2i -Gyellow -W0.25p >> $ps
+grep "L1 Average" s.txt | gmt psxy -R -J -O -K -Sa0.2i -Gyellow -W0.25p >> $ps
+grep "L2 Average" s.txt | gmt psxy -R -J -O -K -Sa0.2i -Gyellow -W0.25p >> $ps
+gmt psxy -R -J -O -T >> $ps
+rm g.txt s.txt gmt.*
Oops, something went wrong.

0 comments on commit ceb391c

Please sign in to comment.