swarmflow op• Data kinds: table → table
• Call: import fullseye as fs; fs.ledger.stagnation_from_centerline(field, speed=None, d_range=(0.04, 0.6), min_points: 'int' = 4, n_iter: 'int' = 80) -> 'dict' (to call the implementation directly, import swarmflow; swarmflow.stagnation_from_centerline(field, speed=None, d_range=(0.04, 0.6), min_points: 'int' = 4, n_iter: 'int' = 80) -> 'dict'; from the registry, opsdrive.get("stagnation_from_centerline"))
Linearizes the centerline deficit to read the upstream impact point (stagnation point), the obstacle center and its radius (implementation 1, upstream points only).
1. Among grid cells whose deficit (3 × 3 mean) exceeds the upper limit of d_range, the most upstream one is taken as "near the impact point".
2. In columns slightly upstream of it (4 columns), the row with maximum deficit is found to sub-grid precision with a parabola, and the mean gives the centreline y_c (the upstream deficit R²(Δx² − Δy²)/(Δx² + Δy²)² is maximal at Δy = 0).
3. At height y_c the deficit is taken by linear interpolation between rows, and on cells upstream of the point near impact that lie within d_range, 1/√d = (x_c − x)/R is fitted by weighted least squares (speed noise σ_d becomes σ_d/(2d^{3/2}) in 1/√d, so weight d^{3/2} —— distant points with small deficit go wild with noise): R = −1/slope, x_c = intercept × R. Stagnation point = (x_c − R, y_c).
4. When speed is not given, U is re-estimated by dividing out the closed form from u at the upstream edge, and step 3 is repeated (until the change in U is below 1e-9 or n_iter times. Convergence is first order, about 30 iterations in a field with R = 0.6 and distance 3 to the edge). The upstream edge is also depleted as 1/r² (4 % at R = 0.6, distance 3), so using the median at the edge directly as U bends the line.
Returns:
dict: stagnation (x, y), center (x, y), radius, n_used, rms_residual (residual of the 1/√d fit),
speed, ok (True if there are enough points and the slope is negative).
• 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.
• poc_swarm_obstacle_from_flow — py -3.11 examples/poc_swarm_obstacle_from_flow.py
table as input)course_layout · course_occupancy · course_contains · world_build · world_camera · world_move · lidar_scan · rss_longitudinal_same
swarmflow)sph_kernel · sph_density_pressure · swarm_simulate · swarm_render_overhead · swarm_field_from_tracks · swarm_field_from_piv · potential_flow_cylinder · velocity_deficit_map
*Provenance: swarmflow.py — DRIVE 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.