@@ -13,7 +13,7 @@ GMT/Python
13
13
.. image :: http://img.shields.io/pypi/v/gmt-python.svg?style=flat-square
14
14
:alt: Latest version on PyPI
15
15
:target: https://pypi.python.org/pypi/gmt-python
16
- .. image :: http://img.shields.io/travis/GenericMappingTools/gmt-python/master.svg?style=flat-square
16
+ .. image :: http://img.shields.io/travis/GenericMappingTools/gmt-python/master.svg?style=flat-square&label=linux|osx
17
17
:alt: Travis CI build status
18
18
:target: https://travis-ci.org/GenericMappingTools/gmt-python
19
19
.. image :: http://img.shields.io/coveralls/GenericMappingTools/gmt-python/master.svg?style=flat-square
@@ -35,66 +35,43 @@ Disclaimer
35
35
We welcome any feedback and ideas!
36
36
Let us know by submitting
37
37
`issues on Github <https://github.com/GenericMappingTools/gmt-python/issues >`__
38
- or send us a message on `our Gitter chatroom <https://gitter.im/GenericMappingTools/gmt-python >`__.
38
+ or send us a message on our
39
+ `Gitter chatroom <https://gitter.im/GenericMappingTools/gmt-python >`__.
39
40
40
41
See the `documentation <https://genericmappingtools.github.io/gmt-python/ >`__
41
42
for our design ideas, currently implemented features, how to contribute, and
42
43
more.
43
44
44
45
45
- Goals
46
- -----
46
+ Getting started
47
+ ---------------
47
48
48
- * Provide access to GMT modules from Python using the GMT C API (no system
49
- calls).
50
- * API design familiar for veteran GMT users (arguments ``R ``,
51
- ``J ``, etc) with more newbie-friendly alternatives/aliases
52
- (``region=[10, 20, -30, -10] ``, ``projection='M' ``, etc).
53
- * Input and output using Python native containers: numpy ``ndarray `` or pandas
54
- ``DataFrame `` for data tables and `xarray <http://xarray.pydata.org >`__
55
- ``Dataset `` for netCDF grids.
56
- * Integration with the `Jupyter notebook <http://jupyter.org/ >`__ to display
57
- plots and maps inline.
58
- * Built around the new `GMT modern mode
59
- <http://gmt.soest.hawaii.edu/projects/gmt/wiki/Modernization> `__.
60
-
61
-
62
- Examples
63
- --------
64
-
65
- This is a basic example to generate a figure and save it to a file:
66
-
67
- .. code-block :: python
68
-
69
- import gmt
49
+ 1. `Install <https://genericmappingtools.github.io/gmt-python/install.html >`__
50
+ (tested and working on Linux and OSX)
51
+ 2. Follow the
52
+ `First steps <https://genericmappingtools.github.io/gmt-python/first-steps.html >`__
53
+ tutorial Jupyter notebook.
54
+ 3. Take a look at the :ref: `api ` for a list of modules that are already
55
+ available.
70
56
71
- # Start a new figure.
72
- gmt.figure()
73
- # Draw a basemap
74
- gmt.psbasemap(R = ' 10/70/-3/8' , J = ' X4i/3i' , B = ' a' , P = True )
75
- # Plot some points with red circles
76
- gmt.psxy(' mydata.txt' , S = ' c' , G = ' red' )
77
- # Unlike in the command-line, no figure is generated
78
- # unless explicitly asked.
79
- gmt.psconvert(F = ' myfigure' , T = ' f' , A = True , P = True )
80
57
58
+ Project goals
59
+ -------------
81
60
82
- On the Jupyter notebook, a PNG preview of the image should also appear.
83
-
84
- Notice that the arguments are based on the GMT command-line options. The Python
85
- API also allows aliases for the arguments to make them more explicit and more
86
- familiar to Python users:
87
-
88
-
89
- .. code-block :: python
90
-
91
- import gmt
92
-
93
- gmt.figure()
94
- gmt.psbasemap(region = [10 , 70 , - 3 , 8 ], projection = ' X4i/3i' , frame = ' a' ,
95
- portrait = True )
96
- gmt.psxy(' mydata.txt' , style = ' c' , color = ' red' )
97
- gmt.psconvert(prefix = ' myfigure' , fmt = ' f' , crop = True , portrait = True )
61
+ * Build a modern Pythonic API that appeals to Python programmers who want to
62
+ use GMT.
63
+ * Implement readable and explicit aliases for the GMT command-line arguments
64
+ (``region `` instead of ``R ``, ``projection `` instead of ``J ``, etc).
65
+ * Use the new `GMT modern mode
66
+ <http://gmt.soest.hawaii.edu/projects/gmt/wiki/Modernization> `__ for
67
+ simplified execution and figure generation.
68
+ * Interface with the GMT C API directly using
69
+ `ctypes <https://docs.python.org/3/library/ctypes.html >`__ (no system calls).
70
+ * Integration with the `Jupyter notebook <http://jupyter.org/ >`__ to display
71
+ plots and maps inline.
72
+ * Input and output using Python native containers: numpy ``ndarray `` or pandas
73
+ ``DataFrame `` for data tables and `xarray <http://xarray.pydata.org >`__
74
+ ``Dataset `` for netCDF grids.
98
75
99
76
100
77
@@ -113,6 +90,8 @@ Working features and TODO
113
90
destroyed when the program ends. This eliminates the need for ``begin `` and
114
91
``end `` in the Python API.
115
92
- [X] Minimal working code producing a figure from data on disk
93
+ - [ ] Implement an object-oriented API using a ``Figure `` class (similar to
94
+ matplotlib).
116
95
- [ ] Wrapper for the GMT VirtualFile machinery to allow communicating data in
117
96
memory to the modules
118
97
- [ ] Wrapper for ``GMT_DATA `` to pass in tabular data from numpy arrays
0 commit comments