2.7.4.1. pycsamt.airborne.qc#

Shared structural QC and inspection for airborne EM datasets.

These utilities deliberately assess representation quality, completeness, and metadata consistency. They do not invent universal geophysical thresholds for signal-to-noise ratio, frequency range, or anomaly quality. Technology-specific scientific QC can later be registered on top of this common structural layer.

AirborneQCIssue inherits PyCSAMTObject as a lightweight immutable finding, the same choice made for QualityComment and for the registry definitions in pycsamt.airborne.registry. AirborneInspection and AirborneQCReport inherit CoreObject, matching pycsamt.airborne.base: they aggregate and summarize, rather than perform electromagnetic arithmetic themselves.

Functions

assess_airborne_qc(dataset)

Assess common structural completeness and metadata consistency.

inspect_airborne(obj)

Return a compact inventory for dataset, line, record, or EMTF object.

Classes

AirborneInspection(object_type[, ...])

Compact scientific inventory of an airborne object.

AirborneQCIssue(code, severity, message[, ...])

One structural/metadata QC finding.

AirborneQCReport(technologies, metrics, ...)

Common structural QC report for an airborne dataset.

class pycsamt.airborne.qc.AirborneQCIssue(code, severity, message, line_id=None, sample_id=None)[source]

Bases: PyCSAMTObject

One structural/metadata QC finding.

Parameters:
  • code (str) – Short machine-readable finding code, for example "missing_reference_station". Lower-cased on construction.

  • severity ({"info", "warning", "error"}) – Finding severity. "error" reflects an internally inconsistent scientific state (for example a non-positive frequency axis), not merely incomplete or sparse data; see assess_airborne_qc().

  • message (str) – Human-readable description. Stripped on construction.

  • line_id (str, optional) – Flight line the finding applies to, when scoped to one line.

  • sample_id (str, optional) – Sample the finding applies to, when scoped to one record.

Raises:

ValueError – If code is empty, or severity is not one of "info", "warning", "error".

code: str
severity: str
message: str
line_id: str | None = None
sample_id: str | None = None
class pycsamt.airborne.qc.AirborneInspection(object_type, technologies=<factory>, n_lines=0, n_samples=0, n_records=0, transfer_function_names=<factory>, bbox=None, attrs=<factory>)[source]

Bases: CoreObject

Compact scientific inventory of an airborne object.

Returned by inspect_airborne() for a dataset, line, record, or bare EMTF; the fields below are filled in as far as they are meaningful for that object_type (for example a single record leaves n_lines/bbox at their defaults).

Parameters:
  • object_type ({"dataset", "line", "record", "emtf"}) – Kind of object the inventory describes.

  • technologies (tuple of str, optional) – Canonical technologies identified on the object; see identify_airborne_technologies().

  • n_lines (int, default 0) – Counts meaningful at and above the object’s own level.

  • n_samples (int, default 0) – Counts meaningful at and above the object’s own level.

  • n_records (int, default 0) – Counts meaningful at and above the object’s own level.

  • transfer_function_names (tuple of str, optional) – Sorted union of transfer-function names present.

  • bbox (BBox, optional) – Geographic bounding box, when applicable and available.

  • attrs (dict, optional) – Object-type-specific extra fields (for example sample_id for a record, or name/method for a dataset).

object_type: str
technologies: tuple[str, ...]
n_lines: int = 0
n_samples: int = 0
n_records: int = 0
transfer_function_names: tuple[str, ...]
bbox: Any | None = None
attrs: dict[str, Any]
class pycsamt.airborne.qc.AirborneQCReport(technologies, metrics, line_metrics, issues=<factory>)[source]

Bases: CoreObject

Common structural QC report for an airborne dataset.

Returned by assess_airborne_qc().

Parameters:
  • technologies (tuple of str) – Canonical technologies identified across the dataset.

  • metrics (dict) – Dataset-level scalar metrics (coverage fractions, counts); see assess_airborne_qc() for the exact keys.

  • line_metrics (dict of str to dict) – Per-line metrics keyed by line_id; see _line_metrics() for the exact keys.

  • issues (tuple of AirborneQCIssue, optional) – Individual findings, most to least specific in scope (per-sample, then per-line, then dataset-wide) in the order they were raised.

technologies: tuple[str, ...]
metrics: dict[str, Any]
line_metrics: dict[str, dict[str, Any]]
issues: tuple[AirborneQCIssue, ...]
property status: str[source]

Return "error", "warning", or "pass".

The worst severity present in issues, or "pass" when there are none.

property errors: tuple[AirborneQCIssue, ...][source]

Return only the "error"-severity issues.

property warnings: tuple[AirborneQCIssue, ...][source]

Return only the "warning"-severity issues.

pycsamt.airborne.qc.inspect_airborne(obj)[source]

Return a compact inventory for dataset, line, record, or EMTF object.

Parameters:

obj (AirborneEMDataset, AirborneEMLine, AirborneEMRecord, or EMTF) – Object to summarize.

Returns:

Inventory populated as far as meaningful for obj’s type.

Return type:

AirborneInspection

Raises:

TypeError – If obj is none of the supported types.

pycsamt.airborne.qc.assess_airborne_qc(dataset)[source]

Assess common structural completeness and metadata consistency.

Parameters:

dataset (AirborneEMDataset) – Dataset to assess.

Returns:

Dataset-level and per-line metrics plus individual findings. See AirborneQCReport.metrics for the exact dataset-level keys this function populates (record/EMTF coverage fractions, valid-frequency and finite-response fractions, primary/derived transfer-function counts, variance/covariance coverage fractions, and reference-metadata coverage).

Return type:

AirborneQCReport

Raises:

TypeError – If dataset is not an AirborneEMDataset.

Notes

The report is intentionally descriptive. A missing record, missing covariance, or absent coordinates can be important without being a universal processing failure, so only internally inconsistent scientific states – currently just a non-positive or non-finite frequency axis on an attached EMTF – are classified as "error". Everything else that is merely incomplete or sparse is reported at "info"/"warning" severity; see AirborneQCIssue.