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_App_M_1b.sh 2.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
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
  1. #!/usr/bin/env bash
  2. #
  3. # Makes the insets for Appendix M(cpt)
  4. # [skip srtm which is just a special version of dem2]
  5. #
  6. # We have four sets of CPT figures to make:
  7. # 1a) Our regular, traditional GMT CPTs [44]
  8. # 1b) The regular Scientific Color Maps* [30]
  9. # 1c) Categorical CPTs (ours and SCM*) [18]
  10. # 1d) Cyclic CPTs from SCM* [5]
  11. #
  12. # *from Fabio [www.fabiocrameri.ch/visualisation]
  13. GMT_SHAREDIR=$(gmt --show-sharedir)
  14. # Here we list all the non-categorical/cyclic cpts from the SCM:
  15. cat << EOF > tt.lis
  16. acton
  17. bam
  18. bamako
  19. batlow
  20. batlowK
  21. batlowW
  22. berlin
  23. bilbao
  24. broc
  25. buda
  26. bukavu
  27. cork
  28. davos
  29. devon
  30. fes
  31. grayC
  32. hawaii
  33. imola
  34. lajolla
  35. lapaz
  36. lisbon
  37. nuuk
  38. oleron
  39. oslo
  40. roma
  41. tofino
  42. tokyo
  43. turku
  44. vanimo
  45. vik
  46. EOF
  47. n=$(cat tt.lis | wc -l)
  48. let n2=n/2
  49. let n2=n
  50. # dy is line spacing and y0 is total box height
  51. dy=0.6
  52. y0=$(gmt math -Q $n2 $dy MUL 0.5 MUL 0.1 ADD =)
  53. gmt begin GMT_App_M_1b
  54. gmt set GMT_THEME cookbook
  55. gmt set MAP_FRAME_PEN thinner FONT_ANNOT_PRIMARY 8p MAP_TICK_LENGTH_PRIMARY 0.1i MAP_ANNOT_OFFSET_PRIMARY 0.04i
  56. gmt basemap -R0/6.1/0/$y0 -Jx1i -B0
  57. i=1
  58. y=0.375
  59. y2=0.25
  60. while [ $i -le $n2 ]
  61. do
  62. j1=$(expr $n2 - $i)
  63. j2=$(expr $n2 - $i + 1)
  64. left=$(sed -n ${j1}p tt.lis)
  65. right=$(sed -n ${j2}p tt.lis)
  66. gmt makecpt -H -C$left -T-1/1 > tt.left.cpt
  67. gmt makecpt -H -C$left -T-1/1/0.25 > tt.left2.cpt
  68. gmt makecpt -H -C$right -T-1/1 > tt.right.cpt
  69. gmt makecpt -H -C$right -T-1/1/0.25 > tt.right2.cpt
  70. gmt colorbar -Dx1.55i/${y}i+w2.70i/0.125i+h+jTC+e -Ctt.left.cpt -B0
  71. gmt colorbar -Dx4.50i/${y}i+w2.70i/0.125i+h+jTC+e -Ctt.right.cpt -B0
  72. gmt colorbar -Dx1.55i/${y2}i+w2.70i/0.125i+h+jTC+e -Ctt.left2.cpt -Bf0.25
  73. gmt colorbar -Dx4.50i/${y2}i+w2.70i/0.125i+h+jTC+e -Ctt.right2.cpt -Bf0.25
  74. gmt text -D0/0.05i -F+f9p,Helvetica-Bold+jBC <<- END
  75. 1.55 $y ${left}
  76. 4.50 $y ${right}
  77. END
  78. if [ $(grep -c HARD_HINGE ${GMT_SHAREDIR}/cpt/${left}.cpt) -eq 1 ]; then # Plot hard hinge symbol for left CPT
  79. echo 1.55 $y | gmt plot -St0.2c -Gblack -Wfaint -D0/-0.29i
  80. elif [ $(grep -c SOFT_HINGE ${GMT_SHAREDIR}/cpt/${left}.cpt) -eq 1 ]; then # Plot soft hinge symbol for left CPT
  81. echo 1.55 $y | gmt plot -St0.2c -Gwhite -Wfaint -D0/-0.29i
  82. fi
  83. if [ $(grep -c HARD_HINGE ${GMT_SHAREDIR}/cpt/${right}.cpt) -eq 1 ]; then # Plot hard hinge symbol for right CPT
  84. echo 4.50 $y | gmt plot -St0.2c -Gblack -Wfaint -D0/-0.29i
  85. elif [ $(grep -c SOFT_HINGE ${GMT_SHAREDIR}/cpt/${right}.cpt) -eq 1 ]; then # Plot soft hinge symbol for right CPT
  86. echo 4.50 $y | gmt plot -St0.2c -Gwhite -Wfaint -D0/-0.29i
  87. fi
  88. i=$(expr $i + 2)
  89. y=$(gmt math -Q $y $dy ADD =)
  90. y2=$(gmt math -Q $y2 $dy ADD =)
  91. done
  92. rm -f tt.*
  93. gmt end show
Tip!

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

Comments

Loading...