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

small.sh 3.5 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
  1. #!/usr/bin/env bash
  2. #
  3. # Tests gmt project in generating small and great circles
  4. ps=small.ps
  5. # P is the rotation pole and C is the center. The great circle through
  6. # P and C defines the zero-meridian. C is not necessarily 90 degrees
  7. # from P; in our case it is 65.2 degrees from P. We verify that C lies
  8. # half-way between the red (70) and orange (60) small colatitude circles.
  9. P=85/40
  10. C=15/15
  11. # Test -C -T -G for generating great/small circles about pole P for a certain angular extent (-L)
  12. # The default is a great circle unless a specific /colatitude is appended in -G
  13. # Try plot 110 degree small circle around P given C
  14. gmt project -C$C -T$P -G1/110 -L-20/60 | gmt psxy -Rg -JA40/30/7.5i -P -K -W2p,. -Xc -Yc > $ps
  15. # Try plot great circle around P given C
  16. gmt project -C$C -T$P -G1 -L-20/60 | gmt psxy -Rg -JA40/30/7.5i -O -K -W2p >> $ps
  17. # Try plot 80 degree small circle around P
  18. gmt project -C$C -T$P -G1/80 -L-20/60 | gmt psxy -Rg -JA40/30/7.5i -O -K -W2p,darkgray >> $ps
  19. # Try plot 70 degree small circle around P
  20. gmt project -C$C -T$P -G1/70 -L-20/60 | gmt psxy -Rg -JA40/30/7.5i -O -K -W2p,red >> $ps
  21. # Try plot 60 degree small circle around P
  22. gmt project -C$C -T$P -G1/60 -L-20/60 | gmt psxy -Rg -JA40/30/7.5i -O -K -W2p,orange >> $ps
  23. # Try plot 50 degree small circle around P
  24. gmt project -C$C -T$P -G1/50 -L-20/60 | gmt psxy -Rg -JA40/30/7.5i -O -K -W2p,yellow >> $ps
  25. # Try plot 40 degree small circle around P
  26. gmt project -C$C -T$P -G1/40 -L-20/60 | gmt psxy -Rg -JA40/30/7.5i -O -K -W2p,green >> $ps
  27. # Try plot 30 degree small circle around P
  28. gmt project -C$C -T$P -G1/30 -L-20/60 | gmt psxy -Rg -JA40/30/7.5i -O -K -W2p,cyan >> $ps
  29. # Try plot 20 degree small circle around P
  30. gmt project -C$C -T$P -G1/20 -L-20/60 | gmt psxy -Rg -JA40/30/7.5i -O -K -W2p,purple >> $ps
  31. # Try plot 10 degree small circle around P
  32. gmt project -C$C -T$P -G1/10 -L-20/60 | gmt psxy -Rg -JA40/30/7.5i -O -K -W2p,sandybrown >> $ps
  33. #
  34. # Test small circles forced to go through center C and the second point (here we use E = P)
  35. # This involves computing the pole for this circle; its coordinates are reported in the
  36. # segment ps=small.ps
  37. # Try plot 80 degree small half circle only through C and E
  38. gmt project -C$C -E$P -G1/80+ -L-90/90 > tmp
  39. gmt psxy -R -J -O -K -W2p,blue tmp >> $ps
  40. grep Pole tmp | $AWK '{print $5, $6}' | gmt psxy -Rg -JA40/30/7.5i -O -K -Sc0.1i -Gblue >> $ps
  41. # Try plot 60 degree small half circle through C and E
  42. gmt project -C$C -E$P -G1/60+ -L-90/90 > tmp
  43. gmt psxy -R -J -O -K -W2p,magenta tmp >> $ps
  44. grep Pole tmp | $AWK '{print $5, $6}' | gmt psxy -Rg -JA40/30/7.5i -O -K -Sc0.1i -Gmagenta >> $ps
  45. # Try plot 40 degree small full circle through C and E
  46. gmt project -C$C -E$P -G1/40+ -L-180/180 > tmp
  47. gmt psxy -R -J -O -K -W2p,tan tmp >> $ps
  48. grep Pole tmp | $AWK '{print $5, $6}' | gmt psxy -Rg -JA40/30/7.5i -O -K -Sc0.1i -Gtan >> $ps
  49. # Try plot 33 degree small half circle through C and E
  50. gmt project -C$C -E$P -G1/33+ -L-90/90 > tmp
  51. gmt psxy -R -J -O -K -W2p,brown tmp >> $ps
  52. grep Pole tmp | $AWK '{print $5, $6}' | gmt psxy -Rg -JA40/30/7.5i -O -K -Sc0.1i -Gbrown >> $ps
  53. # Plot P and C and create circle through P and C
  54. gmt project -C$C -E$P -G1 -L-180/180 | gmt psxy -Rg -JA40/30/7.5i -O -K -W2p,- >> $ps
  55. echo 85 40 | gmt psxy -Rg -JA40/30/7.5i -O -K -Sa0.3i -Gblack >> $ps
  56. echo 15 15 | gmt psxy -Rg -JA40/30/7.5i -O -K -Sa0.3i -Gblack >> $ps
  57. echo 85 40 P | gmt pstext -Rg -JA40/30/7.5i -O -K -D0/-0.2i -F+f14p >> $ps
  58. echo 15 15 C | gmt pstext -Rg -JA40/30/7.5i -O -K -D0/-0.2i -F+f14p >> $ps
  59. # The end
  60. gmt psbasemap -R -J -O -B30g30 >> $ps
Tip!

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

Comments

Loading...