sec_interp.core.services package

Services package for geological data processing.

This package contains service classes that handle specific data processing tasks: - GeologyService: Geological profile generation - StructureService: Structural data projection - DrillholeService: Drillhole projection

class sec_interp.core.services.DrillholeService(collar_processor: CollarProcessor | None = None, survey_processor: SurveyProcessor | None = None, interval_processor: IntervalProcessor | None = None, data_fetcher: Any | None = None, trajectory_engine: TrajectoryEngine | None = None)

Bases: IDrillholeService, TranslatableMixin

Service for processing and orchestrating drillhole data (QGIS-agnostic).

__init__(collar_processor: CollarProcessor | None = None, survey_processor: SurveyProcessor | None = None, interval_processor: IntervalProcessor | None = None, data_fetcher: Any | None = None, trajectory_engine: TrajectoryEngine | None = None) → None

Initialize the service with specialized processors.

Parameters:
  • collar_processor – Optional collar processor.

  • survey_processor – Optional survey processor.

  • interval_processor – Optional interval processor.

  • data_fetcher – Kept for backward-compatible construction (unused).

  • trajectory_engine – Optional trajectory engine.

process_context(context: DrillholeContext, feedback: Any | None = None) → tuple[list[GeologySegment], list[DrillholeProjection]] | None

Process drillholes from a detached context (pure computation).

Parameters:
  • context – Fully-detached drillhole data from DrillholeExtractor.

  • feedback – Optional feedback object for progress/cancellation.

Returns:

A tuple (geol_data, drillhole_data), or None if cancelled.

class sec_interp.core.services.GeologyService

Bases: IGeologyService

Service for generating geological profiles (pure computation).

build_segments(context: GeologyContext, feedback: Any | None = None) → list[GeologySegment]

Build geological segments from a detached context.

Interpolates segment elevations along the master profile and builds GeologySegment objects, sorted by distance along the section.

Parameters:
  • context – Fully-detached geology data from GeologyExtractor.

  • feedback – Optional feedback object for progress/cancellation.

Returns:

Sorted list of geological segments.

Return type:

GeologyData

class sec_interp.core.services.StructureService

Bases: IStructureService, TranslatableMixin

Service for projecting structural measurements onto cross-sections.

This service receives pre-extracted structural data (from the GUI’s StructureExtractor) and performs the pure-math projection and apparent dip calculations. It is QGIS-agnostic.

project_structures(line_points: list[tuple[float, float]], struct_data: list[dict[str, Any]], elevation_sampler: Callable[[float, float], float], line_az: float, dip_field: str, strike_field: str) → list[StructureMeasurement]

Project detached structural measurements onto the section plane.

Calculates stations (distance along section), elevations from the injected sampler, and apparent dips based on the section orientation.

Parameters:
  • line_points – Section line vertices as (x, y) tuples.

  • struct_data – List of detached structures ({"point": (x, y), "attributes": {...}}).

  • elevation_sampler – Callable returning elevation at (x, y).

  • line_az – Section azimuth in degrees.

  • dip_field – Field name for dip angle.

  • strike_field – Field name for strike azimuth.

Returns:

Sorted list of projected StructureMeasurement objects.

Return type:

StructureData

Subpackages

Submodules