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

cartpol.sh 805 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  1. #!/usr/bin/env bash
  2. # Testing grdvector for Cartesian and polar projections
  3. # Added to address issue #767
  4. ps=cartpol.ps
  5. cat << EOF > vel_x
  6. 1
  7. 1
  8. 1
  9. 1
  10. 1
  11. 1
  12. 1
  13. 1
  14. 1
  15. EOF
  16. cat << EOF > vel_y
  17. 0
  18. 0
  19. 0
  20. 1
  21. 1
  22. 1
  23. 0
  24. 0
  25. 0
  26. EOF
  27. for i in vel_x vel_y; do
  28. gmt xyz2grd $i -G$i.nc -R0/90/0.5/1 -I45/0.25 -ZLB
  29. done
  30. gmt grd2xyz vel_x.nc > a
  31. gmt grd2xyz vel_y.nc > b
  32. # Cartesian
  33. gmt grdvector vel_x.nc vel_y.nc -JX6i/3i -Baf -BWSne -Q0.3i+e -S2i -N -W1p,red -Gred -P -K > $ps
  34. paste a b | awk '{printf "%s %s (%s,%s)\n", $1, $2, $3, $6}' | gmt pstext -R -J -O -K -N -D0.5i/0.1i -F+f12p+jLB >> $ps
  35. # Polar
  36. gmt grdvector vel_x.nc vel_y.nc -JP6i+a+t45 -Baf -BWSne -Q0.3i+e -S2i -N -W1p,red -Gred -T -O -K -Y5i >> $ps
  37. paste a b | awk '{printf "%s %s (%s,%s)\n", $1, $2, $3, $6}' | gmt pstext -R -J -O -N -D-0.2i/0.3i -F+f12p+jLB >> $ps
Tip!

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

Comments

Loading...