Metadata-Version: 2.4
Name: glacier-strain-tools
Version: 2.0.1
Summary: Tools for deriving surface-parallel strain rates and directions from glacier velocity fields.
Author-email: Tom Chudley <tom.chudley@bristol.ac.uk>
License-Expression: MIT
Project-URL: Homepage, https://github.com/trchudley/glacier-strain-tools
Project-URL: Repository, https://github.com/trchudley/glacier-strain-tools
Project-URL: Issues, https://github.com/trchudley/glacier-strain-tools/issues
Keywords: glaciology,ice,ice sheet,glacier,velocity,dynamics,geospatial,satellite
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Scientific/Engineering :: Image Processing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rioxarray
Requires-Dist: numpy
Requires-Dist: numba
Requires-Dist: scipy
Requires-Dist: matplotlib
Dynamic: license-file

# glacier-strain-tools

[![conda-forge version](https://anaconda.org/conda-forge/glacier-strain-tools/badges/version.svg)](https://anaconda.org/conda-forge/glacier-strain-tools) [![PyPI version](https://badge.fury.io/py/glacier-strain-tools.svg)](https://pypi.org/project/glacier-strain-tools/) [![Documentation Status](https://readthedocs.org/projects/glacier-strain-tools/badge/?version=latest)](https://glacier-strain-tools.readthedocs.io/en/latest/?badge=latest) [![Unit Tests](https://github.com/trchudley/glacier-strain-tools/actions/workflows/unit-test.yml/badge.svg)](https://github.com/trchudley/glacier-strain-tools/actions/workflows/unit-test.yml) 

Tools for deriving surface-parallel strain rates and directions from glacier velocity fields.

## Installation

Install from `pip` or `conda`/`mamba` (preferred):

```bash
conda install -c conda-forge glacier-strain-tools
```

If you want the latest development version:

```bash
git clone https://github.com/trchudley/glacier-strain-tools.git
cd glacier-strain-tools
python -m pip install -e .
```

## Minimal Example: Logarithmic Strain Rate

```python
import rioxarray as rxr
from strain_tools import strain

# Load velocity fields
vx = rxr.open_rasterio('data/vx.tif').squeeze()
vy = rxr.open_rasterio('data/vy.tif').squeeze()

# Inputs:
# pixel_size   : image resolution in distance units (e.g. meters)
# length_scale : half-length scale for the virtual stake method (same distance units)
logarithmic_strains = strain.logarithmic(
	vx=vx,
	vy=vy,
	pixel_size=200.0,
	length_scale=500.0,
	unit_time="a",  # velocity field is in units m a-1
)
```

## What is Included

- Logarithmic and nominal strain-rate calculations
- Principal, longitudinal, transverse, shear, and effective strain rates
- Strain-rate uncertainty estimates
- Deviatoric and Cauchy stress conversion from strain rates

## Documentation

Full documentation, theory notes, and API reference are available on ReadTheDocs at [https://glacier-strain-tools.readthedocs.io](https://glacier-strain-tools.readthedocs.io).

## Contact

Tom Chudley | [tom.chudley@bristol.ac.uk](mailto:tom.chudley@bristol.ac.uk)

