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

bworthxy.sh 1.4 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
  1. #!/usr/bin/env bash
  2. # Testing gmt grdfft power spectrum values
  3. ps=bworthxy.ps
  4. F0=0.25
  5. gmt math -T0/0.5/0.001 T $F0 DIV 12 POW 1 ADD INV 128 DIV = curve.txt
  6. L=$(gmt math -Q 128 INV =)
  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 -Ex -N+a > bworth_x.txt
  10. gmt grdfft @white_noise.nc -Ey -N+a > bworth_y.txt
  11. gmt grdfft @white_noise.nc -Fx-/4/6 -Ex -N+a > bworth_bx.txt
  12. gmt grdfft @white_noise.nc -Fy-/4/6 -Ey -N+a > bworth_by.txt
  13. gmt psbasemap -R0/0.5/0/0.0125 -JX6i/4i -Baf -BWSne -P -K -X1.25i > $ps
  14. gmt psxy -R -J -O -K -W0.5p << EOF >> $ps
  15. 0 $L
  16. 0.5 $L
  17. EOF
  18. gmt psxy -R -J -O -K bworth_x.txt -Sc0.1c -Gblue -Ey >> $ps
  19. gmt psxy -R -J -O -K bworth_x.txt -Wfaint,blue >> $ps
  20. gmt psxy -R -J -O -K bworth_bx.txt -Sc0.1c -Ggreen -Ey >> $ps
  21. gmt psxy -R -J -O -K bworth_bx.txt -W0.25p >> $ps
  22. gmt psxy -R -J -O -K curve.txt -W0.5p,red >> $ps
  23. gmt psbasemap -R -J -Baf -BWSne+t"Butterworth Filtering (f@-0@- = 0.25, N = 6)" -O -K -Y4.5i >> $ps
  24. gmt psxy -R -J -O -K -W0.5p << EOF >> $ps
  25. 0 $L
  26. 0.5 $L
  27. EOF
  28. gmt psxy -R -J -O -K bworth_y.txt -Sc0.1c -Gblue -Ey >> $ps
  29. gmt psxy -R -J -O -K bworth_y.txt -Wfaint,blue >> $ps
  30. gmt psxy -R -J -O -K bworth_by.txt -Sc0.1c -Ggreen -Ey >> $ps
  31. gmt psxy -R -J -O -K bworth_by.txt -W0.25p >> $ps
  32. gmt psxy -R -J -O curve.txt -W0.5p,red >> $ps
Tip!

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

Comments

Loading...