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

ldist.sh 532 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
22
23
24
25
  1. #!/usr/bin/env bash
  2. #
  3. # Purpose: Compute Cartesian distances from square and triangular polygons
  4. ps=ldist.ps
  5. # Triangle
  6. cat << EOF > p.txt
  7. -1 -1
  8. 1 -1
  9. 0 1
  10. -1 -1
  11. EOF
  12. gmt grdmath -R-10/10/-10/10 -I0.1 p.txt LDIST = d.nc
  13. gmt grdcontour d.nc -JX4i -P -A5 -C0.25 -Bafg -K -Xc > $ps
  14. gmt psxy -R -J p.txt -W2p,red -O -K >> $ps
  15. # Square
  16. cat << EOF > p.txt
  17. -1 -1
  18. 1 -1
  19. 1 1
  20. -1 1
  21. -1 -1
  22. EOF
  23. gmt grdmath -R-10/10/-10/10 -I0.1 p.txt LDIST = d.nc
  24. gmt grdcontour d.nc -J -O -A5 -C0.25 -Bafg -K -Y4.75i >> $ps
  25. gmt psxy -R -J p.txt -W2p,red -O >> $ps
Tip!

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

Comments

Loading...