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

twovtypes.sh 915 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
19
20
21
22
23
24
25
26
27
28
  1. #!/usr/bin/env bash
  2. ps=twovtypes.ps
  3. # Plot two vectors of length 500 km pointing East and North at lats 0, 40 and 60
  4. # Geovectors will plot with true length 500 km while Cartesian will have fixed length,
  5. # here set to the equivalent of 500 km at Equator. Question is should psxy have the
  6. # ability to take -SV with lengths in map distances instead of plot distances?
  7. cat << EOF > gvec.txt
  8. 0 0 0 500
  9. 0 0 90 500
  10. 0 40 0 500
  11. 0 40 90 500
  12. 0 60 0 500
  13. 0 60 90 500
  14. EOF
  15. # Assign equivalent length in inches corresponding to 500 km at Equator
  16. len=`gmt math -Q 500 60 111.13 MUL DIV 6 MUL =`
  17. cat << EOF > cvec.txt
  18. 0 0 0 ${len}
  19. 0 0 90 ${len}
  20. 0 40 0 ${len}
  21. 0 40 90 ${len}
  22. 0 60 0 ${len}
  23. 0 60 90 ${len}
  24. EOF
  25. # Plot as geovectors
  26. gmt psxy -R-10/50/-5/65 -JM6i -P -Baf -S=0.2i+e -W0.5p -Gblack -K gvec.txt -Xc > $ps
  27. # Plot as Cartesian vectors
  28. gmt psxy -R -J -SV0.2i+e -W0.5p -Gblack -O -D4i/0 cvec.txt --PROJ_LENGTH_UNIT=inch >> $ps
Tip!

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

Comments

Loading...