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

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

Comments

Loading...