14
14
</p >
15
15
16
16
<p align =" center" >
17
+ <a href =" http://try.gmtpython.xyz/" >Online Demo</a > |
17
18
<a href =" https://www.gmtpython.xyz" >Documentation</a > |
18
- <a href =" https://www.gmtpython.xyz/latest/install.html" >Install</a > |
19
- <a href =" https://www.gmtpython.xyz/latest/tutorials" >Tutorials</a > |
20
- <a href =" https://www.gmtpython.xyz/latest/api" >API</a > |
19
+ <a href =" https://github.com/GenericMappingTools/gmt-python" >Source Code</a > |
21
20
<a href =" https://gitter.im/GenericMappingTools/gmt-python" >Contact</a >
22
21
</p >
23
22
24
23
24
+ .. code :: python
25
+
26
+ import gmt
27
+
28
+ # Load sample earthquake data in a pandas.DataFrame
29
+ quakes = gmt.datasets.load_usgs_quakes()
30
+
31
+ # Load the builtin Earth relief grid as an xarray.DataArray.
32
+ relief = gmt.datasets.load_earth_relief(resolution = " 30m" )
33
+
34
+ # The Figure object controls all plotting functions
35
+ fig = gmt.Figure()
36
+ # Setup a map with a global region, a Mollweide projection, and automatic ticks
37
+ fig.basemap(region = " g" , projection = " W200/8i" , frame = True )
38
+ # Plot the Earth relief grid in pseudo-color.
39
+ fig.grdimage(relief, cmap = " geo" )
40
+ # Plot earthquakes as circles. Size maps to magnitude and color to depth.
41
+ fig.plot(x = quakes.longitude, y = quakes.latitude, sizes = 0.01 * 2 ** quakes.mag,
42
+ color = quakes.depth/ quakes.depth.max(), cmap = " viridis" , style = " cc" )
43
+ # Show a preview of the image (inline if in a Jupyter notebook).
44
+ fig.show()
45
+
46
+ .. image :: .github/readme-example.png
47
+
48
+
25
49
Disclaimer
26
50
----------
27
51
@@ -39,52 +63,35 @@ Getting started
39
63
---------------
40
64
41
65
1. Try an online demo at `try.gmtpython.xyz <http://try.gmtpython.xyz >`__
42
- 2. `Install <https://www.gmtpython.xyz/latest/install.html >`__ (tested and working on
43
- Linux and OSX)
66
+ 2. `Install <https://www.gmtpython.xyz/latest/install.html >`__ (Linux and Mac)
44
67
3. Follow the `Tutorials <https://www.gmtpython.xyz/latest/tutorials >`__.
45
- 4. Take a look at the `API <https://www.gmtpython.xyz/latest/api >`__ for a list of
46
- modules that are already available.
47
-
48
-
49
- About
50
- -----
51
-
52
- Watch the `Scipy 2017 talk about GMT/Python <https://github.com/GenericMappingTools/scipy2017 >`__
53
- for more information about the history and goals of the project:
54
-
55
- .. image :: https://raw.githubusercontent.com/GenericMappingTools/gmt-python/master/doc/_static/scipy2017-youtube-thumbnail.png
56
- :alt: YouTube recording of the Scipy2017 talk.
57
- :target: https://www.youtube.com/watch?v=93M4How7R24
68
+ 4. Take a look at the `API <https://www.gmtpython.xyz/latest/api >`__ to see what is
69
+ available.
58
70
59
71
60
72
Project goals
61
73
-------------
62
74
63
- * Build a modern Pythonic API that appeals to Python programmers who want to
64
- use GMT.
65
- * Implement readable and explicit aliases for the GMT command-line arguments
66
- (``region `` instead of ``R ``, ``projection `` instead of ``J ``, etc).
67
- * Use the new `GMT modern mode
68
- <http://gmt.soest.hawaii.edu/projects/gmt/wiki/Modernization> `__ for
69
- simplified execution and figure generation.
70
- * Interface with the GMT C API directly using
71
- `ctypes <https://docs.python.org/3/library/ctypes.html >`__ (no system calls).
72
- * Integration with the `Jupyter notebook <http://jupyter.org/ >`__ to display
73
- plots and maps inline.
74
- * Input and output using Python native containers: numpy ``ndarray `` or pandas
75
- ``DataFrame `` for data tables and `xarray <http://xarray.pydata.org >`__
76
- ``Dataset `` for netCDF grids.
75
+ * Make GMT more accessible to new users.
76
+ * Build a Pythonic API for GMT.
77
+ * Interface with the GMT C API directly using ctypes (no system calls).
78
+ * Support for rich display in the Jupyter notebook.
79
+ * Integration with the Scipy stack: numpy.ndarray or pandas.DataFrame for data tables
80
+ and xarray.DataArray for grids.
77
81
78
82
79
83
Contacting Us
80
84
-------------
81
85
82
- * Most discussion happens `on Github < https://github.com/GenericMappingTools/gmt-python >`__.
83
- Feel free to `open an issue
84
- <https://github.com/GenericMappingTools/gmt-python/issues/new> `__ or comment
85
- on any open issue or pull request.
86
- * We have `chat room on Gitter <https://gitter.im/GenericMappingTools/gmt-python >`__
86
+ * Most discussion happens `on Github
87
+ <https://github.com/GenericMappingTools/gmt-python> `__. Feel free to `open an issue
88
+ <https://github.com/GenericMappingTools/gmt-python/issues/new> `__ or comment on any
89
+ open issue or pull request.
90
+ * We have a `chat room on Gitter <https://gitter.im/GenericMappingTools/gmt-python >`__
87
91
where you can ask questions and leave comments.
92
+ * This project is released with a `Contributor Code of Conduct
93
+ <https://github.com/GenericMappingTools/gmt-python/blob/master/CODE_OF_CONDUCT.md> `__.
94
+ By participating in this project you agree to abide by its terms.
88
95
89
96
90
97
Contributing
@@ -93,40 +100,36 @@ Contributing
93
100
Code of conduct
94
101
+++++++++++++++
95
102
96
- Please note that this project is released with a
97
- ` Contributor Code of Conduct <https://github.com/GenericMappingTools/gmt-python/blob/master/CODE_OF_CONDUCT.md >`__.
103
+ Please note that this project is released with a ` Contributor Code of Conduct
104
+ <https://github.com/GenericMappingTools/gmt-python/blob/master/CODE_OF_CONDUCT.md> `__.
98
105
By participating in this project you agree to abide by its terms.
99
106
100
107
Contributing Guidelines
101
108
+++++++++++++++++++++++
102
109
103
- Please read our
104
- ` Contributing Guide <https://github.com/GenericMappingTools/gmt-python/blob/master/CONTRIBUTING.md >`__
105
- to see how you can help and give feedback.
110
+ Please read our ` Contributing Guide
111
+ <https://github.com/GenericMappingTools/gmt-python/blob/master/CONTRIBUTING.md> `__ to
112
+ see how you can help and give feedback.
106
113
107
114
Imposter syndrome disclaimer
108
115
++++++++++++++++++++++++++++
109
116
110
117
**We want your help. ** No, really.
111
118
112
- There may be a little voice inside your head that is telling you that you're
113
- not ready to be an open source contributor; that your skills aren't nearly good
114
- enough to contribute.
115
- What could you possibly offer?
119
+ There may be a little voice inside your head that is telling you that you're not ready
120
+ to be an open source contributor; that your skills aren't nearly good enough to
121
+ contribute. What could you possibly offer?
116
122
117
123
We assure you that the little voice in your head is wrong.
118
124
119
125
**Being a contributor doesn't just mean writing code **.
120
- Equality important contributions include:
121
- writing or proof-reading documentation, suggesting or implementing tests, or
122
- even giving feedback about the project (including giving feedback about the
123
- contribution process).
124
- If you're coming to the project with fresh eyes, you might see the errors and
125
- assumptions that seasoned contributors have glossed over.
126
- If you can write any code at all, you can contribute code to open source.
127
- We are constantly trying out new skills, making mistakes, and learning from
128
- those mistakes.
129
- That's how we all improve and we are happy to help others learn.
126
+ Equality important contributions include: writing or proof-reading documentation,
127
+ suggesting or implementing tests, or even giving feedback about the project (including
128
+ giving feedback about the contribution process). If you're coming to the project with
129
+ fresh eyes, you might see the errors and assumptions that seasoned contributors have
130
+ glossed over. If you can write any code at all, you can contribute code to open source.
131
+ We are constantly trying out new skills, making mistakes, and learning from those
132
+ mistakes. That's how we all improve and we are happy to help others learn.
130
133
131
134
*This disclaimer was adapted from the *
132
135
`MetPy project <https://github.com/Unidata/MetPy >`__.
@@ -135,24 +138,19 @@ That's how we all improve and we are happy to help others learn.
135
138
Related projects
136
139
----------------
137
140
138
- * `GMT.jl <https://github.com/GenericMappingTools/GMT.jl >`__ -- A Julia wrapper
141
+ * `GMT.jl <https://github.com/GenericMappingTools/GMT.jl >`__: A Julia wrapper for GMT.
142
+ * `gmtmex <https://github.com/GenericMappingTools/GMT.jl >`__: A Matlab/Octave wrapper
139
143
for GMT.
140
- * `gmtmex <https://github.com/GenericMappingTools/GMT.jl >`__ -- A Matlab/Octave
141
- wrapper for GMT.
142
144
143
145
Other Python wrappers for GMT:
144
146
145
- * `gmtpy <https://github.com/emolch/gmtpy >`__ by
146
- `Sebastian Heimann <https://github.com/emolch >`__
147
- * `pygmt <https://github.com/ian-r-rose/pygmt >`__ by
148
- `Ian Rose <https://github.com/ian-r-rose >`__
149
- * `PyGMT <https://github.com/glimmer-cism/PyGMT >`__ by
150
- `Magnus Hagdorn <https://github.com/mhagdorn >`__
147
+ * `gmtpy <https://github.com/emolch/gmtpy >`__ by `Sebastian Heimann <https://github.com/emolch >`__
148
+ * `pygmt <https://github.com/ian-r-rose/pygmt >`__ by `Ian Rose <https://github.com/ian-r-rose >`__
149
+ * `PyGMT <https://github.com/glimmer-cism/PyGMT >`__ by `Magnus Hagdorn <https://github.com/mhagdorn >`__
151
150
152
151
153
152
License
154
153
-------
155
154
156
- gmt-python is free software: you can redistribute it and/or modify it under the
157
- terms of the **BSD 3-clause License **. A copy of this license is provided in
158
- ``LICENSE.txt ``.
155
+ GMT/Python is free software: you can redistribute it and/or modify it under the terms of
156
+ the **BSD 3-clause License **. A copy of this license is provided in ``LICENSE.txt ``.
0 commit comments