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

segments.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
  1. #!/usr/bin/env bash
  2. # Test gmt convert with different segment markers
  3. ps=segments.ps
  4. cat << EOF > gmt_i.txt
  5. > Some ps=segments.ps
  6. 1 1
  7. 2 7
  8. 3 2
  9. >Another ps=segments.ps
  10. 6 3
  11. 8 4
  12. 9 3
  13. EOF
  14. cat << EOF > blank_i.txt
  15. 1 1
  16. 2 7
  17. 3 2
  18. 6 3
  19. 8 4
  20. 9 3
  21. EOF
  22. cat << EOF > nan_i.txt
  23. NaN NaN
  24. 1 1
  25. 2 7
  26. 3 2
  27. NaN NaN
  28. 6 3
  29. 8 4
  30. 9 3
  31. EOF
  32. # Test GMT on input and blank output
  33. gmt convert gmt_i.txt --IO_SEGMENT_MARKER='>,B' > t.txt
  34. gmt psxy -R0/10/0/10 -JX3i -P -K -Ba -BWSne gmt_i.txt -Sc0.2i -Ggreen -Y0.5i > $ps
  35. gmt psxy -R -J -O -K t.txt -Sc0.1i -Gred --IO_SEGMENT_MARKER=B >> $ps
  36. gmt psxy -R -J -O -K t.txt -W0.5p --IO_SEGMENT_MARKER=B >> $ps
  37. echo "10 10 GMT->blank" | gmt pstext -R -J -O -K -F+jTR+f12 -Dj0.1i >> $ps
  38. # Test GMT on input and NaN output
  39. gmt convert gmt_i.txt --IO_SEGMENT_MARKER='>,N' > t.txt
  40. gmt psxy -R -J -O -K -Ba -BWSne gmt_i.txt -Sc0.2i -Ggreen -X3.5i >> $ps
  41. gmt psxy -R -J -O -K t.txt -Sc0.1i -Gred --IO_SEGMENT_MARKER=N >> $ps
  42. gmt psxy -R -J -O -K t.txt -W0.5p --IO_SEGMENT_MARKER=N >> $ps
  43. echo "10 10 GMT->NaN" | gmt pstext -R -J -O -K -F+jTR+f12 -Dj0.1i >> $ps
  44. # Test blank on input and GMT output
  45. gmt convert blank_i.txt --IO_SEGMENT_MARKER='B,>' > t.txt
  46. gmt psxy -R -J -O -K -Ba -BWSne blank_i.txt -Sc0.2i -Ggreen -X-3.5i -Y3.4i --IO_SEGMENT_MARKER=B >> $ps
  47. gmt psxy -R -J -O -K t.txt -Sc0.1i -Gred >> $ps
  48. gmt psxy -R -J -O -K t.txt -W0.5p >> $ps
  49. echo "10 10 blank->GMT" | gmt pstext -R -J -O -K -F+jTR+f12 -Dj0.1i >> $ps
  50. # Test blank on input and NaN output
  51. gmt convert blank_i.txt --IO_SEGMENT_MARKER='B,N' > t.txt
  52. gmt psxy -R -J -O -K -Ba -BWSne blank_i.txt -Sc0.2i -Ggreen -X3.5i --IO_SEGMENT_MARKER=B >> $ps
  53. gmt psxy -R -J -O -K t.txt -Sc0.1i -Gred --IO_SEGMENT_MARKER=N >> $ps
  54. gmt psxy -R -J -O -K t.txt -W0.5p --IO_SEGMENT_MARKER=N >> $ps
  55. echo "10 10 blank->NaN" | gmt pstext -R -J -O -K -F+jTR+f12 -Dj0.1i >> $ps
  56. # Test NaN on input and GMT output
  57. gmt convert nan_i.txt --IO_SEGMENT_MARKER='N,>' > t.txt
  58. gmt psxy -R -J -O -K -Ba -BWSne nan_i.txt -Sc0.2i -Ggreen -X-3.5i -Y3.4i --IO_SEGMENT_MARKER=N >> $ps
  59. gmt psxy -R -J -O -K t.txt -Sc0.1i -Gred >> $ps
  60. gmt psxy -R -J -O -K t.txt -W0.5p >> $ps
  61. echo "10 10 NaN->GMT" | gmt pstext -R -J -O -K -F+jTR+f12 -Dj0.1i >> $ps
  62. # Test NaN on input and blank output
  63. gmt convert nan_i.txt --IO_SEGMENT_MARKER='N,B' > t.txt
  64. gmt psxy -R -J -O -K -Ba -BWSne nan_i.txt -Sc0.2i -Ggreen -X3.5i --IO_SEGMENT_MARKER=N >> $ps
  65. gmt psxy -R -J -O -K t.txt -Sc0.1i -Gred --IO_SEGMENT_MARKER=B >> $ps
  66. gmt psxy -R -J -O -K t.txt -W0.5p --IO_SEGMENT_MARKER=B >> $ps
  67. echo "10 10 NaN->blank" | gmt pstext -R -J -O -F+jTR+f12 -Dj0.1i >> $ps
Tip!

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

Comments

Loading...