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

vectypes.sh 1.8 KB

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
29
30
31
32
  1. #!/usr/bin/env bash
  2. # Vector components (dx, dy)
  3. # The given vectors (0,10) and (10,0) has length 10. So a length of 10 is mapped to a length on the plot
  4. # psxy -SV..+z0.1: Scale 0.1 should yield a 1 plot unit long vector, we set unit to inch for 1i.
  5. # Vector aximuth and length (az, length)
  6. # The other vectors (0,100) and (90,100) has length 100. So a length of 100 is mapped to a length on the plot
  7. # psxy -i..3+s0.01. Scale 0.01 should yield a 1 plot unit long vector, we set unit to inch for 1i.
  8. # These are equivalent and same length at both latitudes, showing that either vector specification works.
  9. # We also ocompare with geovector, plotting vectors of length 1 degree = 111.13 km which are longer on the
  10. # map at higher latitudes, as expected.
  11. ps=vectypes.ps
  12. # Scale ector components via +z
  13. echo -2 0 0 10 > t.txt
  14. echo -2 0 10 0 >> t.txt
  15. gmt psxy t.txt -JM6i -R-4/4/-2/2 -SV0.3i+e+z0.1 -W2p,red -Gred -P -Bafg1 -BWSne -K -Xc --PROJ_LENGTH_UNIT=inch > $ps
  16. echo -2 60 0 10 > t.txt
  17. echo -2 60 10 0 >> t.txt
  18. gmt psxy t.txt -J -R-4/4/58/62 -SV0.3i+e+z0.1 -W2p,red -Gred -Bafg1 -BWsne -O -K -Y3.3i --PROJ_LENGTH_UNIT=inch >> $ps
  19. # Scale vector lengths via -i..+s
  20. echo 2 0 0 100 > t.txt
  21. echo 2 0 90 100 >> t.txt
  22. gmt psxy t.txt -JM6i -R-4/4/-2/2 -SV0.3i+e -i0:2,3+s0.01 -W2p,blue -Gblue -O -K -Y-3.3i --PROJ_LENGTH_UNIT=inch >> $ps
  23. echo 2 60 0 100 > t.txt
  24. echo 2 60 90 100 >> t.txt
  25. gmt psxy t.txt -J -R-4/4/58/62 -SV0.3i+e -i0:2,3+s0.01 -W2p,blue -Gblue -O -K -Y3.3i --PROJ_LENGTH_UNIT=inch >> $ps
  26. # Try geovector on these 111.13 km vectors pointing east and north
  27. echo 0 0 0 111.13 > t.txt
  28. echo 0 0 90 111.13 >> t.txt
  29. gmt psxy t.txt -JM6i -R-4/4/-2/2 -S=0.3i+e -W2p,green -Ggreen -O -K -Y-3.3i --PROJ_LENGTH_UNIT=inch >> $ps
  30. echo 0 60 0 111.13 > t.txt
  31. echo 0 60 90 111.13 >> t.txt
  32. gmt psxy t.txt -J -R-4/4/58/62 -S=0.3i+e -W2p,green -Ggreen -O -Y3.3i --PROJ_LENGTH_UNIT=inch >> $ps
Tip!

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

Comments

Loading...