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

edit.sh 828 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
19
20
21
  1. #!/usr/bin/env bash
  2. # Testing gmt grdedit -R -N
  3. ps=edit.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 -JX4i -Ss0.2c -Ct.cpt -P -K -B10f5 -BWSne -Xc -Y1i > $ps
  11. gmt psscale -Dx4.5i/4.25i+w6i/0.15i+jML+e -O -K -Ct.cpt >> $ps
  12. # Change -R to 0/40/0/40 and replace the nodes in 10/20/10/20 with random values
  13. Rp=-1/41/-1/41
  14. gmt grdedit tmp.nc -R0/40/0/40
  15. gmt grdcut tmp.nc -R10/20/10/20 -Gt.nc
  16. gmt grdmath t.nc 0 MUL 10 ADD = t.nc
  17. gmt grd2xyz t.nc > tmp
  18. gmt grdedit tmp.nc -Ntmp
  19. gmt grd2xyz tmp.nc | gmt psxy -R$Rp -JX4i -Ss0.2c -Ct.cpt -O -B10f5 -BWSne -Y4.5i >> $ps
Tip!

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

Comments

Loading...