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

ex29.sh 1.7 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. # GMT EXAMPLE 29
  3. #
  4. # Purpose: Illustrates spherical surface gridding with Green's function of splines
  5. # GMT modules: makecpt, grdcontour, grdimage, grdmath greenspline, colorbar, text
  6. # Unix progs: rm
  7. #
  8. gmt begin ex29
  9. # This example uses 370 radio occultation data for Mars to grid the topography.
  10. # Data and information from Smith, D. E., and M. T. Zuber (1996), The shape of
  11. # Mars and the topographic signature of the hemispheric dichotomy, Science, 271, 184-187.
  12. # Make Mars PROJ_ELLIPSOID given their three best-fitting axes:
  13. a=3399.472
  14. b=3394.329
  15. c=3376.502
  16. gmt grdmath -Rg -I4 -r X COSD $a DIV DUP MUL X SIND $b DIV DUP MUL ADD Y COSD DUP MUL MUL Y \
  17. SIND $c DIV DUP MUL ADD SQRT INV = PROJ_ELLIPSOID.nc
  18. # Do both Parker and Wessel/Becker solutions (tension = 0.9975)
  19. gmt greenspline -RPROJ_ELLIPSOID.nc @mars370.txt -Z4 -Sp -Gmars.nc
  20. gmt greenspline -RPROJ_ELLIPSOID.nc @mars370.txt -Z4 -Sq0.9975 -Gmars2.nc
  21. # Scale to km and remove PROJ_ELLIPSOID
  22. gmt grdmath mars.nc 1000 DIV PROJ_ELLIPSOID.nc SUB = mars.nc
  23. gmt grdmath mars2.nc 1000 DIV PROJ_ELLIPSOID.nc SUB = mars2.nc
  24. gmt set FONT_TAG 14p,Helvetica-Bold
  25. gmt subplot begin 2x1 -Fs18c/0 -Rg -JH0/18c -B30g30 -BWsne -A -M0.6c
  26. gmt subplot set 0
  27. gmt grdimage mars.nc -I+ne0.75+a45 --FONT_ANNOT_PRIMARY=12p
  28. gmt grdcontour mars.nc -C1 -A5 -Glz+/z-
  29. gmt plot -Sc0.1c -Gblack @mars370.txt
  30. gmt colorbar -DJBC+o0/0.4c+w6i/0.25c -I --FONT_ANNOT_PRIMARY=12p -Bx2f1 -By+lkm
  31. gmt subplot set 1
  32. gmt makecpt -Crainbow -T-7/15
  33. gmt grdimage mars2.nc -I+ne0.75+a45 --FONT_ANNOT_PRIMARY=12p
  34. gmt grdcontour mars2.nc -C1 -A5 -Glz+/z-
  35. gmt plot -Sc0.1c -Gblack @mars370.txt
  36. gmt subplot end
  37. rm -f mars.nc mars2.nc PROJ_ELLIPSOID.nc
  38. gmt end show
Tip!

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

Comments

Loading...