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

cfilter.sh 1.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
  1. #!/usr/bin/env bash
  2. # Testing gmt filter1d
  3. ps=cfilter.ps
  4. # Make some random noise with a data gap, then save this in CVS as otherwise it would differ each time.
  5. #gmt math -T-500/500/10 T POP 0 100 NRAND = | $AWK '{if ($1 < -100 || $1 > 50) print $0}' | gmt convert -gx50 > noise.txt
  6. gmt psxy -R-500/500/-300/300 -JX6i/2i -P -T -K -Y8.5i -Xc > $ps
  7. gmt psxy -R -J -Bx100g50 -By100g50 -BWSne -O noise.txt -W0.25p,red,. -K > tmp.eps
  8. gmt psxy -R -J -O noise.txt -Sc0.05i -Gred -K >> tmp.eps
  9. cat tmp.eps >> $ps
  10. gmt filter1d -Fb100 noise.txt | gmt psxy -R-500/500/-300/300 -J -O -K -W2p,blue >> $ps
  11. # Create a funny custom filter
  12. cat << EOF > myfilt.txt
  13. 1
  14. 1
  15. 1
  16. 1
  17. 0
  18. 0
  19. 0
  20. 0
  21. 1
  22. 1
  23. 1
  24. 1
  25. EOF
  26. gmt psxy -R -J -O -T -K -Y-2.5i >> $ps
  27. cat tmp.eps >> $ps
  28. gmt filter1d -Ffmyfilt.txt noise.txt | gmt psxy -R-500/500/-300/300 -J -O -K -W2p,blue >> $ps
  29. # Create a normal custom filter
  30. cat << EOF > myfilt.txt
  31. 1
  32. 1
  33. 1
  34. 1
  35. 1
  36. 1
  37. 1
  38. 1
  39. EOF
  40. gmt psxy -R -J -O -T -K -Y-2.5i >> $ps
  41. cat tmp.eps >> $ps
  42. gmt filter1d -Ffmyfilt.txt noise.txt | gmt psxy -R-500/500/-300/300 -J -O -K -W2p,blue >> $ps
  43. # Create an operator filter
  44. cat << EOF > myfilt.txt
  45. -1
  46. -1
  47. 1
  48. 1
  49. EOF
  50. gmt psxy -R -J -O -T -K -Y-2.5i >> $ps
  51. cat tmp.eps >> $ps
  52. gmt filter1d -Ffmyfilt.txt noise.txt | gmt psxy -R-500/500/-300/300 -J -O -W2p,blue >> $ps
Tip!

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

Comments

Loading...