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

GMT_utm_zones.sh 2.1 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
  1. #!/usr/bin/env bash
  2. #
  3. # Makes a plot of the global UTM zone grid including the exceptions near Norway/Spitsbergen
  4. #
  5. gmt begin GMT_utm_zones
  6. gmt set MAP_FRAME_TYPE plain FORMAT_GEO_MAP dddF MAP_TITLE_OFFSET 0.25i MAP_ANNOT_OFFSET_PRIMARY 0.15i FONT_TITLE 24p FONT_ANNOT_PRIMARY 10p PS_MEDIA 11ix8.5i
  7. gmt coast -Rd -JQ9i -Groyalblue -Sazure -Dl -A2000 -Bx60f6 -By0 -BwsNe
  8. cat << EOF > tt.z.d
  9. > Do S pole zone
  10. -180 -80
  11. 0 -80
  12. +180 -80
  13. >
  14. 0 -90
  15. 0 -80
  16. > Do N pole zone
  17. -180 84
  18. 0 84
  19. +180 84
  20. >
  21. 0 90
  22. 0 84
  23. EOF
  24. gmt math -T-174/174/6 T 0 MUL = tt.x.d
  25. echo '-90' > tt.L.d
  26. let s=-80
  27. rm -f tt.y.d
  28. while [ $s -lt 72 ]; do
  29. echo $s >> tt.L.d
  30. n=$(($s+8))
  31. cat <<- EOF >> tt.z.d
  32. > Lat = $s
  33. -180 $s
  34. 0 $s
  35. +180 $s
  36. EOF
  37. if [ $s -eq 56 ]; then
  38. $AWK '{if ($1 == 6) {print 3} else {print $0}}' tt.x.d > tt.sp.d
  39. else
  40. cat tt.x.d > tt.sp.d
  41. fi
  42. $AWK '{printf "> \n%s\t%s\n%s\t%s\n", $1, "'$s'", $1, "'$n'"}' tt.sp.d >> tt.z.d
  43. gmt math -Q $s $n ADD 2 DIV = >> tt.y.d
  44. s=$n
  45. done
  46. echo $n >> tt.L.d
  47. echo '84' >> tt.L.d
  48. echo '90' >> tt.L.d
  49. echo 78 >> tt.y.d
  50. cat << EOF > tt.n.d
  51. C
  52. D
  53. E
  54. F
  55. G
  56. H
  57. J
  58. K
  59. L
  60. M
  61. N
  62. P
  63. Q
  64. R
  65. S
  66. T
  67. U
  68. V
  69. W
  70. X
  71. EOF
  72. n=84
  73. cat << EOF >> tt.z.d
  74. > Lat = $s
  75. -180 $s
  76. 0 $s
  77. +180 $s
  78. EOF
  79. $AWK '{if ($1 <=0 || $1 >=42) print $0}' tt.x.d > tt.sp.d
  80. cat << EOF >> tt.sp.d
  81. 9
  82. 21
  83. 33
  84. EOF
  85. $AWK '{printf "> \n%s\t%s\n%s\t%s\n", $1, "'$s'", $1, "'$n'"}' tt.sp.d >> tt.z.d
  86. gmt plot -W0.5p -Ap tt.z.d
  87. paste tt.y.d tt.n.d | $AWK '{printf "180 %s %s\n", $1, $2}' | gmt text -N -D0.1i/0 -F+f10p,Helvetica-Bold
  88. gmt text -N -F+f10p,Helvetica-Bold << EOF
  89. -90 -85 A
  90. +90 -85 B
  91. -90 87 Y
  92. +90 87 Z
  93. EOF
  94. gmt math -T-180/174/6 T 3 ADD = | $AWK '{printf "%s -90 %d\n", $2, NR}' | gmt text -N -D0/-0.07i -F+f8p,Times-Italic+jCT
  95. gmt math -T-180/174/6 T 3 ADD = | $AWK '{printf "%s 90 %d\n", $2, NR}' | gmt text -N -D0/0.07i -F+f8p,Times-Italic+jCB
  96. gmt text -D0/0.025i -F+f8p,Times-Italic+jCB << EOF
  97. 4.5 72 31X
  98. 15 72 33X
  99. 27 72 35X
  100. 37.5 72 37X
  101. EOF
  102. $AWK '{if ($1 < 0) printf "-180 %s %s@.S\n", $1, -$1}' tt.L.d | gmt text -N -D-0.05i/0 -F+f10p+jRM
  103. $AWK '{if ($1 > 0) printf "-180 %s %s@.N\n", $1, $1}' tt.L.d | gmt text -N -D-0.05i/0 -F+f10p+jRM
  104. echo "-180 0 0@." | gmt text -N -D-0.05i/0 -F+f10p+jRM
  105. gmt end show
Tip!

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

Comments

Loading...