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

macros.sh 1.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
  1. #!/usr/bin/env bash
  2. # Make a seismicity symbol that does r, g, or b depending on depth
  3. # and picks a circle that scales with magnitude range
  4. # For testing, we place a small black triangle on top except
  5. # for the case of z - 50, mag > 9 where we place a white triangle.
  6. # We also draw a large cyan square around intermediate-depth quakes
  7. # i.e., depths in 70-300 km range.
  8. ps=macros.ps
  9. cat << EOF > seis.def
  10. # Circle of variable size and color for seismicity
  11. # Expects 2 extra data columns: \$1 = depth and \$2 = magnitude
  12. N: 2
  13. # First set current color based on depth
  14. if \$1 <= 70 then T -Gred
  15. if \$1 [> 70:300 then {
  16. T -Ggreen
  17. 0 0 1 s -W1p,cyan -G-
  18. }
  19. if \$1 >= 300 then T -Gblue
  20. # Then draw a circle width diameter based on magnitude ranges
  21. if \$2 [> 0:1 then 0 0 0.1 c
  22. if \$2 [> 1:2 then 0 0 0.2 c
  23. if \$2 [> 2:3 then 0 0 0.3 c
  24. if \$2 [> 3:4 then 0 0 0.4 c
  25. if \$2 [> 4:5 then 0 0 0.5 c
  26. if \$2 [> 5:6 then 0 0 0.6 c
  27. if \$2 [> 6:7 then 0 0 0.7 c
  28. if \$2 [> 7:8 then 0 0 0.8 c
  29. if \$2 [> 8:9 then 0 0 0.9 c
  30. if \$2 [> 9:10 then {
  31. 0 0 1.0 c
  32. if \$1 == 50 then {
  33. 0 0 0.2 t -Gwhite -Wthinnest
  34. }
  35. } else {
  36. 0 0 0.1 t -Gblack
  37. }
  38. EOF
  39. # Plot a few quakes.
  40. cat << EOF > q.txt
  41. 0 0 35 3
  42. 1 1 114 2
  43. 2 2 410 6
  44. 2 0 50 9.5
  45. EOF
  46. gmt psxy -R-1/3/-1/3 -JM6i -P -Skseis/0.5i -Wthinnest q.txt -B1 > $ps
Tip!

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

Comments

Loading...