pycsamt.agents.sensitivity#

pycsamt.agents.sensitivity#

SensitivityAgent — Compute vertical resolution and Bostick sensitivity kernels for MT data.

Answers “which depth range does each datum actually constrain?” using the Bostick penetration depth and the analytical vertical-resolution formula. Produces a sensitivity pseudosection that makes the depth of investigation (DOI) visually explicit — information that is absent from every standard pseudosection plot.

Wraps#

Classes

SensitivityAgent(*[, api_key, model, ...])

Bostick sensitivity kernels and vertical resolution analysis.

class pycsamt.agents.sensitivity.SensitivityAgent(*, api_key=None, model=None, llm_provider='claude', component='xy', rho_override=None, depth_max=None)[source]#

Bases: BaseAgent

Bostick sensitivity kernels and vertical resolution analysis.

Parameters:
  • api_key (str)

  • model (str)

  • llm_provider (str)

  • component (str, optional) – Impedance component for ρa and Bostick depth (default 'xy').

  • rho_override (float, optional) – Fixed background resistivity (Ω·m) for the analytical ΔD formula. None uses the measured ρa per frequency pair.

  • depth_max (float, optional — km) – Clip depth axis at this value in km (default: auto from data).

  • keys (Output data)

  • ----------

  • path (sites /)

  • component

  • rho_override

  • period_range ([T_min, T_max], optional)

  • depth_max

  • output_dir (str, optional)

  • keys

  • ----------------

  • per-(station (resolution_table pandas.DataFrame —)

  • freq-pair)

  • {station (doi_per_station dict)

  • float (mean_doi_km)

  • dict (figure_paths)

  • dict

Examples

>>> agent = SensitivityAgent(component='xy')
>>> r = agent.execute({"path": "/data/WILLY_EDIs"})
>>> print(r["mean_doi_km"], "km mean DOI")
SYSTEM_PROMPT: str = "You are an expert in MT data resolution and depth-of-investigation analysis.\nGiven a sensitivity analysis result, write 4-5 sentences that:\n1. Describe the maximum Bostick depth reached by the data at the lowest frequency.\n2. Identify depth ranges with poor resolution (large ΔD) and their cause.\n3. State which stations have the best and worst overall depth coverage.\n4. Advise on whether the target depth is within the data's sensitivity window.\n5. Recommend frequency additions or deletions to improve depth resolution.\nReply in plain scientific English.\n"#

Override in subclasses to give the LLM its domain expertise.

execute(input_data)[source]#

Run this agent on input_data and return an AgentResult.

Subclasses must implement this method. The contract:

  • Reset self._last_cost = 0.0 at the top.

  • Record wall-clock time with t0 = time.time().

  • Return AgentResult(elapsed_seconds=time.time()-t0, cost_estimate_usd=self._last_cost, ...).

Parameters:

input_data (dict[str, Any])

Return type:

AgentResult