Skip to main content

LCS-Parcels

PyPI Docs CI License: MIT DOI

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. It also extracts hyperbolic LCS as shrink lines, and coherent vortex boundaries as closed shear lines following Haller & Beron-Vera (2013), doi:10.1017/jfm.2013.391.

The documentation is at lcs-parcels.readthedocs.io and the source at github.com/geomar-od-lagrange/lcs_parcels.

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 subsets the 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()

# 5. Or to the coherent vortex boundaries.
eddies = flowmap.elliptic_lcs()

Every returned array carries long_name and units, so ftle.plot(x="lon_grid", y="lat_grid") labels itself.

print(flowmap) gives a short 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

  • get_data downloads the CMEMS subsets the examples read. Run once, before them. Needs CMEMS credentials.
  • example_grid_pset exercises the package API on its own, without Parcels.
  • cabo_verde_ftle shows the Parcels v4 wiring and the FTLE from CMEMS currents.
  • cabo_verde_lcs builds repelling and attracting LCS as strain tensor lines.
  • cabo_verde_lcs_evolution evolves an extracted LCS as a material curve.
  • cape_cauldron_vortices finds coherent vortex boundaries as closed shear lines in the Agulhas-ring corridor.

The Parcels examples need the examples pixi environment (pixi install -e examples) and the CMEMS currents files that get_data downloads. The examples index has 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 the API guide and the numerics notes.

License

MIT

Metadata

Release files for lcs-parcels 2026.11.9.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 lcs-parcels 2026.11.9.1
File Size Uploaded Provenance Actions
lcs_parcels-2026.11.9.1.tar.gz 152.9 kB With provenance Details for lcs_parcels-2026.11.9.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lcs-parcels 2026.11.9.1
File Interpreter ABI Platform Actions
lcs_parcels-2026.11.9.1-py3-none-any.whl Python 3 none any Details for lcs_parcels-2026.11.9.1-py3-none-any.whl

Total release size: 189.4 kB

Release files / lcs_parcels-2026.11.9.1.tar.gz

Download URL lcs_parcels-2026.11.9.1.tar.gz
Size 152.9 kB
Tags Source
SHA-256 checksum
How to use checksums
111fdf18d545b3d1992efc1d3d4be6de79b8ca83b479d6ca17bb0ef4e465d8fe
BLAKE2b-256 checksum
How to use checksums
4465bc20470458021331ae321f22b33596c48c8d918c65d40981f045cea1c36f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / lcs_parcels-2026.11.9.1-py3-none-any.whl

Download URL lcs_parcels-2026.11.9.1-py3-none-any.whl
Size 36.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5daeeff9126d77a933af839c2acb8a91e5c0d16dcf1b14138d35faf3dc8dc57
BLAKE2b-256 checksum
How to use checksums
6cbbdc42a358748ce6e9ec26bd8f516c81ce637cc690e6a3b96a9493cb4921fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for lcs-parcels 2026.11.9.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lcs_parcels-2026.11.9.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

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