sec_interp.core.services package
- class sec_interp.core.services.DrillholeService[source]
Bases:
IDrillholeServiceService for processing drillhole data.
- prepare_task_input(line_layer: QgsVectorLayer, buffer_width: float, collar_layer: QgsVectorLayer, collar_id_field: str, use_geometry: bool, collar_x_field: str, collar_y_field: str, collar_z_field: str, collar_depth_field: str, survey_layer: QgsVectorLayer, survey_fields: dict[str, str], interval_layer: QgsVectorLayer, interval_fields: dict[str, str], dem_layer: QgsRasterLayer | None = None, band_num: int = 1) DrillholeTaskInput[source]
Prepare detached domain data for async processing.
This method centralizes the extraction of data from QGIS layers in the Main Thread, creating a detached DrillholeTaskInput DTO.
- process_intervals(collar_points: list[tuple], collar_data: list[dict[str, Any]], survey_data: dict[Any, list[tuple]], interval_data: dict[Any, list[tuple]], collar_id_field: str, use_geometry: bool, collar_x_field: str, collar_y_field: str, line_data: Any, distance_area: Any, buffer_width: float, section_azimuth: float, survey_fields: dict[str, str], interval_fields: dict[str, str]) tuple[list, list][source]
Process drillhole interval data using detached structures.
- process_task_data(task_input: DrillholeTaskInput, feedback: Any | None = None) Any[source]
Process drillholes using detached domain data (Thread-Safe).
- project_collars(collar_data: list[dict[str, Any]], line_data: Any, distance_area: Any, buffer_width: float, collar_id_field: str, use_geometry: bool, collar_x_field: str, collar_y_field: str, collar_z_field: str, collar_depth_field: str, pre_sampled_z: dict[Any, float] | None = None) list[tuple[Any, float, float, float, float]][source]
Project collar points onto section line using detached domain data.
- class sec_interp.core.services.GeologyService[source]
Bases:
IGeologyServiceService for generating geological profiles.
This service handles the extraction of geological unit intersections along a cross-section line.
- generate_geological_profile(line_lyr: qgis.core.QgsVectorLayer, raster_lyr: qgis.core.QgsRasterLayer, outcrop_lyr: qgis.core.QgsVectorLayer, outcrop_name_field: str, band_number: int = 1) list[GeologySegment][source]
Generate geological profile data by intersecting the section line with outcrop polygons.
Extracts geological unit intersections along the cross-section line, calculates elevations from the DEM, and returns a list of segments.
- Parameters:
line_lyr – The QGIS vector layer representing the cross-section line.
raster_lyr – The Digital Elevation Model (DEM) raster layer.
outcrop_lyr – The QGIS vector layer containing geological outcrop polygons.
outcrop_name_field – The attribute field name for geological unit names.
band_number – The raster band to use for elevation sampling (default 1).
- Returns:
A list of GeologySegment objects, sorted by distance along the section.
- Return type:
GeologyData
- Raises:
DataMissingError – If the line layer has no features.
GeometryError – If the line geometry is invalid.
ProcessingError – If the intersection processing fails.
- prepare_task_input(line_lyr: qgis.core.QgsVectorLayer, raster_lyr: qgis.core.QgsRasterLayer, outcrop_lyr: qgis.core.QgsVectorLayer, outcrop_name_field: str, band_number: int = 1) GeologyTaskInput[source]
Prepare detached domain data for background task.
- process_task_data(task_input: GeologyTaskInput, feedback: Any | None = None) list[GeologySegment][source]
Process geological data in a thread-safe way (Domain-Pure logic).
- class sec_interp.core.services.ProfileService[source]
Bases:
IProfileServiceService for generating topographic profiles.
This service handles the extraction of elevation data along a cross-section line by sampling a raster DEM.
- generate_topographic_profile(line_lyr: qgis.core.QgsVectorLayer, raster_lyr: qgis.core.QgsRasterLayer, band_number: int = 1, interval: float | None = None) list[tuple[float, float]][source]
Generate topographic profile data by sampling elevation along the section line.
- Parameters:
line_lyr – The cross-section line layer.
raster_lyr – The DEM/raster layer for elevation.
band_number – Raster band to sample (default: 1).
interval – Optional sampling interval. If None, uses raster resolution.
- Returns:
A list of (distance, elevation) tuples representing the profile.
- Raises:
DataMissingError – If line layer has no features.
GeometryError – If line geometry is invalid.
- class sec_interp.core.services.StructureService[source]
Bases:
IStructureServiceService for projecting structural measurements onto cross-sections.
This service handles the filtering and projection of structural measurements (dip/strike) onto a cross-section plane to calculate apparent dip.
- project_structures(line_lyr: qgis.core.QgsVectorLayer, raster_lyr: qgis.core.QgsRasterLayer, struct_lyr: qgis.core.QgsVectorLayer, buffer_m: int, line_az: float, dip_field: str, strike_field: str, band_number: int = 1) list[StructureMeasurement][source]
Project structural measurements onto the cross-section plane.
Filters structures within a buffer, samples elevation, and calculates apparent dip for each measurement.
- Parameters:
line_lyr – The cross-section line vector layer.
raster_lyr – The DEM raster layer for elevation sampling.
struct_lyr – Vector layer containing structural measurements.
buffer_m – Search buffer distance in meters.
line_az – Azimuth of the section line in degrees.
dip_field – Name of the field containing dip values.
strike_field – Name of the field containing strike values.
band_number – Raster band to use for elevation (default: 1).
- Returns:
A list of StructureMeasurement objects sorted by distance along section.
- Raises:
DataMissingError – If line layer has no features.
GeometryError – If line geometry is invalid.
Submodules
- sec_interp.core.services.access_control_service module
- sec_interp.core.services.drillhole_service module
- sec_interp.core.services.export_service module
- sec_interp.core.services.geology_service module
- sec_interp.core.services.preview_service module
- sec_interp.core.services.profile_service module
- sec_interp.core.services.structure_service module