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

oblmerc_up.sh 3.4 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
  1. #!/bin/bash
  2. # $Id$
  3. #
  4. # Tests mapproject for oblique Mercator -R-20/40/-15/65r -Joa-30/60/105/1:30000000
  5. gmt gmtset MAP_ANNOT_OBLIQUE 0 FORMAT_GEO_MAP dddF
  6. ps=oblmerc_up.ps
  7. lon=-30
  8. lat=60
  9. az_x=105
  10. az_y=`gmt gmtmath -Q $az_x 90 SUB =`
  11. plon=`gmt gmtvector -A$lon/$lat -Tp$az_x} | cut -f1`
  12. plat=`gmt gmtvector -A$lon/$lat -Tp$az_x} | cut -f2`
  13. scale=1:30000000
  14. scale_km=1:30000
  15. LL_lon=-56
  16. LL_lat=51
  17. UR_lon=20
  18. UR_lat=50
  19. # Find gmt projected coordinates of LL and UR points in desired gmt projection
  20. echo $LL_lon $LL_lat | gmt mapproject -C -R$LL_lon/$LL_lat/$UR_lon/${UR_lat}r -Joa${lon}/${lat}/${az_x}/$scale -Fk > tmp
  21. LL_x=`cut -f1 tmp`
  22. LL_y=`cut -f2 tmp`
  23. echo $UR_lon $UR_lat | gmt mapproject -C -R$LL_lon/$LL_lat/$UR_lon/${UR_lat}r -Joa${lon}/${lat}/${az_x}/$scale -Fk > tmp
  24. UR_x=`cut -f1 tmp`
  25. UR_y=`cut -f2 tmp`
  26. # Create rectangle in these gmt projected units
  27. xstart=`gmt gmtmath -Q $LL_x $UR_x MIN =`
  28. xstop=`gmt gmtmath -Q $LL_x $UR_x MAX =`
  29. ystart=`gmt gmtmath -Q $LL_y $UR_y MIN =`
  30. ystop=`gmt gmtmath -Q $LL_y $UR_y MAX =`
  31. gmt gmtmath -T$xstart/$xstop/101+ $LL_y = > box.xy
  32. gmt gmtmath -o1,0 -T$ystart/$ystop/101+ $UR_x = >> box.xy
  33. gmt gmtmath -I -T$xstart/$xstop/101+ $UR_y = >> box.xy
  34. gmt gmtmath -I -o1,0 -T$ystart/$ystop/101+ $LL_x = >> box.xy
  35. # Get back degrees
  36. gmt mapproject -C -R$LL_lon/$LL_lat/$UR_lon/${UR_lat}r -Joa${lon}/${lat}/${az_x}/$scale -I -Fk box.xy > box.d
  37. # Use -Joa to set origin and azimuth.
  38. gmt psxy -Rg -JG0/80/6i -Bafg30 box.d -Glightgreen -W0.5p -P -K -Xc -Y4.25i > $ps
  39. gmt psbasemap -R -J -Bafg30 -B+o${plon}/${plat} -O -K --MAP_GRID_PEN_PRIMARY=0.25p,. >> $ps
  40. echo $lon $lat 0 200 200 | gmt psxy -R -J -O -K -SE -Gblack >> $ps
  41. gmt project -C$lon/$lat -G25 -A$az_x -L-20000/20000 -Q | gmt psxy -R -J -O -K -W0.5p,blue >> $ps
  42. gmt project -C$lon/$lat -G25 -A$az_y -L-20000/20000 -Q | gmt psxy -R -J -O -K -W0.5p,blue >> $ps
  43. echo $lon $lat $az_x 800 | gmt psxy -R -J -O -K -S=0.1i+e -Gred -W0.5p,red --MAP_VECTOR_SHAPE=0.5 >> $ps
  44. echo $lon $lat $az_y 800 | gmt psxy -R -J -O -K -S=0.1i+e -Gred -W0.5p,red --MAP_VECTOR_SHAPE=0.5 >> $ps
  45. echo $plon $plat 0 200 200 | gmt psxy -R -J -O -K -SE -Gred >> $ps
  46. gmt pstext -R -J -O -K -F+f12p+j+a-50 -Dj0.1i << EOF >> $ps
  47. -19 55 CM x
  48. -31 66 CM y
  49. 129 26 CM P
  50. $LL_lon $LL_lat RB LL
  51. $UR_lon $UR_lat TL UR
  52. EOF
  53. echo $LL_lon $LL_lat 0 150 150 | gmt psxy -R -J -O -K -SE -Gblue >> $ps
  54. echo $UR_lon $UR_lat 0 150 150 | gmt psxy -R -J -O -K -SE -Gblue >> $ps
  55. #
  56. gmt psbasemap -R$LL_lon/$LL_lat/$UR_lon/${UR_lat}r -Joa${lon}/${lat}/${az_x}/$scale -O -K -Bafg -BWS+glightgreen -Y-3.5i >> $ps
  57. gmt project -C$lon/$lat -G25 -A$az_x -L-20000/20000 -Q | gmt psxy -R -J -O -K -W0.5p,blue >> $ps
  58. gmt project -C$lon/$lat -G25 -A$az_y -L-2000/2000 -Q | gmt psxy -R -J -O -K -W0.5p,blue >> $ps
  59. echo $lon $lat 0 100 100 | gmt psxy -R -J -O -K -SE -Gblack >> $ps
  60. echo $lon $lat $az_x 800 | gmt psxy -R -J -O -K -S=0.15i+e -Gred -W1p,red --MAP_VECTOR_SHAPE=0.5 >> $ps
  61. echo $lon $lat $az_y 800 | gmt psxy -R -J -O -K -S=0.15i+e -Gred -W1p,red --MAP_VECTOR_SHAPE=0.5 >> $ps
  62. echo $LL_lon $LL_lat 0 150 150 | gmt psxy -R -J -O -K -SE -Gblue >> $ps
  63. echo $UR_lon $UR_lat 0 150 150 | gmt psxy -R -J -O -K -SE -Gblue >> $ps
  64. gmt pstext -R -J -O -K -F+f12p+j -Dj0.1i -N << EOF >> $ps
  65. -19 57 CM x
  66. -29 66 CM y
  67. $LL_lon $LL_lat RB LL
  68. $UR_lon $UR_lat TL UR
  69. EOF
  70. gmt psbasemap -R$LL_x/$LL_y/$UR_x/${UR_y}r -Jx$scale_km -O -K -Bafg -BNE --MAP_GRID_PEN_PRIMARY=0.25p,. >> $ps
  71. echo "0 9.5 az = $az_x" | gmt pstext -R0/8/0/10 -Jx1i -O -K -F+f24p+jTL >> $ps
  72. gmt psxy -R -J -O -T >> $ps
Tip!

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

Comments

Loading...