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

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

Comments

Loading...