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

sample.sh 2.0 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
48
49
50
51
52
53
54
55
  1. #!/usr/bin/env bash
  2. #
  3. # Resampling of Cartesian and geographic tracks
  4. # Test the various -A modes for resampling (x,y) or (lon.lat) tracks
  5. ps=sample.ps
  6. RJ="-R-10/50/67/77 -JX6i"
  7. # Pick a few points; this is our track either as Cartesian or degrees
  8. cat << EOF > track.txt
  9. -5 74
  10. 43 76
  11. 42 73
  12. 44 73
  13. 38 68
  14. EOF
  15. #Cartesian resampling with small spacing
  16. gmt psxy track.txt $RJ -P -Sc0.2c -Ggreen -W0.25p -Baf -BWSne -K > $ps
  17. gmt psxy track.txt $RJ -O -K -W0.25p >> $ps
  18. # equidistant sampling as is
  19. gmt sample1d track.txt -I2c -Ar | gmt psxy $RJ -O -K -Sc0.1c -Gcyan >> $ps
  20. # equidistant sampling adjusted
  21. gmt sample1d track.txt -I2c -AR | gmt psxy $RJ -O -K -Sc0.1c -Gblack >> $ps
  22. # -Am sampling
  23. gmt sample1d track.txt -I0.1c -Am | gmt psxy $RJ -O -K -W0.25p,blue,- >> $ps
  24. # -Ap sampling
  25. gmt sample1d track.txt -I0.1c -Ap | gmt psxy $RJ -O -K -W0.25p,orange,- >> $ps
  26. #Geographic resampling with small spacing
  27. RJ="-R-10/50/67/77 -JM6i"
  28. gmt psxy track.txt $RJ -O -K -Sc0.2c -Ggreen -W0.25p -Baf -BWSne -Y6.5i >> $ps
  29. gmt psxy track.txt $RJ -O -K -W0.25p >> $ps
  30. # Loxodrome sampling
  31. gmt sample1d track.txt -I100k -AR+l | gmt psxy $RJ -O -K -W0.25p,red,- >> $ps
  32. # equidistant sampling as is
  33. gmt sample1d track.txt -I100k -Ar | gmt psxy $RJ -O -K -Sc0.1c -Gcyan >> $ps
  34. # equidistant sampling adjusted
  35. gmt sample1d track.txt -I100k -AR | gmt psxy $RJ -O -K -Sc0.1c -Gblack >> $ps
  36. # -Am sampling
  37. gmt sample1d track.txt -I10k -Am | gmt psxy $RJ -O -K -W0.25p,blue,- >> $ps
  38. # -Ap sampling
  39. gmt sample1d track.txt -I10k -Ap | gmt psxy $RJ -O -K -W0.25p,orange,- >> $ps
  40. # Geographic downsizing a dense line with coarse spacing
  41. gmt project -C20/73 -E35/68 -G30 -Q > tmp.txt
  42. gmt psxy $RJ -O -K tmp.txt -Sc0.1c -Ggreen >> $ps
  43. gmt sample1d tmp.txt -I100k -AR | gmt psxy $RJ -O -K -Sc0.2c -Gblack >> $ps
  44. gmt pstext -R0/6/0/4 -Jx1i -O -K -F+jLB+f14p,Courier << EOF >> $ps
  45. 0.2 0.2 BLACK LINE: psxy default
  46. 0.2 0.4 RED LINE: Loxodrome mode
  47. 0.2 0.6 BLUE LINE: -Am mode
  48. 0.2 0.8 ORANGE LINE: -Ap mode
  49. 0.2 1.0 GREEN PTS: Input
  50. 0.2 1.2 BLACK PTS: -AR mode
  51. 0.2 1.4 CYAN PTS: -Ar mode
  52. EOF
  53. gmt psxy $RJ -O -T >> $ps
Tip!

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

Comments

Loading...