https://github.com/michaelchin/gwspy
The GPlates Web Service Python Wrapper allows users to access GPlates Web Service more easily via simple Python programming interface.
https://github.com/michaelchin/gwspy
geophysics geoscience geospatial plate-tectonics web-service
Last synced: 4 months ago
JSON representation
The GPlates Web Service Python Wrapper allows users to access GPlates Web Service more easily via simple Python programming interface.
- Host: GitHub
- URL: https://github.com/michaelchin/gwspy
- Owner: michaelchin
- License: mit
- Created: 2023-05-17T03:44:42.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-15T21:41:02.000Z (4 months ago)
- Last Synced: 2025-01-15T23:39:44.936Z (4 months ago)
- Topics: geophysics, geoscience, geospatial, plate-tectonics, web-service
- Language: Python
- Homepage: https://michaelchin.github.io/gwspy/
- Size: 9.26 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GPlates Web Service Python Wrapper

[](https://badge.fury.io/py/gwspy)The GPlates Web Service Python Wrapper allows users to access [GPlates Web Service](https://gwsdoc.gplates.org/) more easily via a simple Python programming interface. This Python package is a part of [GPlates software suite](https://www.gplates.org/). GPlates is an open source project funded by [AuScope](https://www.auscope.org.au/).
### Installation
`pip install gwspy`
### How to use
The following Python code reconstructs three locations to 100Ma with [Muller2019](https://zenodo.org/doi/10.5281/zenodo.10525286) reconstruction model.
```python
# pip install gwspy shapely
import shapely
from gwspy import PlateModel, reconstruct_shapely_pointslats = [50, 10, 50]
lons = [-100, 160, 100]
points = [shapely.Point(x, y) for x, y in zip(lons, lats)]model = PlateModel("Muller2019")
paleo_points = reconstruct_shapely_points(model, points, 100)
print(paleo_points)
```### GPlates Web Service server
By default, https://gws.gplates.org is used. You can use .env file to specify your service URL. Alternertively, you can `export GWS_URL=https://your-service-url` in a terminal.
See [env.template](src/gwspy/env.template) and [setup GWS server with Docker](https://github.com/GPlates/gplates-web-service/tree/master/docker#-quick-start).
### Dependencies
- [requests](https://pypi.org/project/requests/)
- [shapely](https://pypi.org/project/shapely/)### API reference
API reference can be found at https://michaelchin.github.io/gwspy/.
### Contact
The [EarthByte group](https://www.earthbyte.org/contact-us-3/) at the University of Sydney is responsible for maintaining the GPlates software suite.
### Examples
👉 [reconstruct_shapely_points.py](https://github.com/michaelchin/gplates-python-proxy/blob/main/examples/reconstruct_shapely_points.py)
The red dots are present-day locations. The blue dots are paleo-locations at 100Ma.

👉 [plot_subduction_zones.py](https://github.com/michaelchin/gplates-python-proxy/blob/main/examples/plot_subduction_zones.py)

👉 [plot_topological_plate_polygons.py](https://github.com/michaelchin/gplates-python-proxy/blob/main/examples/plot_topological_plate_polygons.py)

[All Examples](https://github.com/michaelchin/gplates-python-proxy/blob/main/examples/readme.md)