Skip to content

Commit 6503fc0

Browse files
committed
Add a map and a script to contour_and_profile.html
1 parent 1203b4d commit 6503fc0

21 files changed

Lines changed: 586 additions & 24 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
_build/*
22
_build
33
*~
4-
4+
todolist.txt

README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
GMT 教學手冊 (GMT Tutorials)
2-
========================================
2+
==========================================
33

44
`網站 (中文) <http://gmt-tutorials.org>`_
55

66
`Website (English) <http://gmt-tutorials.org/en/>`_
77

88
.. figure:: by.png
99
:scale: 30
10-
:align: center
10+
:align: left
1111

1212
有關於此儲存庫 (About This Repository)
13-
========================================
13+
==========================================
1414

1515
這裡為「GMT 教學手冊」網站的文本檔,以 *re*\ **Structured**\ :sup:`Text` 格式撰寫而成,\
1616
再以 `Sphinx <http://www.sphinx-doc.org/en/stable/index.html>`_ 建立。
@@ -37,7 +37,7 @@ Sphinx itself and all related Python modules are installed through
3737
- ``locale/en/``: English translation files
3838

3939
簡介 (Introduction)
40-
========================================
40+
==========================================
4141

4242
**GMT** (**Generic Mapping Tools**, 通常譯成「**通用製圖工具**」) 是一套開放的地理繪圖軟體。與一般\
4343
的地理繪圖軟體如 QGIS、ArcGIS 最大的不同是,GMT 完全可以在命令列介面底下運行。對於有大量\
@@ -72,7 +72,7 @@ below any chapters, or send it to `me <https://www.facebook.com/whyjz>`_ at any
7272
I hope you guys could enjoy the fun plotting using GMT from this tutorials!
7373

7474
編譯文本 (How to build the files to html)
75-
========================================
75+
==========================================
7676

7777
.. code-block:: bash
7878

conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# Add any Sphinx extension module names here, as strings. They can be
3434
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3535
# ones.
36-
extensions = []
36+
extensions = ['sphinx.ext.mathjax']
3737

3838
# Add any paths that contain templates here, relative to this directory.
3939
templates_path = ['_templates']
@@ -78,7 +78,7 @@
7878

7979
# List of patterns, relative to source directory, that match files and
8080
# directories to ignore when looking for source files.
81-
exclude_patterns = ['_build']
81+
exclude_patterns = ['_build', 'README.rst']
8282

8383
# The reST default role (used for this markup: `text`) to use for all
8484
# documents.
@@ -359,4 +359,4 @@
359359

360360
# -- Options for i18n (sphinx-intl) ----------------------------------------------
361361
locale_dirs = ['locale/']
362-
gettext_compact = False
362+
gettext_compact = False

contour_and_profile.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
目標
99
--------------------------------------
1010

11+
.. _最終版地圖:
12+
13+
.. image:: contour_and_profile/mayon.png
14+
15+
直接觀看\ `指令稿`_
16+
1117

1218
使用的指令與概念
1319
--------------------------------------
@@ -23,7 +29,77 @@
2329

2430
指令稿
2531
--------------------------------------
32+
本地圖的最終指令稿如下:
33+
34+
.. code-block:: bash
35+
36+
# ==== parameter ====
37+
out_ps="mayon.ps"
38+
in_tif="n13_e123_1arc_v3.tif"
39+
in_grd="n13_e123_1arc_v3.grd"
40+
master_cpt="neutral.cpt"
41+
in_cpt="mayon.cpt"
42+
in_shadow="mayon_shade.grd"
43+
in_track="mayon_track.xy"
44+
pen="thick,black"
45+
pen_grid="thick,black,--"
46+
pen_track="thick,darkred"
47+
font="14p,25,black"
48+
font_title="24p,25,black"
49+
font_text="14p,25,darkred"
50+
font_contour="8p,25,darkred"
51+
52+
# ==== Transfer ====
53+
gdal_translate $in_tif -of NetCDF $in_grd
54+
55+
# ==== Make input files ====
56+
grdgradient $in_grd -G$in_shadow -A280 -Nt0.5
57+
grd2cpt $in_grd -C$master_cpt -Z > $in_cpt
58+
59+
# ==== Configuration ====
60+
gmtset MAP_FRAME_TYPE=plain \
61+
FORMAT_GEO_MAP=dddmmF \
62+
FONT_ANNOT_PRIMARY=$font \
63+
FONT_LABEL=$font \
64+
FONT_TITLE=$font_title \
65+
MAP_GRID_PEN_PRIMARY=$pen_grid \
66+
MAP_TICK_PEN_PRIMARY=$pen \
67+
MAP_TICK_PEN_SECONDARY=$pen
68+
69+
# ==== Open Door ====
70+
psxy -R0/1/0/1 -JX1c -T -K -P > $out_ps
71+
72+
# ==== Contour Map ====
73+
grdimage $in_grd -R123:30E/123:50E/13:10N/13:21N -JM15c -O -K -C$in_cpt -I$in_shadow -Y10c >> $out_ps
74+
pscoast -R -J -O -K -Df -Sgray -Wthin >> $out_ps
75+
grdcontour $in_grd -R -J -O -K -C100 -Q100 -A500+f$font_contour+o >> $out_ps
76+
77+
project -C123.613/13.2236 -E123.756/13.2862 -G0.1 -Q |\
78+
grdtrack -G$in_grd > $in_track
79+
# You may also want to use bash built-in "cut -f3,4"
80+
81+
psxy $in_track -R -J -O -K -W$pen_track >> $out_ps
82+
pstext -R -J -O -K -F+j+f$font_text >> $out_ps << TEXTEND
83+
123.613 13.2236 RT A
84+
123.756 13.2862 LT B
85+
TEXTEND
86+
psbasemap -R -J -O -K -Ba10m -B+t"Mayon Volcano" >> $out_ps
87+
88+
# ==== Profile ====
89+
R=$(gmtinfo $in_track -i2,3 -I1/100)
90+
psxy $in_track -i2,3 $R -JX15c/6c -O -K -W$pen_track -Y-8c >> $out_ps
91+
psbasemap -R -J -O -K -BNE -Bxa5f1 -Bya1000f500g1000 >> $out_ps
92+
psbasemap -R -J -O -K -BWS -Bxa5f1+l"Distance of A-B profile (km)" -Bya1000+l"Height (m)" >> $out_ps
93+
94+
# ==== Close door ====
95+
psxy -R -J -O -T >> $out_ps
96+
# rm -rf gmt.conf
97+
98+
.. note::
99+
100+
「」
26101
102+
觀看\ `最終版地圖`_
27103
28104
習題
29105
--------------------------------------
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# ==== parameter ====
2+
out_ps="mayon.ps"
3+
in_tif="n13_e123_1arc_v3.tif"
4+
in_grd="n13_e123_1arc_v3.grd"
5+
master_cpt="neutral.cpt"
6+
in_cpt="mayon.cpt"
7+
in_shadow="mayon_shade.grd"
8+
in_track="mayon_track.xy"
9+
pen="thick,black"
10+
pen_grid="thick,black,--"
11+
pen_track="thick,darkred"
12+
font="14p,25,black"
13+
font_title="24p,25,black"
14+
font_text="14p,25,darkred"
15+
font_contour="8p,25,darkred"
16+
17+
# ==== Transfer ====
18+
gdal_translate $in_tif -of NetCDF $in_grd
19+
20+
# ==== Make input files ====
21+
grdgradient $in_grd -G$in_shadow -A280 -Nt0.5
22+
grd2cpt $in_grd -C$master_cpt -Z > $in_cpt
23+
24+
# ==== Configuration ====
25+
gmtset MAP_FRAME_TYPE=plain \
26+
FORMAT_GEO_MAP=dddmmF \
27+
FONT_ANNOT_PRIMARY=$font \
28+
FONT_LABEL=$font \
29+
FONT_TITLE=$font_title \
30+
MAP_GRID_PEN_PRIMARY=$pen_grid \
31+
MAP_TICK_PEN_PRIMARY=$pen \
32+
MAP_TICK_PEN_SECONDARY=$pen
33+
34+
# ==== Open Door ====
35+
psxy -R0/1/0/1 -JX1c -T -K -P > $out_ps
36+
37+
# ==== Contour Map ====
38+
grdimage $in_grd -R123:30E/123:50E/13:10N/13:21N -JM15c -O -K -C$in_cpt -I$in_shadow -Y10c >> $out_ps
39+
pscoast -R -J -O -K -Df -Sgray -Wthin >> $out_ps
40+
grdcontour $in_grd -R -J -O -K -C100 -Q100 -A500+f$font_contour+o >> $out_ps
41+
42+
project -C123.613/13.2236 -E123.756/13.2862 -G0.1 -Q |\
43+
grdtrack -G$in_grd > $in_track
44+
# You may also want to use bash built-in "cut -f3,4"
45+
46+
psxy $in_track -R -J -O -K -W$pen_track >> $out_ps
47+
pstext -R -J -O -K -F+j+f$font_text >> $out_ps << TEXTEND
48+
123.613 13.2236 RT A
49+
123.756 13.2862 LT B
50+
TEXTEND
51+
psbasemap -R -J -O -K -Ba10m -B+t"Mayon Volcano" >> $out_ps
52+
53+
# ==== Profile ====
54+
R=$(gmtinfo $in_track -i2,3 -I1/100)
55+
psxy $in_track -i2,3 $R -JX15c/6c -O -K -W$pen_track -Y-8c >> $out_ps
56+
psbasemap -R -J -O -K -BNE -Bxa5f1 -Bya1000f500g1000 >> $out_ps
57+
psbasemap -R -J -O -K -BWS -Bxa5f1+l"Distance of A-B profile (km)" -Bya1000+l"Height (m)" >> $out_ps
58+
59+
# ==== Close door ====
60+
psxy -R -J -O -T >> $out_ps
61+
# rm -rf gmt.conf

contour_and_profile/mayon.png

1.83 MB
Loading

contour_and_profile/mayon.ps

2.04 MB
Binary file not shown.

contour_and_profile/mayon_track.xy

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
123.613 13.2236 0 181.307738624
2+
123.613842421 13.2239691076 0.1 188.260577788
3+
123.614684845 13.2243382124 0.2 191.580201564
4+
123.615527271 13.2247073145 0.3 195.183921513
5+
123.6163697 13.2250764138 0.4 197.771070118
6+
123.617212132 13.2254455104 0.5 208.638871238
7+
123.618054566 13.2258146042 0.6 211.939706797
8+
123.618897002 13.2261836952 0.7 216.312372526
9+
123.619739441 13.2265527835 0.8 221.228862451
10+
123.620581883 13.2269218691 0.9 227.878485907
11+
123.621424327 13.2272909518 1 232.001759029
12+
123.622266774 13.2276600318 1.1 237.888382657
13+
123.623109223 13.2280291091 1.2 242.119113399
14+
123.623951675 13.2283981836 1.3 249.101999521
15+
123.624794129 13.2287672553 1.4 258.291069589
16+
123.625636586 13.2291363243 1.5 259.4656658
17+
123.626479046 13.2295053905 1.6 265.689834133
18+
123.627321508 13.2298744539 1.7 268.160894281
19+
123.628163972 13.2302435146 1.8 268.65105497
20+
123.629006439 13.2306125726 1.9 277.225450592
21+
123.629848909 13.2309816277 2 286.670701544
22+
123.630691381 13.2313506802 2.1 294.7236011
23+
123.631533856 13.2317197298 2.2 301.669434381
24+
123.632376333 13.2320887767 2.3 308.646533867
25+
123.633218813 13.2324578208 2.4 321.202611935
26+
123.634061296 13.2328268622 2.5 331.53720383
27+
123.634903781 13.2331959008 2.6 335.968528689
28+
123.635746268 13.2335649367 2.7 342.838357551
29+
123.636588758 13.2339339698 2.8 353.33435963
30+
123.637431251 13.2343030001 2.9 366.048446737
31+
123.638273746 13.2346720277 3 379.16947931
32+
123.639116244 13.2350410525 3.1 390.758014562
33+
123.639958744 13.2354100745 3.2 402.856412701
34+
123.640801247 13.2357790938 3.3 413.308892489
35+
123.641643753 13.2361481103 3.4 424.984409028
36+
123.642486261 13.2365171241 3.5 448.577786604
37+
123.643328771 13.2368861351 3.6 466.418423864
38+
123.644171284 13.2372551433 3.7 477.040760966
39+
123.6450138 13.2376241488 3.8 484.566913892
40+
123.645856318 13.2379931515 3.9 495.995273071
41+
123.646698839 13.2383621515 4 508.470998251
42+
123.647541362 13.2387311487 4.1 522.930107466
43+
123.648383888 13.2391001431 4.2 533.938310562
44+
123.649226416 13.2394691348 4.3 551.085931025
45+
123.650068947 13.2398381237 4.4 560.234636679
46+
123.650911481 13.2402071098 4.5 577.810702123
47+
123.651754017 13.2405760932 4.6 592.838749946
48+
123.652596555 13.2409450739 4.7 596.554507394
49+
123.653439097 13.2413140517 4.8 609.876261983
50+
123.65428164 13.2416830268 4.9 635.853550506
51+
123.655124187 13.2420519992 5 648.960775389
52+
123.655966735 13.2424209687 5.1 671.00069506
53+
123.656809287 13.2427899355 5.2 690.397518754
54+
123.657651841 13.2431588996 5.3 703.661061724
55+
123.658494397 13.2435278609 5.4 729.152655925
56+
123.659336956 13.2438968194 5.5 750.671123532
57+
123.660179518 13.2442657751 5.6 768.876565684
58+
123.661022082 13.2446347281 5.7 796.927126554
59+
123.661864649 13.2450036784 5.8 829.280090132
60+
123.662707218 13.2453726258 5.9 872.668717564
61+
123.66354979 13.2457415705 6 917.14589462
62+
123.664392364 13.2461105125 6.1 943.426473474
63+
123.665234941 13.2464794517 6.2 988.736690578
64+
123.66607752 13.2468483881 6.3 1036.6711896
65+
123.666920103 13.2472173217 6.4 1075.37777491
66+
123.667762687 13.2475862526 6.5 1106.12124982
67+
123.668605274 13.2479551807 6.6 1154.28362809
68+
123.669447864 13.2483241061 6.7 1202.71500711
69+
123.670290456 13.2486930287 6.8 1246.07785577
70+
123.671133051 13.2490619485 6.9 1302.18060631
71+
123.671975648 13.2494308656 7 1365.51824177
72+
123.672818248 13.2497997799 7.1 1418.54489845
73+
123.673660851 13.2501686914 7.2 1485.18062721
74+
123.674503456 13.2505376002 7.3 1544.59316015
75+
123.675346063 13.2509065062 7.4 1613.16765659
76+
123.676188673 13.2512754095 7.5 1662.16632497
77+
123.677031286 13.2516443099 7.6 1719.6534914
78+
123.677873901 13.2520132076 7.7 1794.31421052
79+
123.678716519 13.2523821026 7.8 1854.65073937
80+
123.679559139 13.2527509948 7.9 1924.55821926
81+
123.680401762 13.2531198842 8 1991.64544124
82+
123.681244388 13.2534887708 8.1 2069.20209575
83+
123.682087016 13.2538576547 8.2 2125.64366511
84+
123.682929646 13.2542265359 8.3 2209.27279743
85+
123.68377228 13.2545954142 8.4 2299.72703997
86+
123.684614915 13.2549642898 8.5 2372.93948885
87+
123.685457553 13.2553331626 8.6 2421.24567896
88+
123.686300194 13.2557020327 8.7 2422.78332276
89+
123.687142838 13.2560709 8.8 2372.68909667
90+
123.687985484 13.2564397645 8.9 2292.35226402
91+
123.688828132 13.2568086263 9 2231.57719004
92+
123.689670783 13.2571774853 9.1 2158.31875251
93+
123.690513437 13.2575463415 9.2 2075.50449254
94+
123.691356093 13.257915195 9.3 2019.80248947
95+
123.692198751 13.2582840457 9.4 1948.67050702
96+
123.693041413 13.2586528936 9.5 1869.57173546
97+
123.693884076 13.2590217388 9.6 1807.92628263
98+
123.694726743 13.2593905811 9.7 1745.05882596
99+
123.695569412 13.2597594208 9.8 1667.41548954
100+
123.696412083 13.2601282576 9.9 1615.98345134
101+
123.697254757 13.2604970917 10 1557.4397614
102+
123.698097434 13.2608659231 10.1 1487.42357486
103+
123.698940113 13.2612347516 10.2 1435.98046655
104+
123.699782795 13.2616035774 10.3 1384.08431119
105+
123.700625479 13.2619724005 10.4 1341.87651729
106+
123.701468166 13.2623412207 10.5 1292.9665938
107+
123.702310855 13.2627100382 10.6 1238.67428674
108+
123.703153547 13.2630788529 10.7 1202.1770187
109+
123.703996242 13.2634476649 10.8 1153.89710736
110+
123.704838939 13.2638164741 10.9 1122.12049848
111+
123.705681638 13.2641852805 11 1062.96113038
112+
123.70652434 13.2645540842 11.1 1013.47970072
113+
123.707367045 13.264922885 11.2 967.686678847
114+
123.708209752 13.2652916832 11.3 924.277252096
115+
123.709052462 13.2656604785 11.4 890.831576722
116+
123.709895174 13.2660292711 11.5 858.751453996
117+
123.710737889 13.2663980609 11.6 830.299261768
118+
123.711580607 13.2667668479 11.7 803.893435772
119+
123.712423327 13.2671356322 11.8 785.090505897
120+
123.71326605 13.2675044137 11.9 758.70554362
121+
123.714108775 13.2678731925 12 734.557773435
122+
123.714951503 13.2682419684 12.1 702.054401024
123+
123.715794233 13.2686107416 12.2 674.650816646
124+
123.716636966 13.2689795121 12.3 646.060486184
125+
123.717479701 13.2693482797 12.4 628.334600951
126+
123.718322439 13.2697170446 12.5 610.301782018
127+
123.71916518 13.2700858068 12.6 590.322165725
128+
123.720007923 13.2704545661 12.7 574.789436324
129+
123.720850668 13.2708233227 12.8 542.637789431
130+
123.721693416 13.2711920765 12.9 523.303712485
131+
123.722536167 13.2715608276 13 510.03317873
132+
123.723378921 13.2719295758 13.1 495.932269087
133+
123.724221676 13.2722983213 13.2 490.982646011
134+
123.725064435 13.2726670641 13.3 479.211642693
135+
123.725907196 13.273035804 13.4 465.395994113
136+
123.726749959 13.2734045412 13.5 457.267590847
137+
123.727592725 13.2737732757 13.6 445.65121765
138+
123.728435494 13.2741420073 13.7 435.61524152
139+
123.729278265 13.2745107362 13.8 419.619285163
140+
123.730121039 13.2748794623 13.9 408.259412849
141+
123.730963816 13.2752481857 14 394.379886042
142+
123.731806594 13.2756169063 14.1 387.277627607
143+
123.732649376 13.2759856241 14.2 374.931616347
144+
123.73349216 13.2763543391 14.3 365.110957491
145+
123.734334946 13.2767230514 14.4 354.74825855
146+
123.735177736 13.2770917608 14.5 341.03118875
147+
123.736020527 13.2774604676 14.6 328.706439781
148+
123.736863322 13.2778291715 14.7 315.991090189
149+
123.737706118 13.2781978727 14.8 303.003540852
150+
123.738548918 13.2785665711 14.9 299.929611162
151+
123.73939172 13.2789352667 15 295.002025633
152+
123.740234524 13.2793039596 15.1 287.776849939
153+
123.741077331 13.2796726497 15.2 275.760493758
154+
123.741920141 13.280041337 15.3 272.341621248
155+
123.742762953 13.2804100216 15.4 266.653022264
156+
123.743605768 13.2807787034 15.5 252.785768917
157+
123.744448585 13.2811473824 15.6 244.025040556
158+
123.745291405 13.2815160586 15.7 241.618371163
159+
123.746134227 13.2818847321 15.8 232.091861845
160+
123.746977052 13.2822534027 15.9 220.203019568
161+
123.74781988 13.2826220707 16 212.987983646
162+
123.74866271 13.2829907358 16.1 204.621450168
163+
123.749505543 13.2833593982 16.2 194.255702638
164+
123.750348378 13.2837280578 16.3 186.309012273
165+
123.751191216 13.2840967146 16.4 182.801601845
166+
123.752034056 13.2844653687 16.5 178.377659728
167+
123.752876899 13.28483402 16.6 176.159425536
168+
123.753719744 13.2852026685 16.7 163.520140719
169+
123.754562592 13.2855713142 16.8 156.926263817
170+
123.755405443 13.2859399572 16.9 151.899995259
171+
123.756 13.2862 16.9705410195 150.632902656
24.8 MB
Binary file not shown.

0 commit comments

Comments
 (0)