Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add geo3al dataset #364

Merged
merged 72 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
fbc6e94
Add geology data
CovMat Jun 9, 2021
c992b6c
Update index.rst
CovMat Jun 10, 2021
11f2ff0
Update geo3al.rst
CovMat Jun 15, 2021
0a6e1e1
fix
CovMat Jun 16, 2021
dbfcc8b
Update geo3al.rst
CovMat Jun 16, 2021
809aebf
Apply suggestions from code review
CovMat Jun 17, 2021
a01ad25
update
CovMat Jun 18, 2021
fec8c24
Update geo3al.rst
CovMat Jun 18, 2021
53f0511
update
CovMat Jun 18, 2021
e7ca33d
Update geo3al.rst
CovMat Jun 18, 2021
5c8af40
Apply suggestions from code review
CovMat Jun 18, 2021
cee6d12
Apply suggestions from code review
CovMat Jun 18, 2021
bfcd531
Apply suggestions from code review
CovMat Jun 18, 2021
f77b46e
fix
CovMat Jun 18, 2021
903d80a
Apply suggestions from code review
CovMat Jun 18, 2021
75e1ada
Apply suggestions from code review
CovMat Jun 18, 2021
43442f0
Apply suggestions from code review
CovMat Jun 18, 2021
e51045c
Apply suggestions from code review
CovMat Jun 18, 2021
2c938be
Apply suggestions from code review
CovMat Jun 18, 2021
610a8a6
Apply suggestions from code review
CovMat Jun 18, 2021
01264c1
Apply suggestions from code review
CovMat Jun 18, 2021
1bb7d2e
Apply suggestions from code review
CovMat Jun 18, 2021
11dddf7
Apply suggestions from code review
CovMat Jun 18, 2021
01614f3
Apply suggestions from code review
CovMat Jun 18, 2021
ea8ea22
Update source/dataset-CN/geo3al/index.rst
seisman Jun 18, 2021
34d9871
Update source/dataset-CN/geo3al/index.rst
seisman Jun 18, 2021
95af4ce
Apply suggestions from code review
seisman Jun 18, 2021
2089ad4
Apply suggestions from code review
seisman Jun 18, 2021
aac1af8
Merge branch 'master' into Add_geology_data
seisman Jun 19, 2021
427eac0
fix
CovMat Jun 21, 2021
eb62fb0
Apply suggestions from code review
CovMat Jun 21, 2021
e30dcc2
Apply suggestions from code review
CovMat Jun 21, 2021
d9d1c4e
Apply suggestions from code review
CovMat Jun 21, 2021
2c017f7
Apply suggestions from code review
CovMat Jun 21, 2021
1baddc6
Apply suggestions from code review
CovMat Jun 21, 2021
2bffb21
Apply suggestions from code review
CovMat Jun 21, 2021
3f6e7db
Apply suggestions from code review
CovMat Jun 21, 2021
5453c6a
Merge branch 'master' into Add_geology_data
seisman Jun 21, 2021
971bfbd
Cache data
core-man Jun 21, 2021
77ae957
Apply suggestions from code review
core-man Jun 21, 2021
712ef9c
Disable cache data in PR
core-man Jun 21, 2021
89f8e5c
Update source/dataset-CN/geo3al/plot_geo3al.sh
seisman Jun 21, 2021
59919f0
Apply suggestions from code review
CovMat Jun 21, 2021
0e7df1b
Apply suggestions from code review
CovMat Jun 21, 2021
78ce3e2
Apply suggestions from code review
CovMat Jun 21, 2021
17852ee
Rename plot_geo3al.sh to geo3al.sh
seisman Jun 22, 2021
1d6cc30
Merge branch 'master' into Add_geology_data
core-man Jun 22, 2021
99e0365
Merge branch 'master' into Add_geology_data
seisman Jun 22, 2021
ab89c4e
Directly include code and image
seisman Jun 23, 2021
3d8bda7
Centering the image
seisman Jun 23, 2021
8a4bef5
Update the description of geo3al data
seisman Jun 23, 2021
f3fa560
Upate geo3al data description
seisman Jun 23, 2021
7b48fbe
Fix
seisman Jun 23, 2021
131c4fd
Fix
seisman Jun 23, 2021
12d3d3a
Fix
seisman Jun 23, 2021
444477f
Update plotting scripts
seisman Jun 23, 2021
e9c7cb9
fix
seisman Jun 23, 2021
b4f402b
Fix
seisman Jun 23, 2021
ebda17e
Apply suggestions from code review
CovMat Jun 24, 2021
fe6d958
Apply suggestions from code review
CovMat Jun 24, 2021
f97c568
Apply suggestions from code review
CovMat Jun 24, 2021
0456689
Apply suggestions from code review
CovMat Jun 24, 2021
cd48765
Apply suggestions from code review
CovMat Jun 24, 2021
bf14c40
Apply suggestions from code review
CovMat Jun 24, 2021
e5046d9
Fix descriptions
seisman Jun 24, 2021
2a2d2d3
Merge branch 'master' into Add_geology_data
seisman Jun 25, 2021
92a9e44
Update CPT
seisman Jun 25, 2021
24a2b9e
More fixes in geoage.cpt
seisman Jun 25, 2021
f45b531
Apply suggestions from code review
seisman Jun 25, 2021
f63e8c8
Apply suggestions from code review
seisman Jun 25, 2021
b463db6
Update source/dataset-CN/geo3al/index.rst
seisman Jun 25, 2021
73c3980
Merge branch 'master' into Add_geology_data
core-man Jun 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions source/dataset-CN/geo3al/GTS2012_periods.cpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Geological time scale categorical color scheme
#
# TIMESCALE: GTS2012 (Gradstein et al., 2012)
#
# GIVEN ARE TOPS of PERIODS in Milliions of years before present
#
# Christian Heine, mailto:christian.heine@sydney.edu.au
#
# LICENSE:
# This work is licensed under a
# Creative Commons Attribution-ShareAlike 3.0 Unported License
# http://creativecommons.org/licenses/by-sa/3.0/deed.en_US.
#
#-----------------------------------------------------------------------------
# COLOR_MODEL = RGB
#
0.0 255/242/186 2.588 255/242/186 ; Quaternary
2.588 255/255/115 23.03 255/255/115 ; Neogene
23.03 253/192/145 66.0 253/192/145 ; Paleogene
66.0 191/227/93 145.0 191/227/93 ; Cretaceous
145.0 166/221/224 201.3 166/221/224 ; Jurassic
201.3 227/185/219 252.2 227/185/219 ; Triassic
252.2 251/141/118 298.9 251/141/118 ; Permian
298.9 153/194/181 358.9 153/194/181 ; Carboniferous
358.9 241/213/118 419.2 241/213/118 ; Devonian
419.2 179/225/194 443.4 179/225/194 ; Silurian
443.4 102/192/146 485.4 102/192/146 ; Ordovician
485.4 179/212/146 541.0 179/212/146 ; Cambrian
541.0 254/217/106 635 254/217/106 ; Ediacaran
635 254/204/92 850 254/204/92 ; Cryogenian
850 254/191/78 1000 254/191/78 ; Tonian
1000 254/217/154 1200 254/217/154 ; Stenian
1200 253/204/138 1400 253/204/138 ; Ectasian
1400 253/192/122 1600 253/192/122 ; Calymmia
1600 248/117/167 1800 248/117/167 ; Statherian
1800 247/104/152 2050 247/104/152 ; Orosirian
2050 247/91/137 2300 247/91/137 ; Rhyacian
2300 247/79/124 2500 247/79/124 ; Siderian
2500 249/155/193 2800 249/155/193 ; Neoarchean
2800 247/104/169 3200 247/104/169 ; Mesoarchean
3200 244/68/159 3600 244/68/159 ; Paleoarchean
3600 218/3/127 4000 218/3/127 ; Eoarchean

B black
F white
N white
54 changes: 54 additions & 0 deletions source/dataset-CN/geo3al/geo3al.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
geo3al: 中国大陆及邻区地质图数据
core-man marked this conversation as resolved.
Show resolved Hide resolved
seisman marked this conversation as resolved.
Show resolved Hide resolved
================================

中国大陆及邻区地质图数据 :file:`geo3al.gmt`\ 来自
美国USGS(`Generalized Geology of the Far East (geo3al) <https://catalog.data.gov/dataset/generalized-geology-of-the-far-east-geo3al>`_)
,其分辨率为1:4,000,000。 原始的 ``.shp`` 数据文件使用的不是WGS84坐标系统,不便于 GMT 使用。
社区提供的数据已由贡献者徐弥坚进行过坐标转换,处理为 GMT 易用的WGS84坐标。数据处理具体步骤如下:

首先 :doc:`/table/ogr2ogr`\ ,将 ``Shapefile`` 转换为GMT可识别的 ``OGR/GMT`` 格式::

ogr2ogr -f "GMT" geo3al.gmt geo3al.shp

在此需要注意的是,除了 ``shp`` 文件以外, ``.bdf`` , ``.prj`` , ``.shx`` 等文件也必须放在同一文件夹下。
CovMat marked this conversation as resolved.
Show resolved Hide resolved
转换成的 ``gmt`` 格式的头段给出了坐标系统等信息::

# @VGMT1.0 @GPOLYGON
# @R-4429828.81497/2910361.16929/1521748.41529/6058515.31077
# @Jp"+proj=lcc +lat_0=0 +lon_0=120 +lat_1=31 +lat_2=-29 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs"
# @Jw"PROJCS[\"WGS_1984_Lambert_Conformal_Conic\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",120],PARAMETER[\"standard_parallel_1\",31],PARAMETER[\"standard_parallel_2\",-29],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"
# @NAREA|PERIMETER|TYPE|GLG|GEN_GLG
# @Tdouble|double|string|string|string
# FEATURE_DATA
>
# @D31581396321.161|1523494.938||J|J
# @P
181032.240279034 6019152.23377152
183705.216473993 6018783.51860619
……

第三行显示坐标系统被投影在东经120度,南纬29度到北纬31度之间。数据通过 ``Python`` 的 ``pyproj`` 模块
进行坐标转换,下面仅列出关键部分代码::

import pyproj
p = pyproj.Proj(
"+proj=lcc +lat_1=31 +lat_2=-29 +lat_0=0 +lon_0=120 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs")
lon, lat = p(float(x), float(y), inverse=True)
seisman marked this conversation as resolved.
Show resolved Hide resolved

处理好的数据的具体下载地址和使用方式请见: :doc:`/dataset-CN/index`\ 。

示例代码使用地质年代CPT色标文件 (`GTS2012_periods <http://soliton.vm.bytemark.co.uk/pub/cpt-city/heine/tn/GTS2012_periods.png.index.html>`_):
:download:`GTS2012_periods.cpt` 。
此 CPT 文件所提供的地质年代色标文件最小单位是“纪”,因此在绘制小区域时可能精度较低。
有兴趣的读者可以尝试在最小精度为“世”的色标(`GTS2012_epochs <http://soliton.vm.bytemark.co.uk/pub/cpt-city/heine/GTS2012_epochs.cpt>`_)中进行修改,
来绘制更精细的图像,但这时图注则需要自行修改。

.. gmtplot:: plot_geo3al.sh
:show-code: true
:width: 75%

数据来源及引用
--------------
- USGS Generalized Geology of the Far East (geo3al). https://catalog.data.gov/dataset/generalized-geology-of-the-far-east-geo3al
- 用GMT绘制中国大陆及邻区地质年代图. https://blog.xumijian.me/post/gmt-geo/
- Po-Chin Tseng的博客. https://jimmytseng79.github.io/GMT5_tutorials/geology_map.html
56 changes: 56 additions & 0 deletions source/dataset-CN/geo3al/plot_geo3al.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash
data=geo3al.gmt
cpt=GTS2012_periods.cpt
rocksize=400
lengsize=0.15i

gmt begin geo3al png,pdf
gmt set FONT_ANNOT_PRIMARY 10
gmt set MAP_FRAME_WIDTH 0.08
gmt set MAP_TICK_LENGTH_PRIMARY 0.08

gmt coast -R70/150/15/55 -JM8i -Baf -Df -G255 -BWSne
gmt plot $data -C$cpt -L

gmt gmtconvert $data -S"|v|" > tmp
awk '/^[0-9]/{print $1,"p'$rocksize'/28:F100B"$2,$3,"p'$rocksize'/28:F100B"$4}' $cpt > tmp.cpt
gmt plot tmp -Ctmp.cpt -L

gmt gmtconvert $data -S"|i|" > tmp
awk '/^[0-9]/{print $1,"p'$rocksize'/29:F100B"$2,$3,"p'$rocksize'/29:F100B"$4}' $cpt > tmp.cpt
gmt plot tmp -Ctmp.cpt -L

gmt gmtconvert $data -S"|w|" > tmp
awk '/^[0-9]/{print $1,"p'$rocksize'/44:F100B"$2,$3,"p'$rocksize'/44:F100B"$4}' $cpt > tmp.cpt
gmt plot tmp -Ctmp.cpt -L

gmt coast -SCADETBLUE1

seisman marked this conversation as resolved.
Show resolved Hide resolved
gmt set FONT_ANNOT_PRIMARY 7p
gmt legend -DJBR+w200p/57p+jBR+l1.3 -F+p0.7p+g255 -C3p/3p <<EOF
H 10 3 Age of rock units
G 1p
N 3
S 0.3c r $lengsize 229/204/132 0.3p 0.7c Cambrian
S 0.3c r $lengsize 102/192/146 0.3p 0.7c Ordovician
S 0.3c r $lengsize 179/225/194 0.3p 0.7c Silurian
S 0.3c r $lengsize 241/213/118 0.3p 0.7c Devonian
S 0.3c r $lengsize 153/194/181 0.3p 0.7c Carboniferous
S 0.3c r $lengsize 251/141/118 0.3p 0.7c Permian
S 0.3c r $lengsize 227/185/219 0.3p 0.7c Triassic
S 0.3c r $lengsize 166/221/224 0.3p 0.7c Jurassic
S 0.3c r $lengsize 191/227/93 0.3p 0.7c Cretaceous
S 0.3c r $lengsize 253/192/145 0.3p 0.7c Paleogene
S 0.3c r $lengsize 255/255/115 0.3p 0.7c Neogene
EOF

gmt legend -DJBR+w75p/57p+jBR+l1.3+o200p/0p -F+p0.7p+g255 -C3p/3p <<EOF
H 10 3 Rock type
G 5p
S 0.3c r 0.2i p400/28:B255 0.3p 0.7c Volcanic rocks
G 5p
S 0.3c r 0.2i p400/29:B255 0.3p 0.7c Intrusive rocks
EOF

rm tmp tmp.cpt
gmt end show
1 change: 1 addition & 0 deletions source/dataset-CN/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
CN-border
CN-block
CN-faults
geo3al/geo3al
CovMat marked this conversation as resolved.
Show resolved Hide resolved

**下载数据**

Expand Down