Skip to main content

glacier_lengths — Statistical glacier length calculations

build pypi Documentation Status

PyPI version fury.io

Conda Version Conda Downloads Conda Platforms

Often when glacier lengths are calculated, only the glacier centerline is considered. This is arguably not a statistically representative measure for the entire front, as it just considers one point on the glacier outline. The glacier_lengths package aims to simplify length calculations along an arbitrary amount of lines buffered around the glacier centerline.

Installation

pip install glacier_lengths

pip install git+https://github.com/erikmannerfelt/glacier_lengths.git

Documentation

See the documentation at https://glacier-lengths.readthedocs.io

Example

Calculate the length change of Rhonegletscher:

import geopandas as gpd
import glacier_lengths

# Read the example data
outlines = gpd.read_file("examples/rhone/data/outlines.shp").sort_values("year")
old_outline = outlines.iloc[0]
new_outline = outlines.iloc[1]
centerline = gpd.read_file("examples/rhone/data/centerline.shp").iloc[0]

# Generate ~40 buffered lines around the glacier centerline
old_buffered_lines = glacier_lengths.buffer_centerline(centerline.geometry, old_outline.geometry)
# Cut the newly generated lines to the new_outline
new_buffered_lines = glacier_lengths.cut_centerlines(old_buffered_lines, new_outline.geometry)

# Measure the lengths of the old and new glacier centerlines.
old_lengths = glacier_lengths.measure_lengths(old_buffered_lines)
new_lengths = glacier_lengths.measure_lengths(new_buffered_lines)

# Print the results.
print(f"""
{old_outline['year']}: {old_lengths.mean():.1f}±{old_lengths.std():.1f} m
{new_outline['year']}: {new_lengths.mean():.1f}±{new_lengths.std():.1f} m
""")

prints:

1928: 10783.6±38.8 m
2020: 9699.9±7.6 m

Plot a figure

python examples/rhone/plot_rhone.py

Testing

Run python -m pytest in the cloned repo base directory.

Metadata

Release files for glacier-lengths 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glacier-lengths 0.1.2
File Size Uploaded Provenance
glacier_lengths-0.1.2.tar.gz 8.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for glacier-lengths 0.1.2
File Interpreter ABI Platform
glacier_lengths-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.8 kB

Release files / glacier_lengths-0.1.2.tar.gz

Download URL glacier_lengths-0.1.2.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f411a296679c98343875480c70b0fbf2c5052dafc264ef6a21d2bc60f82252ec
BLAKE2b-256 checksum
How to use checksums
99eb754af39162d3f8f39b58ad083010717990633946fb1d9aae134a983f389f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Release files / glacier_lengths-0.1.2-py3-none-any.whl

Download URL glacier_lengths-0.1.2-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c254b044abae1283a585c0930577cf9402225eaefadf315ad5cd03e858356fce
BLAKE2b-256 checksum
How to use checksums
530a3050e6c487d44a8b0004e3139a22ce6d15044605b80d74b6dc5e2a6e7a4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Security for glacier-lengths 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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