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

masking.sh 3.2 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
89
90
  1. #!/usr/bin/env bash
  2. # Test psmask and oriented clip paths polygons
  3. ps=masking.ps
  4. function arrow() {
  5. # Given file, pull out first 2 records and draw an arrow from first to second point per segment
  6. gmt convert $1 -Dtmp.%d
  7. for file in tmp.*; do
  8. first=`sed -n 2p $file`
  9. second=`sed -n 3p $file`
  10. echo $first $second | awk '{print $1, $2, $3, $4}' | gmt psxy -R -J -O -K -Sv0.15i+e+s+h0.5 -Gblack
  11. done
  12. rm -f tmp.*
  13. }
  14. # Some x,y data points, z is arbitrary and not used here */
  15. cat << EOF > data.txt
  16. 2.00 5.99 3.03
  17. 2.06 6.98 3.12
  18. 1.95 7.86 2.01
  19. 2.87 3.92 2.89
  20. 3.02 4.96 3.13
  21. 2.83 6.14 2.98
  22. 3.23 6.87 2.93
  23. 3.05 7.81 2.96
  24. 3.88 3.03 2.97
  25. 4.23 3.94 2.93
  26. 4.00 5.04 2.99
  27. 3.96 5.86 3.02
  28. 4.14 6.97 3.04
  29. 3.97 8.03 3.02
  30. 5.07 2.97 3.03
  31. 5.03 4.00 2.96
  32. 4.91 6.88 2.94
  33. 4.98 7.90 3.14
  34. 5.99 1.96 3.06
  35. 5.95 3.09 2.98
  36. 5.94 4.00 3.08
  37. 6.03 6.99 3.10
  38. 5.92 7.60 3.17
  39. 6.94 3.00 3.08
  40. 7.04 3.95 2.87
  41. 7.01 5.01 2.97
  42. 7.14 6.13 3.14
  43. 7.03 7.23 3.05
  44. 6.95 8.05 3.03
  45. 8.14 2.99 2.98
  46. 7.89 3.91 3.15
  47. 8.01 4.95 3.03
  48. 8.07 6.09 3.05
  49. 7.95 7.06 2.97
  50. EOF
  51. Ri=-R0/10/0/10
  52. Ro=-R-1/11/-1/11
  53. gmt psxy $Ro -JX3i -P -Bafg1 -BWSne data.txt -Ss0.1i -Gblue -W0.25p -K -Y0.5i > $ps
  54. gmt psmask $Ri -J -I1 data.txt -Dclip.txt -L+psmask.nc
  55. gmt grd2xyz -s psmask.nc | gmt psxy $Ro -J -O -K -Sc0.03i -Gred >> $ps
  56. gmt psxy $Ro -J -O -K clip.txt -W1p,red >> $ps
  57. echo 0 0 Unoriented | gmt pstext -R -J -O -K -F+f12p+jLB -Gwhite -W0.5p >> $ps
  58. arrow clip.txt >> $ps
  59. gmt psxy $Ro -J -O -Bafg1 -BwSnE data.txt -Ss0.1i -Gblue -W0.25p -K -X3.25i >> $ps
  60. gmt psmask $Ri -J -I1 data.txt -Dclipf.txt -Fr -L+psmask.nc
  61. gmt grd2xyz -s psmask.nc | gmt psxy $Ro -J -O -K -Sc0.03i -Gred >> $ps
  62. gmt psxy $Ro -J -O -K clipf.txt -W1p,red >> $ps
  63. echo 0 0 Oriented -Fr | gmt pstext -R -J -O -K -F+f12p+jLB -Gwhite -W0.5p >> $ps
  64. arrow clipf.txt >> $ps
  65. gmt psxy $Ro -J -O -Bafg1 -BWSne data.txt -Ss0.1i -Gblue -W0.25p -K -X-3.25i -Y3.4i >> $ps
  66. gmt psmask $Ri -J -I1 data.txt -Dclipn.txt -N -L+psmask.nc
  67. gmt grd2xyz -s+a psmask.nc | gmt psxy $Ro -J -O -K -Sc0.03i -Gred >> $ps
  68. gmt psxy $Ro -J -O -K clipn.txt -W1p,red >> $ps
  69. echo 0 0 Unoriented | gmt pstext -R -J -O -K -F+f12p+jLB -Gwhite -W0.5p >> $ps
  70. arrow clipn.txt >> $ps
  71. gmt psxy $Ro -J -O -Bafg1 -BwSnE data.txt -Ss0.1i -Gblue -W0.25p -K -X3.25i >> $ps
  72. gmt psmask $Ri -J -I1 data.txt -Dclipnf.txt -Fl -N -L+psmask.nc
  73. gmt grd2xyz -s+a psmask.nc | gmt psxy $Ro -J -O -K -Sc0.03i -Gred >> $ps
  74. gmt psxy $Ro -J -O -K clipnf.txt -W1p,red >> $ps
  75. echo 0 0 Oriented -Fl | gmt pstext -R -J -O -K -F+f12p+jLB -Gwhite -W0.5p >> $ps
  76. arrow clipnf.txt >> $ps
  77. gmt psxy $Ro -J -O -Bafg1 -BWSNe data.txt -Ss0.1i -Gblue -W0.25p -K -X-3.25i -Y3.4i >> $ps
  78. gmt psmask $Ri -J -I1 data.txt -Dclipns.txt -S1 -N -L+psmask.nc
  79. gmt grd2xyz -s psmask.nc | gmt psxy $Ro -J -O -K -Sc0.03i -Gred >> $ps
  80. gmt psxy $Ro -J -O -K clipns.txt -W1p,red >> $ps
  81. echo 0 0 Unoriented -S1 | gmt pstext -R -J -O -K -F+f12p+jLB -Gwhite -W0.5p >> $ps
  82. arrow clipns.txt >> $ps
  83. gmt psxy $Ro -J -O -Bafg1 -BwSNE data.txt -Ss0.1i -Gblue -W0.25p -K -X3.25i >> $ps
  84. gmt psmask $Ri -J -I1 data.txt -Dclipfs.txt -Fl -L+psmask.nc
  85. gmt grd2xyz -s psmask.nc | gmt psxy $Ro -J -O -K -Sc0.03i -Gred >> $ps
  86. gmt psxy $Ro -J -O -K clipfs.txt -W1p,red >> $ps
  87. echo 0 0 Oriented -Fl | gmt pstext -R -J -O -K -F+f12p+jLB -Gwhite -W0.5p >> $ps
  88. arrow clipfs.txt >> $ps
  89. gmt psxy -R -J -O -T >> $ps
Tip!

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

Comments

Loading...