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

cyltest.sh 2.5 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
43
44
45
46
47
  1. #!/usr/bin/env bash
  2. #
  3. # Computes the gravity and VGG anomaly over a cylinder and compares
  4. # with theory and brute (sum of tiny cubes) results in cylinder25.txt
  5. ps=cyltest.ps
  6. # cylinder_mod.txt was made thus:
  7. #cylinder 25 10 10 1333 5084
  8. # Make a 1st order correction for the fact that the cubes extend 12.5 meter outside given limits.
  9. # This works out to a factor of 0.992386602589:
  10. data=$(gmt which -G @cylinder25.txt)
  11. corr=$(gmt math -Q 25000 2 POW 5084 1333 SUB MUL 25000 25 2 DIV ADD 2 POW 5084 1333 SUB 25 ADD MUL DIV =)
  12. gmt math -T-100/100/1 0 = trk
  13. gmt talwani3d @cylinder_mod.txt -D1670 -Mh -Ntrk -o0,3 > faa.txt
  14. gmt talwani3d @cylinder_mod.txt -D1670 -Mh -Ntrk -o0,3 -Fv > vgg.txt
  15. gmt math -T-100/250/350 -25 = > tmp
  16. gmt math -T-100/250/350 -I 25 = >> tmp
  17. gmt psxy -R-100/100/-100/250 -JX6i/6i -P -Glightgray tmp -i1,0 -K -Xc -Y4i > $ps
  18. awk '{print $1, $3*'"$corr"'}' $data | gmt psxy -R-100000/100000/-100/250 -J -Wfaint,blue -O -K >> $ps
  19. awk '{print $1, $3*'"$corr"'}' $data | gmt psxy -R -J -Sc0.1c -Gblue -O -K >> $ps
  20. awk '{print $1, $2*'"$corr"'}' $data | gmt psxy -R -J -Sc0.1c -Gred -O -K >> $ps
  21. gmt psxy -R-100/100/-100/250 -J faa.txt -W0.25p,red -O -K -Bxafg1000 -Byafg1000 -BWsne+t"Testing FAA and VGG over cylinder" >> $ps
  22. # Exact value over top at x = 0 only
  23. gmt math -T-100/100/200 2 PI MUL 6.673e-6 MUL 1670 MUL 5084 1333 SUB 1333 25000 HYPOT ADD 5084 25000 HYPOT SUB MUL = tmp
  24. gmt psxy -R -J -O -K tmp -W0.5p,- >> $ps
  25. gmt psxy -R -J -O -K vgg.txt -W0.5p,darkgreen >> $ps
  26. cat << EOF > legend.txt
  27. S 0.2i - 0.3i - 0.5p,- 0.5i FAA (at x = 0)
  28. S 0.2i c 0.05i red - 0.5i FAA (brute force)
  29. S 0.2i c 0.05i blue - 0.5i VGG (brute force)
  30. S 0.2i - 0.3i - 1.5p,red 0.5i FAA (Talwani)
  31. S 0.2i - 0.3i - 1.5p,darkgreen 0.5i VGG
  32. EOF
  33. gmt pslegend -R -J -O -K -DjTL+w2i+jTL+o0.1i/0.1i legend.txt -F+gwhite+p >> $ps
  34. # Plot cylinder
  35. gmt psxy -R-100/100/0/5084 -JX6i/-2.5i -O -K -Y-2.75i -Gblack -Bxafg1000+u" km" -Byaf -BWSne << EOF >> $ps
  36. -25 5084
  37. 25 5084
  38. 25 1333
  39. -25 1333
  40. EOF
  41. echo 30 1333 30 5084 | gmt psxy -R -J -O -K -Sv0.2i+bt+et+s -W0.5p >> $ps
  42. echo -25 1000 25 1000 | gmt psxy -R -J -O -K -Sv0.2i+bt+et+s -W0.5p >> $ps
  43. echo 0 2500 @~Dr = 1670@~ | gmt pstext -R -J -O -K -F+f18p,Helvetica,white+jCM >> $ps
  44. echo 0 1000 d = 50 km | gmt pstext -R -J -O -K -F+f14p,Times-Italic+jCM -Gwhite >> $ps
  45. echo 30 3208.5 3751 m | gmt pstext -R -J -O -K -F+f14p,Times-Italic+jCM+a90 -Gwhite >> $ps
  46. echo 32 1333 z@-1@- = 1333 m | gmt pstext -R -J -O -K -F+f14p,Times-Italic+jLM -Dj0.1i/0.1i >> $ps
  47. echo 32 5084 z@-2@- = 5084 m | gmt pstext -R -J -O -F+f14p,Times-Italic+jLB -Dj0.1i/0.1i >> $ps
Tip!

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

Comments

Loading...