Skip to main content

PySLFP: Python Sea Level Fingerprints

PyPI version License: BSD-3-Clause Build Status

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 pygeoinf and based on the theory of Al-Attar et al. (2024).
  • Built-in Visualization: Comes with high-quality map plotting utilities built on matplotlib and cartopy for 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 Open In Colab
Tutorial 2 - A Deeper Dive into the Sea Level Equation Open In Colab


Core Components

The library is organized into several key modules designed around abstract Hilbert spaces and linear operators:

  • state.py: Contains the EarthState and EarthModel classes for managing planetary parameters, resolutions, and static background topologies.
  • linear_operators.py: Contains the FingerPrintOperator, WMBMethod, and associated mappings required to formulate sea level and gravimetry equations as rigorous linear inverse problems.
  • regions.py: Provides the Regions mixin for automated spatial masking and boundary plotting (including IHO Seas, IMBIE, HydroBASINS, and AR6).
  • ice_ng.py: Provides the IceNG class for loading and interpolating global ice history models.
  • plotting.py: Includes plotting functions for visualizing pyshtools.SHGrid objects 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)

Source distribution for pyslfp 2.0.1
File Size Uploaded
pyslfp-2.0.1.tar.gz 46.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyslfp 2.0.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

2.2.0

2 release files

2.0.6

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page