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_1c.sh 2.3 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
  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. # Use the knowledge that we need 3 pages.
  7. # 44 original GMT 5 CPTs and the last page has 28 scientific colormaps
  8. # from Fabio [www.fabiocrameri.ch/visualisation]
  9. GMT_SHAREDIR=$(gmt --show-sharedir)
  10. cat << EOF > tt.lis
  11. acton
  12. bamako
  13. batlow
  14. berlin
  15. bilbao
  16. broc
  17. brocO
  18. buda
  19. cork
  20. corkO
  21. davos
  22. devon
  23. grayC
  24. hawaii
  25. imola
  26. lajolla
  27. lapaz
  28. lisbon
  29. nuuk
  30. oleron
  31. oslo
  32. roma
  33. romaO
  34. tofino
  35. tokyo
  36. turku
  37. vik
  38. vikO
  39. EOF
  40. n=$(cat tt.lis | wc -l)
  41. let n2=n/2
  42. let n2=n
  43. # dy is line spacing and y0 is total box height
  44. dy=0.75
  45. y0=$(gmt math -Q $n2 $dy MUL 0.5 MUL =)
  46. gmt begin GMT_App_M_1c
  47. gmt set MAP_FRAME_PEN thinner FONT_ANNOT_PRIMARY 8p MAP_TICK_LENGTH_PRIMARY 0.1i MAP_ANNOT_OFFSET_PRIMARY 0.04i
  48. gmt basemap -R0/6.1/0/$y0 -Jx1i -B0
  49. i=1
  50. y=0.475
  51. y2=0.35
  52. while [ $i -le $n2 ]
  53. do
  54. j=$(expr $i + 1)
  55. left=$(sed -n ${j}p tt.lis)
  56. right=$(sed -n ${i}p tt.lis)
  57. gmt makecpt -H -C$left -T-1/1 > tt.left.cpt
  58. gmt makecpt -H -C$left -T-1/1/0.25 > tt.left2.cpt
  59. gmt makecpt -H -C$right -T-1/1 > tt.right.cpt
  60. gmt makecpt -H -C$right -T-1/1/0.25 > tt.right2.cpt
  61. gmt colorbar -Dx1.55i/${y}i+w2.70i/0.125i+h+jTC -Ctt.left.cpt -B0
  62. gmt colorbar -Dx4.50i/${y}i+w2.70i/0.125i+h+jTC -Ctt.right.cpt -B0
  63. gmt colorbar -Dx1.55i/${y2}i+w2.70i/0.125i+h+jTC -Ctt.left2.cpt -Bf0.25
  64. gmt colorbar -Dx4.50i/${y2}i+w2.70i/0.125i+h+jTC -Ctt.right2.cpt -Bf0.25
  65. gmt text -D0/0.05i -F+f9p,Helvetica-Bold+jBC <<- END
  66. 1.55 $y ${left}
  67. 4.50 $y ${right}
  68. END
  69. if [ $(grep -c HARD_HINGE ${GMT_SHAREDIR}/cpt/${left}.cpt) -eq 1 ]; then # Plot hard hinge symbol for left CPT
  70. echo 1.55 $y | gmt plot -St0.2c -Gblack -Wfaint -D0/-0.29i
  71. elif [ $(grep -c SOFT_HINGE ${GMT_SHAREDIR}/cpt/${left}.cpt) -eq 1 ]; then # Plot soft hinge symbol for left CPT
  72. echo 1.55 $y | gmt plot -St0.2c -Gwhite -Wfaint -D0/-0.29i
  73. fi
  74. if [ $(grep -c HARD_HINGE ${GMT_SHAREDIR}/cpt/${right}.cpt) -eq 1 ]; then # Plot hard hinge symbol for right CPT
  75. echo 4.50 $y | gmt plot -St0.2c -Gblack -Wfaint -D0/-0.29i
  76. elif [ $(grep -c SOFT_HINGE ${GMT_SHAREDIR}/cpt/${right}.cpt) -eq 1 ]; then # Plot soft hinge symbol for right CPT
  77. echo 4.50 $y | gmt plot -St0.2c -Gwhite -Wfaint -D0/-0.29i
  78. fi
  79. i=$(expr $i + 2)
  80. y=$(gmt math -Q $y $dy ADD =)
  81. y2=$(gmt math -Q $y2 $dy ADD =)
  82. done
  83. gmt end show
Tip!

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

Comments

Loading...