Skip to content

Commit 7e9c753

Browse files
committed
Add a first PyGMT script and its binder link
1 parent 27a6de1 commit 7e9c753

5 files changed

Lines changed: 155 additions & 76 deletions

File tree

SOURCE_DOCS/locale/en_US/LC_MESSAGES/basic_concept.po

Lines changed: 55 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,34 @@ msgid ""
33
msgstr ""
44
"Project-Id-Version: GMT 教學手冊 1.2\n"
55
"Report-Msgid-Bugs-To: \n"
6-
"POT-Creation-Date: 2021-02-23 11:56-0500\n"
6+
"POT-Creation-Date: 2021-03-04 22:05-0500\n"
77
"PO-Revision-Date: 2021-02-23 21:54+0000\n"
88
"Last-Translator: Whyjay Zheng <wz278@cornell.edu>\n"
9-
"Language-Team: English (United States) <https://hosted.weblate.org/projects/"
10-
"gmt-tutorials/basic-concept/en_US/>\n"
119
"Language: en_US\n"
10+
"Language-Team: English (United States) "
11+
"<https://hosted.weblate.org/projects/gmt-tutorials/basic-concept/en_US/>"
12+
"\n"
13+
"Plural-Forms: nplurals=2; plural=n != 1\n"
1214
"MIME-Version: 1.0\n"
1315
"Content-Type: text/plain; charset=utf-8\n"
1416
"Content-Transfer-Encoding: 8bit\n"
15-
"Plural-Forms: nplurals=2; plural=n != 1;\n"
16-
"X-Generator: Weblate 4.5\n"
1717
"Generated-By: Babel 2.9.0\n"
1818

1919
#: ../../SOURCE_DOCS/basic_concept.rst:3
2020
msgid "基本概念與名詞"
2121
msgstr "Basic Concepts and Terms"
2222

2323
#: ../../SOURCE_DOCS/basic_concept.rst:5
24+
#, fuzzy
2425
msgid ""
25-
"GMT 是建立在擬 UNIX 環境之下的軟體,對於曾經接觸過 shell 或 cmd "
26-
"的人,它的操作方法應該不陌生。如果你之前完全沒有用過以上所述的東西也沒有關係,以下將提供一些必要的基本概念,稍微熟悉後,就可以快速上手。"
26+
"GMT 繼承了在 UNIX 環境之下處理資料的方法,對於曾經接觸過 shell 或 cmd "
27+
"的人,它的操作方法應該不陌生。如果你之前完全沒有用過,也沒有關係,以下將提供一些必要的基本概念,稍微熟悉後,就可以快速上手。"
2728
msgstr ""
28-
"GMT inherits the way of how the UNIX system manipulates data. For those who "
29-
"have some experience using Unix shell or cmd, GMT is easy to get started. If "
30-
"you never used anything like that, don't worry about it. This section will "
31-
"introduce some essential concepts for using GMT, which makes you get into "
32-
"the swing of it."
29+
"GMT inherits the way of how the UNIX system manipulates data. For those "
30+
"who have some experience using Unix shell or cmd, GMT is easy to get "
31+
"started. If you never used anything like that, don't worry about it. This"
32+
" section will introduce some essential concepts for using GMT, which "
33+
"makes you get into the swing of it."
3334

3435
#: ../../SOURCE_DOCS/basic_concept.rst:7
3536
msgid "另外,這裡也會簡單介紹 GMT 相關的一些檔案格式與操作,如果你是第一次接觸地理空間的資料,也歡迎在此查閱相關的術語。"
@@ -55,16 +56,17 @@ msgid ""
5556
"之後的版本,有兩種「終端機」可以選擇,一個就是 cmd,另一個稱為「PowerShell」,簡單的說就是讓使用者可以在 Windows "
5657
"的介面之下使用 UNIX 殼程式 (shell) 的一些語法。在本教學中,所有要在終端機下輸入的指令,最前方都會有個提示符號"
5758
msgstr ""
58-
"Although all the system platforms adopt a graphic interface (desktop) as the "
59-
"default user interface, You still can use command-line tools to get control "
60-
"over your computer. The easiest way to do this is to open a built-in program "
61-
"on the desktop environment. The program is called **cmd** on Windows, or "
62-
"**terminal** on Mac or most Linux systems. In this tutorial, to “open the "
63-
"terminal (app)” means to control your computer using a command-line tool. On "
64-
"Windows XP or later versions, there are actually two terminals on a single "
65-
"platform: cmd and “PowerShell.” The latter enables the usage of Unix shell’s "
66-
"syntax. In this tutorial, we always put a prompt sign at every command you "
67-
"need to type on the terminal"
59+
"Although all the system platforms adopt a graphic interface (desktop) as "
60+
"the default user interface, You still can use command-line tools to get "
61+
"control over your computer. The easiest way to do this is to open a "
62+
"built-in program on the desktop environment. The program is called "
63+
"**cmd** on Windows, or **terminal** on Mac or most Linux systems. In this"
64+
" tutorial, to “open the terminal (app)” means to control your computer "
65+
"using a command-line tool. On Windows XP or later versions, there are "
66+
"actually two terminals on a single platform: cmd and “PowerShell.” The "
67+
"latter enables the usage of Unix shell’s syntax. In this tutorial, we "
68+
"always put a prompt sign at every command you need to type on the "
69+
"terminal"
6870

6971
#: ../../SOURCE_DOCS/basic_concept.rst:19
7072
msgid "$"
@@ -111,10 +113,12 @@ msgstr ""
111113
#: ../../SOURCE_DOCS/basic_concept.rst:31
112114
msgid "有一個語法倒是非常值得一記,那就是註解符號 ``#``,例如以下指令:"
113115
msgstr ""
114-
"There’s a syntax worth mentioning here: the comment mark ``#``. For example:"
116+
"There’s a syntax worth mentioning here: the comment mark ``#``. For "
117+
"example:"
115118

116119
#: ../../SOURCE_DOCS/basic_concept.rst:33
117-
msgid "$ gmt grdinfo 你的檔案.grd # 觀看此檔案的資訊"
120+
#, fuzzy
121+
msgid "$ gmt grdinfo 你的檔案.grd # 觀看檔案的資訊"
118122
msgstr "$ grdinfo yourfile.grd # view info of the file"
119123

120124
#: ../../SOURCE_DOCS/basic_concept.rst:37
@@ -135,26 +139,27 @@ msgid ""
135139
" Windows 中,這種檔案叫做「批次檔 (batch file)」,而在 sh 或由它衍生的各種殼層中,通常會稱為「腳本 "
136140
"(script)」,但基本上他們指的是同一件東西,在本教學中,將統一稱之為「腳本」。不同系統在執行腳本的操作細節上,會有些許差異,而且通常也有許多種方式可以讀取腳本。以下是筆者推薦的操作方法。"
137141
msgstr ""
138-
"Whenever you press ``Enter`` on a command console, the computer starts to "
139-
"run the command you just put immediately. A user, however, can also opt to "
140-
"write down all the commands in a single text file, and type the name of the "
141-
"text file into the command line, then the computer would read the content "
142-
"and runs over all commands in order. On Windows, these files are called “"
143-
"batch files,” but they are also usually called “scripts” on Bourne shell or "
144-
"other related shells. They have the same function no matter the names they "
145-
"bear. In this tutorial, we choose to call them “scripts” regardless of "
146-
"platforms for the best readiness. You usually have many ways to get your "
147-
"script run, and there is also some difference among platforms in terms of "
148-
"processing details. I recommend the following several ways to do this."
142+
"Whenever you press ``Enter`` on a command console, the computer starts to"
143+
" run the command you just put immediately. A user, however, can also opt "
144+
"to write down all the commands in a single text file, and type the name "
145+
"of the text file into the command line, then the computer would read the "
146+
"content and runs over all commands in order. On Windows, these files are "
147+
"called “batch files,” but they are also usually called “scripts” on "
148+
"Bourne shell or other related shells. They have the same function no "
149+
"matter the names they bear. In this tutorial, we choose to call them "
150+
"“scripts” regardless of platforms for the best readiness. You usually "
151+
"have many ways to get your script run, and there is also some difference "
152+
"among platforms in terms of processing details. I recommend the following"
153+
" several ways to do this."
149154

150155
#: ../../SOURCE_DOCS/basic_concept.rst:46
151156
msgid ""
152157
"Windows: 把 ``.txt`` 腳本檔案的副檔名改成 ``.bat``,然後點兩下此檔,Windows 就會自動開啟 cmd "
153158
"來執行。一般來說,腳本的最後一行可以放上"
154159
msgstr ""
155160
"Windows: change the file extension from ``.txt`` to ``.bat``, and double-"
156-
"click the file. Windows will automatically open cmd and run it. You can also "
157-
"put the following line at the bottom of your file"
161+
"click the file. Windows will automatically open cmd and run it. You can "
162+
"also put the following line at the bottom of your file"
158163

159164
#: ../../SOURCE_DOCS/basic_concept.rst:48
160165
msgid ""
@@ -292,8 +297,8 @@ msgid ""
292297
"WGS84,你也可以使用以下指令查看現在 GMT 的座標系統:"
293298
msgstr ""
294299
"In a nutshell, we use geodetic datum to set up coordinates (**Latitude, "
295-
"Longitude, Height**) at any location on the Earth. The default datum of GMT "
296-
"is WGS84, and you can also check the current datum by this command:"
300+
"Longitude, Height**) at any location on the Earth. The default datum of "
301+
"GMT is WGS84, and you can also check the current datum by this command:"
297302

298303
#: ../../SOURCE_DOCS/basic_concept.rst:96
299304
msgid "$ gmt defaults -D # 在 Projection Parameters 的欄位"
@@ -480,17 +485,18 @@ msgstr ""
480485
"multi-frame maps."
481486

482487
#: ../../SOURCE_DOCS/basic_concept.rst:140
488+
#, fuzzy
483489
msgid ""
484490
"為了向下相容使用舊版語法的腳本,在 GMT 6 中你可以使用現代模式或是傳統模式的語法。因為新的語法具有許多優點,\\ "
485491
"**在本教學手冊中,我會使用現代模式的語法來撰寫腳本**\\ "
486-
"。然而,在每個繪製地圖的章節中,我也會一併放上傳統模式的教學連結以及使用傳統模式撰寫的腳本,供各位使用者參考。"
492+
"。然而,在部份繪製地圖的章節中,我也會一併放上傳統模式的教學連結以及使用傳統模式撰寫的腳本,供各位使用者參考。"
487493
msgstr ""
488-
"In order to realize the backward compatibility, in GMT 6 you can use either "
489-
"modern mode or classic mode to write your script. Because there are many "
490-
"advantages of the new syntax, **In this tutorial I would use the modern mode "
491-
"syntax to create maps.** However, for your reference, I would also provide a "
492-
"link to the script using the classical mode and the associated instruction "
493-
"for each map-making chapter."
494+
"In order to realize the backward compatibility, in GMT 6 you can use "
495+
"either modern mode or classic mode to write your script. Because there "
496+
"are many advantages of the new syntax, **In this tutorial I would use the"
497+
" modern mode syntax to create maps.** However, for your reference, I "
498+
"would also provide a link to the script using the classical mode and the "
499+
"associated instruction for each map-making chapter."
494500

495501
#: ../../SOURCE_DOCS/basic_concept.rst:142
496502
msgid "如果你已經是 GMT 5 的使用者,可以馬上無痛升級到 GMT 6,因為幾乎所有第五版的語法在第六版中都有支援 (傳統模式)。"
@@ -513,8 +519,8 @@ msgid ""
513519
"$ gmt set 各種選項... # 在 GMT 6 中也換成了 set 指令,而且變成總指令 gmt 下屬的一個模組。"
514520
msgstr ""
515521
"$ pscoast options... # pscoast command in GMT 4\n"
516-
"$ gmt coast options... # In GMT 6, it is replaced by the coast command, "
517-
"which is a module of the main gmt command.\n"
522+
"$ gmt coast options... # In GMT 6, it is replaced by the coast "
523+
"command, which is a module of the main gmt command.\n"
518524
"$ gmtset options... # gmtset command in GMT 4\n"
519525
"$ gmt set options... # In GMT 6, it is also replaced by the set "
520526
"command, which is a module of the main gmt command."
@@ -591,3 +597,4 @@ msgstr ""
591597
#~ "GMT 6, this has changed to set,"
592598
#~ " and it becomes a module under "
593599
#~ "the master gmt command as well."
600+

SOURCE_DOCS/locale/en_US/LC_MESSAGES/making_first_map.po

Lines changed: 53 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ msgid ""
44
msgstr ""
55
"Project-Id-Version: GMT 教學手冊 1.2\n"
66
"Report-Msgid-Bugs-To: \n"
7-
"POT-Creation-Date: 2021-02-23 11:56-0500\n"
7+
"POT-Creation-Date: 2021-03-04 22:05-0500\n"
88
"PO-Revision-Date: 2021-02-25 02:22+0000\n"
99
"Last-Translator: Whyjay Zheng <wz278@cornell.edu>\n"
10-
"Language-Team: English (United States) <https://hosted.weblate.org/projects/"
11-
"gmt-tutorials/making-first-map/en_US/>\n"
1210
"Language: en_US\n"
11+
"Language-Team: English (United States) "
12+
"<https://hosted.weblate.org/projects/gmt-tutorials/making-first-"
13+
"map/en_US/>\n"
14+
"Plural-Forms: nplurals=2; plural=n != 1\n"
1315
"MIME-Version: 1.0\n"
1416
"Content-Type: text/plain; charset=utf-8\n"
1517
"Content-Transfer-Encoding: 8bit\n"
16-
"Plural-Forms: nplurals=2; plural=n != 1;\n"
17-
"X-Generator: Weblate 4.5\n"
1818
"Generated-By: Babel 2.9.0\n"
1919

2020
#: ../../SOURCE_DOCS/making_first_map.rst:3
@@ -241,9 +241,9 @@ msgid ""
241241
"archi_sea.png\n"
242242
"-pdf archi_sea # PDF 格式輸出。檔名爲 archi_sea.pdf。"
243243
msgstr ""
244-
"-png archi_sea # archi_sea is the name of the output file. Note that "
245-
"there is a space between png and the filename. The full file name is "
246-
"archi_sea.png\n"
244+
"-png archi_sea # archi_sea is the name of the output file. Note "
245+
"that there is a space between png and the filename. The full file name is"
246+
" archi_sea.png\n"
247247
"-pdf archi_sea # generate PDF format instead. The file name is "
248248
"archi_sea.pdf."
249249

@@ -266,8 +266,8 @@ msgid ""
266266
" -N, -Q and -W"
267267
msgstr ""
268268
"$ gmt coast -R19.42/22.95/59.71/60.56 -png archi_sea\n"
269-
"coast [ERROR]: Syntax error: Must specify at least one of -C, -G, -S, -I, -"
270-
"N, -Q and -W"
269+
"coast [ERROR]: Syntax error: Must specify at least one of -C, -G, -S, -I,"
270+
" -N, -Q and -W"
271271

272272
#: ../../SOURCE_DOCS/making_first_map.rst:89
273273
msgid ""
@@ -381,8 +381,9 @@ msgstr ""
381381
#: ../../SOURCE_DOCS/making_first_map.rst:174
382382
msgid "另外爲了讓地圖易於判讀,我們也可以為陸地和海洋加上顏色,使用的分別是 ``-G`` (Ground) 和 ``-S`` (Sea) 選項:"
383383
msgstr ""
384-
"To improve the readability of the map, we can fill land and sea areas with "
385-
"colors. We will need ``-G`` (Ground) and ``-S`` (Sea) flags respectively:"
384+
"To improve the readability of the map, we can fill land and sea areas "
385+
"with colors. We will need ``-G`` (Ground) and ``-S`` (Sea) flags "
386+
"respectively:"
386387

387388
#: ../../SOURCE_DOCS/making_first_map.rst:176
388389
msgid ""
@@ -406,8 +407,8 @@ msgid ""
406407
"$ gmt coast -R19.42/22.95/59.71/60.56 -JM6i -W0.1p,black -Gdarkseagreen2 "
407408
"-Scornflowerblue -png archi_sea"
408409
msgstr ""
409-
"$ gmt coast -R19.42/22.95/59.71/60.56 -JM6i -W0.1p,black -Gdarkseagreen2 -"
410-
"Scornflowerblue -png archi_sea"
410+
"$ gmt coast -R19.42/22.95/59.71/60.56 -JM6i -W0.1p,black -Gdarkseagreen2 "
411+
"-Scornflowerblue -png archi_sea"
411412

412413
#: ../../SOURCE_DOCS/making_first_map.rst:187
413414
msgid ""
@@ -430,7 +431,8 @@ msgid ""
430431
"\\\n"
431432
" -Scornflowerblue -png archi_sea"
432433
msgstr ""
433-
"$ gmt coast -R19.42/22.95/59.71/60.56 -JM6i -W0.1p,black -Gdarkseagreen2 \\\n"
434+
"$ gmt coast -R19.42/22.95/59.71/60.56 -JM6i -W0.1p,black -Gdarkseagreen2 "
435+
"\\\n"
434436
" -Scornflowerblue -png archi_sea"
435437

436438
#: ../../SOURCE_DOCS/making_first_map.rst:194
@@ -520,7 +522,8 @@ msgid ""
520522
" -Scornflowerblue -Ba2f0.5g1 -BWSne+t\"Archipelago Sea\" -png "
521523
"archi_sea"
522524
msgstr ""
523-
"$ gmt coast -R19.42/22.95/59.71/60.56 -JM6i -W0.1p,black -Gdarkseagreen2 \\\n"
525+
"$ gmt coast -R19.42/22.95/59.71/60.56 -JM6i -W0.1p,black -Gdarkseagreen2 "
526+
"\\\n"
524527
" -Scornflowerblue -Ba2f0.5g1 -BWSne+t\"Archipelago Sea\" -png "
525528
"archi_sea"
526529

@@ -571,8 +574,10 @@ msgid ""
571574
"\\\n"
572575
" -png archi_sea"
573576
msgstr ""
574-
"$ gmt coast -R19.42/22.95/59.71/60.56 -JM6i -W0.1p,black -Gdarkseagreen2 \\\n"
575-
" -Scornflowerblue -Ba2f0.5g1 -BWSne+t\"Archipelago Sea\" -A0.1 \\\n"
577+
"$ gmt coast -R19.42/22.95/59.71/60.56 -JM6i -W0.1p,black -Gdarkseagreen2 "
578+
"\\\n"
579+
" -Scornflowerblue -Ba2f0.5g1 -BWSne+t\"Archipelago Sea\" -A0.1 "
580+
"\\\n"
576581
" -png archi_sea"
577582

578583
#: ../../SOURCE_DOCS/making_first_map.rst:255
@@ -606,9 +611,10 @@ msgid ""
606611
"-U \\\n"
607612
" -png archi_sea"
608613
msgstr ""
609-
"$ gmt coast -R19.42/22.95/59.71/60.56 -JM6i -W0.1p,black -Gdarkseagreen2 \\\n"
610-
" -Scornflowerblue -Ba2f0.5g1 -BWSne+t\"Archipelago Sea\" -A0.1 -U \\"
611-
"\n"
614+
"$ gmt coast -R19.42/22.95/59.71/60.56 -JM6i -W0.1p,black -Gdarkseagreen2 "
615+
"\\\n"
616+
" -Scornflowerblue -Ba2f0.5g1 -BWSne+t\"Archipelago Sea\" -A0.1 "
617+
"-U \\\n"
612618
" -png archi_sea"
613619

614620
#: ../../SOURCE_DOCS/making_first_map.rst:276
@@ -632,10 +638,34 @@ msgid "觀看\\ `最終版地圖`_"
632638
msgstr "Check the `final map`_"
633639

634640
#: ../../SOURCE_DOCS/making_first_map.rst:281
641+
msgid "PyGMT 指令稿"
642+
msgstr ""
643+
644+
#: ../../SOURCE_DOCS/making_first_map.rst:283
645+
msgid "使用 PyGMT,可以如下腳本繪製本地圖:"
646+
msgstr ""
647+
648+
#: ../../SOURCE_DOCS/making_first_map.rst:285
649+
msgid ""
650+
"import pygmt\n"
651+
"fig = pygmt.Figure()\n"
652+
"fig.coast(region=[19.42, 22.95, 59.71, 60.56], projection=\"M6i\", "
653+
"shorelines=['0.1p', 'black'], land='green',\n"
654+
" water='cornflowerblue', frame=['a2f0.5g1', 'WSne+t\"Archipelago"
655+
" Sea\"'], area_thresh=0.1, timestamp=True)\n"
656+
"fig.show()\n"
657+
"fig.savefig('archi_sea_pygmt.png')"
658+
msgstr ""
659+
660+
#: ../../SOURCE_DOCS/making_first_map.rst:294
661+
msgid "你可以使用以下的 Binder 連結嘗試此程式碼:"
662+
msgstr ""
663+
664+
#: ../../SOURCE_DOCS/making_first_map.rst:301
635665
msgid "習題"
636666
msgstr "Exercise"
637667

638-
#: ../../SOURCE_DOCS/making_first_map.rst:283
668+
#: ../../SOURCE_DOCS/making_first_map.rst:303
639669
msgid ""
640670
"畫出蘇拉威西島 (*Sulawesi*) 的海岸線圖。蘇拉威西島是印尼第四大島,外觀非常有趣,\\ 像是字母 K 或是正在跳舞的人。座標可使用 "
641671
"``118.34E 至 125.70E``,以及 ``6.12S 至 2.08N``。"
@@ -768,3 +798,4 @@ msgstr ""
768798
#~ "-BWSne+t\"Archipelago Sea\" -A0.1 -U \\\n"
769799
#~ ""
770800
#~ " -png archi_sea"
801+

SOURCE_DOCS/making_first_map.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,26 @@
277277

278278
觀看\ `最終版地圖`_
279279

280+
PyGMT 指令稿
281+
--------------------------------------
282+
283+
使用 PyGMT,可以如下腳本繪製本地圖:
284+
285+
.. code-block:: python
286+
287+
import pygmt
288+
fig = pygmt.Figure()
289+
fig.coast(region=[19.42, 22.95, 59.71, 60.56], projection="M6i", shorelines=['0.1p', 'black'], land='green',
290+
water='cornflowerblue', frame=['a2f0.5g1', 'WSne+t"Archipelago Sea"'], area_thresh=0.1, timestamp=True)
291+
fig.show()
292+
fig.savefig('archi_sea_pygmt.png')
293+
294+
你可以使用以下的 Binder 連結嘗試此程式碼:
295+
296+
.. image:: https://mybinder.org/badge_logo.svg
297+
:target: https://mybinder.org/v2/gh/whyjz/GMT-tutorials/HEAD?filepath=SOURCE_DOCS%2Fmaking_first_map%2Farchi_sea_pygmt.ipynb
298+
299+
280300
習題
281301
--------------------------------------
282302

0 commit comments

Comments
 (0)