Geometry

class of dascore.core.inventory
inherits from: InventoryModel, RichRepr, DascoreBaseModel, pydantic.main.BaseModel
source
WarningExperimental

Experimental: this may change in any minor release without a deprecation period; see what experimental means.

Geometry(
    description: str = ““,
    extra_fields: collections.abc.Mapping[str, str | int | float | bool[str, int, float, bool]] = ,
    name: str =”“,
    optical_distance: tuple[float, …] ,
    columns: collections.abc.Mapping[str, tuple[float, …]] ,
    units: collections.abc.Mapping[str, str] = ,
)-> None

Measured curves along an interval of an optical path.

optical_distance holds at least two strictly increasing control points and defines a half-open coverage span. Each named column supplies one value per control point. CRS axis columns use CRS units; other numeric columns declare their own units. For coils, optical distance advances while physical coordinates repeat. Interpolation is linear within segments and undefined outside them. Overlapping segments must describe different columns and share the same name.

Examples

from dascore.core.inventory import Geometry

# A surveyed run, placed by the CRS's axes.
trench = Geometry(
    name="trench",
    optical_distance=(0.0, 100.0),
    columns={"x": (0.0, 86.6), "y": (0.0, 0.0), "z": (-0.5, -0.5)},
)

# A curve which is not a position at all.
chainage = Geometry(
    name="chainage",
    optical_distance=(0.0, 100.0),
    columns={"chainage": (1200.0, 1290.0)},
    units={"chainage": "m"},
)

Methods

Name Description
interpolate Return each column’s values at the requested optical distances.
model_copy Copy the model, dropping cached values the update invalidates.
new Create a new instance with some attributes updated.