Processing And Diagnostics Agents#
These agents operate after data loading and before modelling or reporting. They clean, diagnose, transform, and prepare survey data for interpretation or inversion.
DataQCAgent#
DataQCAgent evaluates survey quality after loading. It is the normal
first processing step after MTLoaderAgent and before correction or
analysis.
Use it for station scoring, frequency coverage checks, SNR-like indicators, dead-band detection, outlier flags, and QC summaries.
1from pycsamt.agents import MTLoaderAgent, DataQCAgent
2
3loaded = MTLoaderAgent().execute({"path": "/data/WILLY_EDIs"})
4qc = DataQCAgent().execute({
5 "sites": loaded["sites"],
6 "output_dir": "/out/willy/qc",
7})
8
9print(qc.summary)
10print(qc.get("qc_table"))
StaticShiftAgent#
StaticShiftAgent detects and corrects static-shift effects in apparent
resistivity responses. It belongs after QC and before phase analysis or
inversion preparation.
Use it when station responses show amplitude offsets that may be caused by near-surface conductivity heterogeneity.
1corrected = StaticShiftAgent().execute({
2 "sites": qc["sites"],
3 "output_dir": "/out/willy/static_shift",
4})
5
6print(corrected.summary)
PhaseAnalysisAgent#
PhaseAnalysisAgent runs phase-tensor and dimensionality diagnostics. It
is useful for deciding whether a 1-D, 2-D, or 3-D interpretation is justified
and for preparing inversion orientation choices.
Typical products include phase-tensor summaries, strike estimates, skew or dimensionality indicators, Mohr-style diagnostics, and Argand-style representations.
1phase = PhaseAnalysisAgent().execute({
2 "sites": corrected.get("corrected_sites", corrected.get("sites")),
3 "output_dir": "/out/willy/phase",
4})
5
6print(phase.summary)
7print(phase.llm_interpretation)
TensorRotationAgent#
TensorRotationAgent rotates impedance tensors into a selected coordinate
frame. It is useful after strike analysis, before export, or before inversion
preparation when a consistent orientation is required.
Use it when a workflow has an estimated strike angle or a target coordinate frame that should be applied consistently across stations.
1rotated = TensorRotationAgent().execute({
2 "sites": loaded["sites"],
3 "angle_deg": 35.0,
4 "output_dir": "/out/willy/rotated",
5})
TipperAnalysisAgent#
TipperAnalysisAgent analyzes vertical magnetic transfer functions where
tipper data are available. Use it for induction-arrow products and
tipper-amplitude or phase diagnostics that complement impedance analysis.
1tipper = TipperAnalysisAgent().execute({
2 "sites": loaded["sites"],
3 "periods": [0.01, 0.1, 1.0, 10.0],
4 "output_dir": "/out/willy/tipper",
5})
FrequencyDecimationAgent#
FrequencyDecimationAgent selects a stable subset of frequencies or
periods. It is useful before inversion when data are oversampled, unevenly
sampled, or affected by dead bands.
Use it to produce a compact period set for Occam2D, ModEM, AI inversion, or publication plots.
1decimated = FrequencyDecimationAgent().execute({
2 "sites": loaded["sites"],
3 "n_periods": 32,
4 "output_dir": "/out/willy/decimated",
5})
DenoisingAgent#
DenoisingAgent removes or suppresses noise before analysis or inversion.
It can be used in classical workflows before phase analysis and in AI
workflows before neural inversion.
Use it when QC indicates noisy bands, outlier stations, or responses that need robust preprocessing.
1denoised = DenoisingAgent().execute({
2 "sites": loaded["sites"],
3 "method": "rpca",
4 "output_dir": "/out/willy/denoised",
5})
Processing Order#
A common processing chain is:
MTLoaderAgent -> DataQCAgent -> StaticShiftAgent
-> PhaseAnalysisAgent -> FrequencyDecimationAgent
Add TensorRotationAgent after strike estimation when inversion or export
requires a consistent coordinate frame. Add DenoisingAgent before
analysis or inversion when QC flags noisy data.