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_1d.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
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
  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 cyclic cpts from the SCM:
  15. cat << EOF > tt.lis
  16. bamO
  17. brocO
  18. corkO
  19. romaO
  20. vikO
  21. EOF
  22. n=$(cat tt.lis | wc -l)
  23. let n2=n/2
  24. let n2=n
  25. # dy is line spacing and y0 is total box height
  26. dy=0.6
  27. y0=$(gmt math -Q $n2 $dy MUL 0.5 MUL 0.25 ADD =)
  28. gmt begin GMT_App_M_1d
  29. gmt set GMT_THEME cookbook
  30. gmt set MAP_FRAME_PEN thinner FONT_ANNOT_PRIMARY 8p MAP_TICK_LENGTH_PRIMARY 0.1i MAP_ANNOT_OFFSET_PRIMARY 0.04i
  31. gmt basemap -R0/6.1/0/$y0 -Jx1i -B0
  32. i=1
  33. y=0.375
  34. y2=0.25
  35. while [ $i -le $n2 ]
  36. do
  37. j2=$(expr $n2 + 1 - $i)
  38. right=$(sed -n ${j2}p tt.lis)
  39. if [[ ${i} < ${n2} ]]; then
  40. j1=$(expr $n2 - $i)
  41. left=$(sed -n ${j1}p tt.lis)
  42. gmt makecpt -H -C$left -T-1/1 > tt.left.cpt
  43. gmt makecpt -H -C$left -T-1/1/0.25 > tt.left2.cpt
  44. gmt colorbar -Dx1.55i/${y}i+w2.70i/0.125i+h+jTC -Ctt.left.cpt -B0
  45. gmt colorbar -Dx1.55i/${y2}i+w2.70i/0.125i+h+jTC -Ctt.left2.cpt -Bf0.25
  46. echo 1.55 $y ${left} | gmt text -D0/0.05i -F+f9p,Helvetica-Bold+jBC
  47. x=4.50
  48. else
  49. x=3.05
  50. fi
  51. gmt makecpt -H -C$right -T-1/1 > tt.right.cpt
  52. gmt makecpt -H -C$right -T-1/1/0.25 > tt.right2.cpt
  53. gmt colorbar -Dx${x}i/${y}i+w2.70i/0.125i+h+jTC -Ctt.right.cpt -B0
  54. gmt colorbar -Dx${x}i/${y2}i+w2.70i/0.125i+h+jTC -Ctt.right2.cpt -Bf0.25
  55. echo ${x} $y ${right} | gmt text -D0/0.05i -F+f9p,Helvetica-Bold+jBC
  56. i=$(expr $i + 2)
  57. y=$(gmt math -Q $y $dy ADD =)
  58. y2=$(gmt math -Q $y2 $dy ADD =)
  59. done
  60. rm -f tt.*
  61. gmt end show
Tip!

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

Comments

Loading...