PySLFP: Python Sea Level Fingerprints
pyslfp is a Python package for computing elastic sea level "fingerprints". It provides a robust and user-friendly framework for solving the sea level equation, accounting for the Earth's elastic deformation, gravitational self-consistency between the ice, oceans, and solid Earth, and rotational feedback effects.
The core of the library is built around the EarthState and FingerPrintOperator classes, which implement an iterative solver to determine the unique pattern of sea-level change that results from a change in a surface load, such as the melting of an ice sheet.
Key Features
- Elastic Sea Level Equation Solver: Implements an iterative solver for the sea level equation and the generalised sea level equation needed within adjoint calculations.
- Comprehensive Physics: Accounts for Earth's elastic response (via load Love numbers), self-consistent gravity, and rotational feedbacks (polar wander).
- Ice History Models: Includes a data loader for the ICE-5G, ICE-6G, and ICE-7G global ice history models, allowing for easy setup of realistic background states.
- Forward and Adjoint Modeling: Provides a high-level interface for both forward calculations (predicting sea level change from a load) and adjoint modeling (for use in inverse problems), natively integrated with
pygeoinfand based on the theory of Al-Attar et al. (2024). - Built-in Visualization: Comes with high-quality map plotting utilities built on
matplotlibandcartopyfor easy visualization of global data grids and regional boundaries (e.g., IHO Seas, AR6, IMBIE).
Installation
You can install pyslfp directly from PyPI using pip. The package requires Python 3.11+ and its dependencies will be installed automatically.
pip install pyslfp
Installation with Poetry
Alternatively, for development purposes, you can install pyslfp using Poetry. First, clone the repository and then run:
poetry install
To include the development dependencies (for running tests, building documentation, etc.), use the --with dev flag:
poetry install --with dev
Tutorials
You can run the interactive tutorials directly in Google Colab to get started with the core concepts of the library.
| Tutorial Name | Link to Colab |
|---|---|
| Tutorial 1 - Calculating a Basic Sea Level Fingerprint | |
| Tutorial 2 - A Deeper Dive into the Sea Level Equation |
Core Components
The library is organized into several key modules designed around abstract Hilbert spaces and linear operators:
state.py: Contains theEarthStateandEarthModelclasses for managing planetary parameters, resolutions, and static background topologies.linear_operators.py: Contains theFingerPrintOperator,WMBMethod, and associated mappings required to formulate sea level and gravimetry equations as rigorous linear inverse problems.regions.py: Provides theRegionsmixin for automated spatial masking and boundary plotting (including IHO Seas, IMBIE, HydroBASINS, and AR6).ice_ng.py: Provides theIceNGclass for loading and interpolating global ice history models.plotting.py: Includes plotting functions for visualizingpyshtools.SHGridobjects natively on Cartopy projections.
Dependencies
pyslfp is built on top of a robust stack of scientific Python packages:
- numpy & scipy: For numerical operations.
- pyshtools: For spherical harmonic transforms and grid representations.
- pygeoinf: For formulating and solving associated Bayesian inverse problems.
- Cartopy & matplotlib: For creating high-quality map projections and plots.
- regionmask & geopandas: For working with geospatial vector masks and boundaries.
License
This project is licensed under the BSD-3-Clause License.
Citations
If you use pyslfp in your published work, please cite the following paper:
- Al-Attar, D., Syvret, F., Crawford, O., Mitrovica, J.X. and Lloyd, A.J., 2024. Reciprocity and sensitivity kernels for sea level fingerprints. Geophysical Journal International, 236(1), pp.362-378.
Furthermore, if you use the ice models contained in the IceNG class, please cite the appropriate ice history model:
Contributing
Contributions are welcome! If you have a suggestion or find a bug, please open an issue. Pull requests are also encouraged.
Release files for pyslfp 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyslfp-2.0.1.tar.gz | 46.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyslfp-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 102.1 kB
Release files / pyslfp-2.0.1.tar.gz
| Download URL | pyslfp-2.0.1.tar.gz |
|---|---|
| Size | 46.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4371760cd3ec39d19339d0e28c8076d28ff78a7f547fcd65f76abb5429b25d54
|
|
BLAKE2b-256 checksum How to use checksums |
da6ecf749a761b12f5479bc55fbad7222080419f2164d5539d449080bb08471b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.13 Linux/6.17.0-1020-azure
|
Release files / pyslfp-2.0.1-py3-none-any.whl
| Download URL | pyslfp-2.0.1-py3-none-any.whl |
|---|---|
| Size | 55.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ac30f21d3b3cbaf13dd849f5dffe09c1b242452bc6ee7e6116e0be8ca2ae782e
|
|
BLAKE2b-256 checksum How to use checksums |
9ceb516a5ea26200907a68cda9f659ebf9352a8860e476cccd8b1088094abac7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.13 Linux/6.17.0-1020-azure
|