Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

translate_cart.sh 1013 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  1. #!/usr/bin/env bash
  2. # Test the gmt vector -Tt option for fixed and variable Cartesian translation
  3. ps=translate_cart.ps
  4. # Make lon lat points that spiral out
  5. gmt math -T0/360/15 -N5 -o1:4 T 36 DIV T -C1 COSD -C2 SIND -C3 0.1 MUL -C4 0.001 MUL -Ca MUL = spiral.txt
  6. gmt psxy -R-8/15/-10/6 -JX16c/0 -Baf -BWSne -Sc0.3c -Ggreen spiral.txt -P -K -Xc > $ps
  7. gmt vector spiral.txt -Tt60/2 > shifted.txt
  8. gmt psxy -R -J -O -K -Sc0.2c -Gred shifted.txt >> $ps
  9. echo "Fixed translation" | gmt pstext -R -J -O -K -F+f16p+jTR+cTR -Dj0.5c -W1p >> $ps
  10. gmt convert spiral.txt shifted.txt -A -o0,1,4,5 | gmt psxy -R -J -O -K -Sv0.1+s -W0.25p >> $ps
  11. gmt psxy -R -J -Baf -BWSne -Sc0.3c -Ggreen spiral.txt -O -K -Y12.5c >> $ps
  12. gmt vector spiral.txt -Tt > shifted.txt
  13. gmt psxy -R -J -O -K -Sc0.2c -Gblue shifted.txt >> $ps
  14. gmt convert spiral.txt shifted.txt -A -o0,1,4,5 | gmt psxy -R -J -O -K -Sv0.1+s -W0.25p >> $ps
  15. echo "Variable translation" | gmt pstext -R -J -O -K -F+f16p+jTR+cTR -Dj0.5c -W1p >> $ps
  16. gmt psxy -R -J -O -T >> $ps
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...