pycsamt.agents.inversion_prep#
pycsamt.agents.inversion_prep#
InversionPrepAgent — Prepare Occam2D / ModEM data files.
Phase 2 stub: validates the Sites object and writes inversion-ready data files in the requested format. Full Occam2D write support uses pycsamt’s existing model writers; ModEM is planned for Phase 3.
Classes
|
Prepare MT data files for 2-D / 3-D inversion codes. |
- class pycsamt.agents.inversion_prep.InversionPrepAgent(*, api_key=None, model=None, llm_provider='claude', code='occam2d', error_floor=0.05)[source]#
Bases:
BaseAgentPrepare MT data files for 2-D / 3-D inversion codes.
Currently supported output formats#
"occam2d"— Occam2D DataFile format"modem"— ModEM3D data file (Phase 3)
Input keys#
sites/path: Sites or strcode: str —"occam2d"(default) or"modem"period_range: [T_min, T_max], optionalcomponent: str —"xy","yx", or"both"error_floor: float — minimum relative error floor (default 0.05)output_dir: strOutput data keys#
data_file_pathstr — path to the written data filen_periodsintn_stationsintcodestr- SYSTEM_PROMPT: str = 'You are an expert MT inversion specialist.\nGiven a dataset summary and chosen inversion code, recommend:\n1. Appropriate period band and error floor.\n2. Mesh geometry (cell sizes, padding, depth extent).\n3. Regularisation starting values.\n4. Any pre-processing steps still needed before inversion.\nReply in 4–5 sentences, 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: