piv_streamlines — PIV visualise op

• Data kinds: flow2d → table

• Call: import fullseye as fs; fs.ledger.piv_streamlines(flow, seeds=None, separation=None, step=0.25, max_length=None, min_speed=0.001, test_ratio=0.5) (to call the implementation directly, import pivops; pivops.piv_streamlines(flow, seeds=None, separation=None, step=0.25, max_length=None, min_speed=0.001, test_ratio=0.5); from the registry, opspiv.get("piv_streamlines"))

Usage

Traces streamlines with RK4 (corresponds to MATLAB's stream2 / streamslice).

Omitting seeds places seeds automatically with Jobard–Lefer (1997) evenly spaced placement. Streamlines run at spacings of about separation and are cut off where they come closer than test_ratio * separation. Arrow plots collapse when dense, and placing seeds by hand leaves gaps, but this placement creates neither gaps nor overlaps (the 2 properties below are used as gates).

• Sample points of different streamlines never come closer than test_ratio * separation.

• Every grid point with speed at least min_speed lies within separation of some streamline (nothing missed).

Coordinates are on the flow grid (row 0 at the top, (row, col)). The direction field is divided by the speed and advances by arc length, so 1 step is step grid units. The speed is returned separately for each point on the streamline.

Args:

flow: (2, h, w) (dy, dx).

seeds: (row, col) of shape (n, 2). None places them automatically.

separation: spacing of streamlines [grid]. None gives max(h, w) / 25 (at least 2).

step: 1 step of RK4 [grid].

max_length: maximum length in one direction [grid]. None gives 4 * (h + w).

min_speed: stop where slower than this (ratio to the maximum speed).

test_ratio: the cut-off distance as a multiple of separation (0 < x ≤ 1).

Returns:

dict(table): paths (list of (m_i, 2), ordered upstream → downstream),

speed (list of speeds at each point), seeds, stop (list of reason pairs

(backward, forward)), n, separation, d_test, step,

stop_counts (count per reason).

Raises:

ValueError: shape / non-finite values of flow, parameters out of range, seeds outside the grid.

Detailed usage guide

• piv_displacement family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• piv_field_analysis_tour — py -3.11 examples/piv_field_analysis_tour.py

Ops the type connects to (they accept table as input)

—

Same category (visualise)

piv_flow_to_rgbimage · piv_line_integral_convolution · piv_quiver · piv_streamline_image


*Provenance: pivops.py — PIV operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.