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

subset.sh 718 B

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
  1. #!/usr/bin/env bash
  2. # Testing gmt grdcut -Z
  3. ps=subset.ps
  4. Rp=-21/21/-21/21
  5. Rg=-20/20/-20/20
  6. # Create grid by evaluating a Kelvin-Bessel * sqrt(r) function
  7. gmt grdmath -R$Rg -I1 0 0 CDIST 0.1 MUL KEI 0 0 CDIST 0.1 MUL SQRT ADD DUP UPPER DIV 10 MUL = tmp.nc
  8. gmt makecpt -Crainbow -T-6/10/1 > t.cpt
  9. # Draw all nodes as open circles
  10. gmt grd2xyz tmp.nc | gmt psxy -R$Rp -JX6i -Sc0.25c -Ct.cpt -P -K -B10f5 -BWSne -Xc -Y1.5i > $ps
  11. gmt psscale -Dx3i/-0.4i+w6i/0.15i+h+e+jTC -O -K -Ct.cpt >> $ps
  12. # Extract portion of grid with values less than 5
  13. gmt grdcut tmp.nc -Z0/5 -Gout.nc
  14. gmt grd2xyz out.nc | gmt psxy -R -J -Sc0.25c -W0.5p -O -K -B10f5 -BWSne+t"Rectangular subset with z <= 5" >> $ps
  15. gmt psxy -R$Rp -J -O -T >> $ps
Tip!

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

Comments

Loading...