import dascore as dc
inventory = dc.get_example_inventory("tunnel")
path = inventory.networks[0].fiber_arrays[0].optical_paths[0]
coil = path.select(section="coil")
assert (coil.distance_min, coil.distance_max) == (1527.5, 1537.5)
# The trench lies on both sides of the coil; distance picks one.
near = path.select(section="trench", distance=(None, 1527.5))
assert (near.distance_min, near.distance_max) == (1500.0, 1527.5)select
WarningExperimental
Experimental: this may change in any minor release without a deprecation period; see what experimental means.
select(
self ,
distance: tuple[float | None[float, None], float | None[float, None]] = (None, None),
**labels: str | int | float | bool ,
)-> ‘Self’
Return a new path clipped to a distance interval.
Absolute optical distances are preserved: every track keeps the distances it had, clipped to the piece rather than rebased on it.
Parameters
| Parameter | Description |
|---|---|
| distance |
The (start, stop) optical distances to keep; None leaves an end open. |
| **labels |
A label group and the value to keep the stretch of, such assection="coil"; True selects a membership group. Thestretch must be contiguous within distance, since a pathis one range; a value stated in several places raises and names them, to be chosen between by distance.
|