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

contours.sh 1.3 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
39
40
41
42
  1. #!/usr/bin/env bash
  2. #
  3. # Test that contours are oriented correctly
  4. ps=contours.ps
  5. color_contour () {
  6. rm -f contour_*.txt
  7. gmt grdcontour BigIsland.nc -C1000 -Dcontour_%d.txt -F$1 -S8
  8. for name in contour_*.txt; do
  9. # For each contour we compute distance a
  10. gmt mapproject -G+uk $name > contour.d
  11. L=$(gmt info -C contour.d | cut -f8)
  12. $AWK -v L=$L '{print $1, $2, $4/L}' contour.d | gmt psxy -R -J -O -K -Ccontour.cpt -Sc0.005i >> $ps
  13. done
  14. }
  15. gmt grdcut @earth_relief_02m -R204/206/19/21 -GBigIsland.nc
  16. gmt makecpt -Cseis -T0/1 > contour.cpt
  17. # The bottom map will have contours oriented so that as you move along
  18. # them (color goes from red to blue) the higher topography will be to
  19. # your right (-Fr).
  20. gmt psbasemap -R204/206/19/21 -JM4i -P -B1 -BWSne -K -X2.5i -Y1.25i > $ps
  21. gmt grdcontour BigIsland.nc -J -C1000 -T+d0.1i/0.02i+l -S8 -O -K --FONT_ANNOT_PRIMARY=9p >> $ps
  22. color_contour r
  23. gmt psscale -Ccontour.cpt -Dx2i/-0.35i+w4i/0.1i+h+jTC -B1 -O -K >> $ps
  24. # The top map will have contours oriented so that as you move along
  25. # them (color goes from red to blue) the higher topography will be to
  26. # your left (-Fl).
  27. gmt psbasemap -R -J -O -B1 -BWsNe -K -Y4.5i >> $ps
  28. gmt grdcontour BigIsland.nc -J -O -C1000 -T+d0.1i/0.02i+l -S8 -K --FONT_ANNOT_PRIMARY=9p >> $ps
  29. color_contour l
  30. gmt psxy -R -J -O -T >> $ps
Tip!

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

Comments

Loading...