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

ex38.sh 1.2 KB

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
  1. #!/usr/bin/env bash
  2. # GMT EXAMPLE 38
  3. #
  4. # Purpose: Illustrate histogram equalization on topography grids
  5. # GMT modules: colorbar, text, makecpt, grdhisteq, grdimage
  6. # Unix progs: rm
  7. #
  8. gmt begin ex38
  9. gmt set FONT_TAG 14p
  10. gmt makecpt -Crainbow -T0/1700 -H > t.cpt
  11. gmt makecpt -Crainbow -T0/15/1 -H > c.cpt
  12. gmt makecpt -Crainbow -T-3/3 -H > n.cpt
  13. gmt makecpt -Crainbow -T0/15 -H > q.cpt
  14. gmt grdcut @earth_relief_02m -R-60/-45/-20/-10 -Gtopo_38.nc
  15. gmt subplot begin 2x2 -Fs7c -A+jTR+gwhite+p1p+o0.2c/0.2c -M0.75c/1.2c -Rtopo_38.nc -JM7c -B5 -BWSen -Y10c
  16. gmt subplot set 0 -A"Original"
  17. gmt grdimage topo_38.nc -I+d -Ct.cpt
  18. gmt subplot set 1 -A"Equalized"
  19. gmt grdhisteq topo_38.nc -Gout.nc -C16
  20. gmt grdimage out.nc -Cc.cpt
  21. gmt subplot set 2 -A"Normalized"
  22. gmt grdhisteq topo_38.nc -Gout.nc -N
  23. gmt grdimage out.nc -Cn.cpt
  24. gmt subplot set 3 -A"Quadratic"
  25. gmt grdhisteq topo_38.nc -Gout.nc -Q
  26. gmt grdimage out.nc -Cq.cpt
  27. gmt subplot end
  28. gmt colorbar -DJTC+w12c/0.4c+jTC+o0c/6c+h+e+n -Ct.cpt -Bxa500 -By+lm
  29. gmt colorbar -DJBC+w12c/0.4c+h+e+n -Cn.cpt -Bx1 -By+l"z@-n@-"
  30. gmt colorbar -DJBC+w12c/0.4c+h+e+n+o0c/2.5c -Cq.cpt -Bx1 -By+l"z@-q@-"
  31. rm -f out.nc ?.cpt
  32. gmt end show
Tip!

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

Comments

Loading...