LCS-Parcels
Lagrangian coherent structure (LCS) diagnostics on top of
Parcels: deformation gradient grad F,
Cauchy-Green tensor (grad F)^T grad F, its eigen-analysis, and the
finite-time Lyapunov exponent (FTLE), following Haller (2015),
doi:10.1146/annurev-fluid-010313-141322.
This package contains no Parcels code. It emits a particle set to release and ingests the advected positions to diagnose. You run Parcels (or anything else) in between.
Install
Python 3.12 or newer:
$ pip install lcs_parcels
For unreleased main:
$ pip install git+https://github.com/geomar-od-lagrange/lcs_parcels.git
To work on the package code instead, or to run the examples, use pixi:
$ pixi install
$ pixi run test # run the test suite, including the Parcels-free example
$ pixi run -e examples get-data # download the CMEMS subset the Cabo Verde examples read (once)
$ pixi run -e examples test-examples # execute every example against the current API
Quickstart
import numpy as np
from lcs_parcels import NeighborSeedGrid
# 1. Lay out a seed grid and emit a particle set.
seed = NeighborSeedGrid.from_axes(
lon=np.linspace(-25.0, -20.0, 6),
lat=np.linspace(15.0, 20.0, 5),
)
lon_0, lat_0 = seed.to_parcels_pset()
# 2. Advect (lon_0, lat_0) from t0 to t1 with Parcels, which is not part of
# this package, and collect the final positions.
# 3. Ingest the advected positions into a flow map and diagnose it.
flowmap = seed.pset_to_flowmap(
lon=lon_advected, lat=lat_advected, t0=t0, t1=t1
)
ftle = flowmap.ftle() # xr.DataArray of the FTLE (1/s) on the (i, j) grid
# 4. Or go straight to the hyperbolic LCS curves, FTLE field included.
lcs = flowmap.hyperbolic_lcs()
Lon/lat pairs are keyword-only throughout, so a transposed call raises
TypeError. Every returned array carries long_name and units, so
ftle.plot(x="lon_grid", y="lat_grid") labels itself.
print(flowmap) gives a one-line summary and flowmap.ds gives the dataset
itself:
>>> print(flowmap)
<NeighborFlowMap 6x5 grid, lon -25.00..-20.00, lat 15.00..20.00, t0 2020-01-01T00:00:00, T +7.0 days>
Examples
Examples live under examples/. Each is a jupytext triplet
(.py/.md/.ipynb) sharing one source, and the rendered .ipynb is the one
to read. They are listed in increasing scope:
get_datadownloads the CMEMS subset the Cabo Verde notebooks read. Run once, before them. Needs CMEMS credentials.example_grid_psetexercises the package API on its own, without Parcels.cabo_verde_ftleshows the Parcels v4 wiring and the FTLE from CMEMS currents.cabo_verde_lcsbuilds repelling and attracting LCS as strain tensor lines.cabo_verde_lcs_evolutionevolves an extracted LCS as a material curve.
The Parcels examples need the examples pixi environment (pixi install -e examples) and a CMEMS currents file you save yourself. See
examples/README.md for the reading order and the data.
Scope
Rectilinear grids with a monotonic lon_grid axis, away from the poles.
The limits, and the accuracy of a separation, are in
docs/api.md and
docs/numerics.md.
License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lcs_parcels-2026.8.5.1.tar.gz.
File metadata
- Download URL: lcs_parcels-2026.8.5.1.tar.gz
- Upload date:
- Size: 109.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53705e8bcf1d40c0f26cc7185af641d79e7199cff15f2febab6f0cbce70cc919
|
|
| MD5 |
129e4d0791c74d7ce5e980ad15b66031
|
|
| BLAKE2b-256 |
4f5d02e343bfb9272d28f22a4cbf38149841e79700b711792a7f253a50c4a69a
|
Provenance
The following attestation bundles were made for lcs_parcels-2026.8.5.1.tar.gz:
Publisher:
publish.yml on geomar-od-lagrange/lcs_parcels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lcs_parcels-2026.8.5.1.tar.gz -
Subject digest:
53705e8bcf1d40c0f26cc7185af641d79e7199cff15f2febab6f0cbce70cc919 - Sigstore transparency entry: 2346174488
- Sigstore integration time:
-
Permalink:
geomar-od-lagrange/lcs_parcels@e9372cc087861dfa9fec8cfddc274c8cfdb0a573 -
Branch / Tag:
refs/tags/v2026.8.5.1 - Owner: https://github.com/geomar-od-lagrange
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e9372cc087861dfa9fec8cfddc274c8cfdb0a573 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lcs_parcels-2026.8.5.1-py3-none-any.whl.
File metadata
- Download URL: lcs_parcels-2026.8.5.1-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35514f5de7feecec819aa03c37219d3deb5edae5bc29ebc73bbe31fe0d92d1c0
|
|
| MD5 |
caf253d3606a6c625859a478a8dece3b
|
|
| BLAKE2b-256 |
24ac3704e2da6f750a83e3d2a20cd0b1ce0b75f6eb506515be6b71a03347b0c2
|
Provenance
The following attestation bundles were made for lcs_parcels-2026.8.5.1-py3-none-any.whl:
Publisher:
publish.yml on geomar-od-lagrange/lcs_parcels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lcs_parcels-2026.8.5.1-py3-none-any.whl -
Subject digest:
35514f5de7feecec819aa03c37219d3deb5edae5bc29ebc73bbe31fe0d92d1c0 - Sigstore transparency entry: 2346174519
- Sigstore integration time:
-
Permalink:
geomar-od-lagrange/lcs_parcels@e9372cc087861dfa9fec8cfddc274c8cfdb0a573 -
Branch / Tag:
refs/tags/v2026.8.5.1 - Owner: https://github.com/geomar-od-lagrange
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e9372cc087861dfa9fec8cfddc274c8cfdb0a573 -
Trigger Event:
push
-
Statement type: