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

spikes.sh 1.1 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
  1. #!/usr/bin/env bash
  2. # Testing gmt grdfilter's isotropic and rectangular filter
  3. # on a spike, using both -D0 and -Dp for pixel widths.
  4. ps=spikes.ps
  5. if [[ ${HAVE_GLIB_GTHREAD} =~ TRUE|ON ]]; then
  6. _thread_opt=-x+a
  7. fi
  8. filter () {
  9. gmt grdfilter t.nc -Gf.nc ${_thread_opt} $*
  10. gmt grdmath f.nc DUP UPPER DIV = f.nc
  11. }
  12. image () { # First 3 args for gmt grdimage; $4 is text for gmt pstext
  13. gmt grdimage -JX2.8i -B20f10g10 -BWSne -Ct.cpt -O -K $1 $2 $3
  14. echo "50 50 $4" | gmt pstext -R -J -O -K -Dj0.1i/0.1i -F+jTR+f18p -W1p -Gwhite
  15. }
  16. echo 25 25 100 | gmt xyz2grd -R0/50/0/50 -I0.5 -di0 -Gt.nc
  17. gmt makecpt -Crainbow -T0/1 > t.cpt
  18. gmt psscale -Dx3.25i/-0.35i+w6i/0.1i+h+jTC -P -K -Ba0.1 -Ct.cpt -Y1.2i > $ps
  19. image t.nc -X0i -Y0i "Spike" >> $ps
  20. filter -D0 -Fg30
  21. image f.nc -X3.5i -Y0i "-D0 -Fg30" >> $ps
  22. filter -D0 -Fb20/10
  23. image f.nc -X-3.5i -Y3.2i "-D0 -Fb20/10" >> $ps
  24. filter -D0 -Fg15/30
  25. image f.nc -X3.5i -Y0i "-D0 -Fg15/30" >> $ps
  26. filter -Dp -Fb31/31
  27. image f.nc -X-3.5i -Y3.2i "-Dp -Fb31/31" >> $ps
  28. filter -Dp -Fc61/61
  29. image f.nc -X3.5i -Y0i "-Dp -Fc61/61" >> $ps
  30. 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...