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

shrink.sh 689 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
  1. #!/usr/bin/env bash
  2. # Testing gmt grdcut -Zn
  3. ps=shrink.ps
  4. gmt grdmath -R0/10/0/10 -I1 X Y MUL = t.nc
  5. cat << EOF > replace.txt
  6. 0 1 NaN
  7. 0 2 NaN
  8. 0 3 NaN
  9. 3 10 NaN
  10. 4 10 NaN
  11. 8 9 NaN
  12. 8 10 NaN
  13. 9 10 NaN
  14. 10 10 NaN
  15. 7 4 NaN
  16. EOF
  17. gmt grdedit t.nc -Nreplace.txt
  18. gmt makecpt -Cjet -T0/100/5 > t.cpt
  19. gmt psscale -Ct.cpt -Dx0/4.2i+w8.4i/0.2i+jML+m -Ba10 -P -K > $ps
  20. gmt grdimage t.nc -Ct.cpt -JX4i -R -Baf -O -K -X1i >> $ps
  21. echo 10 5 Original | gmt pstext -R -J -O -K -N -Dj0.5i/0 -F+f24p+jLM >> $ps
  22. gmt grdcut t.nc -Zn -Gnew.nc
  23. gmt grdimage new.nc -Ct.cpt -JX4i -R -Baf -BWsNe+t"Strip off NaNs along grid perimeter" -O -K -Y4.4i >> $ps
  24. echo 10 5 -Zn | gmt pstext -R -J -O -N -Dj0.5i/0 -F+f24p+jLM >> $ps
Tip!

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

Comments

Loading...