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

gspline_5.sh 2.1 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. # GMT_KNOWN_FAILURE_WINDOWS
  4. #
  5. ps=gspline_5.ps
  6. # Figures 2+3 in Wessel, P., and J. M. Becker (2008), Interpolation using a
  7. # Generalized Green's Function for a Spherical Surface Spline in Tension,
  8. # Geophys. J. Int., 174, 21-28.
  9. data=$(gmt which -G @mag_obs_1990.txt)
  10. # First find Parker's solution for no tension:
  11. gmt greenspline -Rg -I1 $data -Sp -GFig_2_p0.nc
  12. # Then repeat but use the wrong Oslo longitude to recreate Parker's original figure in his book
  13. $AWK '{if ($1 == 10.45) {print 104.5, $2, $3} else {print $0}}' $data > tmp
  14. gmt greenspline -Rg -I1 tmp -Sp -GFig_2_orig.nc
  15. gmt pscoast -R0/360/0/90 -JA0/90/5i -P -Glightgray -K -B30 -Y5.5i --MAP_FRAME_WIDTH=0.025i \
  16. --FORMAT_GEO_MAP=dddF --FONT_ANNOT_PRIMARY=10p -X0.5 > $ps
  17. echo 0 90 | gmt psxy -R -J -O -K -Sx0.1i -W0.5p >> $ps
  18. gmt grdcontour -R Fig_2_p0.nc -J -O -K -Z+s0.001 -C5 -A10 -Gl195/0/0/90,0/90/295/0 >> $ps
  19. gmt grdcontour -R Fig_2_orig.nc -J -O -K -Z+s0.001 -C5 -A10 -Wa0.75p,- -Wc0.25p,. -Gl160/0/270/80,270/80/340/0 >> $ps
  20. gmt psxy -R -J -O -K $data -Sc0.1i -Gblack >> $ps
  21. gmt psxy -R -J -O -K $data -Sc0.025i -Gwhite >> $ps
  22. gmt psxy -R -J -O -K @mag_validate_1990.txt -Sc0.1i -Gwhite -W0.25p >> $ps
  23. gmt psxy -R -J -O -K @mag_validate_1990.txt -Sc0.025i -Gblack >> $ps
  24. echo 104.50 59.92 | gmt psxy -R -J -O -K -Sc0.1i -Gwhite -W0.25p >> $ps
  25. echo 104.50 59.92 | gmt psxy -R -J -O -K -Sx0.1i -W1p >> $ps
  26. echo 104.50 59.92 -42 1.65 | gmt psxy -R -J -O -K -SV0.1i+e+h0.5 -W1p -Gblack >> $ps
  27. # Repeat for Wessel&Becker's solution with t = 0.99
  28. gmt greenspline -Rg -I1 $data -Sq0.99 -GFig_2_p5.nc
  29. gmt pscoast -R0/360/0/90 -J -O -Glightgray -K -B30 -X2.5i -Y-5i --MAP_FRAME_WIDTH=0.025i \
  30. --FORMAT_GEO_MAP=dddF --FONT_ANNOT_PRIMARY=10 >> $ps
  31. echo 0 90 | gmt psxy -R -J -O -K -Sx0.1i -W0.5p >> $ps
  32. gmt grdcontour -R Fig_2_p5.nc -J -O -K -Z+s0.001 -C5 -A10 -Gl335/0/0/90,0/90/155/0 >> $ps
  33. gmt psxy -R -J -O -K $data -Sc0.1i -Gblack >> $ps
  34. gmt psxy -R -J -O -K $data -Sc0.025i -Gwhite >> $ps
  35. gmt psxy -R -J -O -K @mag_validate_1990.txt -Sc0.1i -Gwhite -W0.25p >> $ps
  36. gmt psxy -R -J -O @mag_validate_1990.txt -Sc0.025i -Gblack >> $ps
Tip!

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

Comments

Loading...