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

bworthr.sh 1.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
  1. #!/usr/bin/env bash
  2. # Testing gmt grdfft power spectrum values [radial]
  3. ps=bworthr.ps
  4. F0=0.25
  5. gmt math -T0/0.5/0.001 T $F0 DIV 12 POW 1 ADD INV 128 PI DIV DIV T MUL = curve.txt
  6. L=$(gmt math -Q 128 INV PI MUL 2 DIV =)
  7. # White noise of unit amplitude: Saved since otherwise it would change each time
  8. # gmt grdmath -R0/256/0/256 -I1 -r 0 1 NRAND = @white_noise.nc
  9. gmt grdfft @white_noise.nc -Er -N+a > bworth_r.txt
  10. gmt grdfft @white_noise.nc -Er+n -N+a > bworth_rn.txt
  11. gmt grdfft @white_noise.nc -Fr-/4/6 -Er -N+a > bworth_br.txt
  12. gmt grdfft @white_noise.nc -Fr-/4/6 -Er+n -N+a > bworth_brn.txt
  13. A=$(gmt math -Sf -o1 bworth_rn.txt MEAN =)
  14. gmt math -T0/0.5/0.001 T $F0 DIV 12 POW 1 ADD INV $A MUL = curven.txt
  15. gmt psbasemap -R0/0.5/0/0.0125 -JX6i/4i -Baf -BWSne -P -K -X1.25i > $ps
  16. gmt psxy -R -J -O -K -W0.5p << EOF >> $ps
  17. 0 0
  18. 0.5 $L
  19. EOF
  20. gmt psxy -R -J -O -K bworth_r.txt -Sc0.1c -Gblue -Ey >> $ps
  21. gmt psxy -R -J -O -K bworth_r.txt -Wfaint,blue >> $ps
  22. gmt psxy -R -J -O -K bworth_br.txt -Sc0.1c -Ggreen -Ey >> $ps
  23. gmt psxy -R -J -O -K bworth_br.txt -W0.25p >> $ps
  24. gmt psxy -R -J -O -K curve.txt -W0.5p,red >> $ps
  25. gmt psbasemap -R0/0.5/0/2.5e-05 -J -Baf -BWSne+t"Butterworth Filtering (f@-0@- = 0.25, N = 6)" -O -K -Y4.5i >> $ps
  26. gmt psxy -R -J -O -K -W0.5p << EOF >> $ps
  27. 0 $A
  28. 0.5 $A
  29. EOF
  30. gmt psxy -R -J -O -K bworth_rn.txt -Sc0.1c -Gblue -Ey >> $ps
  31. gmt psxy -R -J -O -K bworth_rn.txt -Wfaint,blue >> $ps
  32. gmt psxy -R -J -O -K bworth_brn.txt -Sc0.1c -Ggreen -Ey >> $ps
  33. gmt psxy -R -J -O -K bworth_brn.txt -W0.25p >> $ps
  34. gmt psxy -R -J -O curven.txt -W0.5p,red >> $ps
Tip!

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

Comments

Loading...