pycsamt.agents.inversion_eval#
pycsamt.agents.inversion_eval#
InversionEvaluationAgent — Evaluate inversion result quality.
Computes: * Per-station RMS misfit between observed and model-predicted responses. * Residual phase tensor section (data PT minus model PT). * Misfit pseudosection (normalised ρa residuals).
Uses plot_station_response() for per-station
response overlay and the phase tensor pipeline for residual PT.
Classes
|
Evaluate inversion quality: RMS, residual PT, misfit section. |
- class pycsamt.agents.inversion_eval.InversionEvaluationAgent(*, api_key=None, model=None, llm_provider='claude')[source]#
Bases:
BaseAgentEvaluate inversion quality: RMS, residual PT, misfit section.
Input keys#
sites_obs/path_obs: Sites or str — observed datasites_mod/path_mod: Sites or str — model-predicted responsesoutput_dir: str, optionalcomponent: str — default"xy"Output data keys#
rms_per_stationdict {station: rms}rms_globalfloatresidual_pt_tablepandas DataFramefiguresdictfigure_pathsdict- SYSTEM_PROMPT: str = 'You are an expert MT inversion quality assessor.\nGiven a misfit summary, write 3–4 sentences that:\n1. State whether the inversion converged acceptably (RMS 0.8–1.5 = good).\n2. Identify stations or period bands with elevated misfit.\n3. Diagnose likely causes (3-D effects, noise, model inadequacy).\n4. Recommend whether to re-run with adjusted regularisation.\nReply in plain 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.0at the top.Record wall-clock time with
t0 = time.time().Return
AgentResult(elapsed_seconds=time.time()-t0, cost_estimate_usd=self._last_cost, ...).
- Parameters:
- Return type: