pycsamt.agents.loader#
pycsamt.agents.loader#
MTLoaderAgent — Load MT/AMT/CSAMT data into a pycsamt
Sites object.
Accepts any input supported by ensure_sites():
A single EDI file path.
A directory of EDI / AVG / J files.
A list of file paths.
An existing
SitesorEDICollection.
After loading the agent runs a per-station quality scan and returns:
data["sites"]— theSitesobject.data["station_names"]— ordered list of station names.data["n_stations"]— total station count.data["quality_table"]—pandas.DataFramewith per-station scores.data["summary_stats"]— dict of survey-level statistics.
The quality table columns:
Column |
Meaning |
|---|---|
station |
Station name |
has_z |
Whether the Z impedance tensor is present |
has_tipper |
Whether the Tipper block is present |
has_coords |
Whether lat / lon coordinates are available |
n_freq |
Number of frequencies with finite Z |
t_min_s |
Shortest available period (s) |
t_max_s |
Longest available period (s) |
snr_proxy |
|
qc_score |
Integer 0–100 composite quality score |
Classes
|
Load MT data from any pycsamt-supported format and assess quality. |
- class pycsamt.agents.loader.MTLoaderAgent(*, api_key=None, model=None, llm_provider='claude', recursive=True, on_dup='replace')[source]#
Bases:
BaseAgentLoad MT data from any pycsamt-supported format and assess quality.
- Parameters:
Examples
>>> agent = MTLoaderAgent() >>> result = agent.execute({"path": "/data/AMT/WILLY_DATA/L22PLT"}) >>> result.status 'success' >>> result["n_stations"] 25 >>> result["quality_table"].head() station has_z ... qc_score 0 22-22BF True ... 88
- SYSTEM_PROMPT: str = 'You are an expert MT/AMT/CSAMT data quality analyst.\nGiven a per-station data quality summary, write 2–3 concise sentences that:\n1. State the overall data quality.\n2. Flag any stations or frequency ranges that need attention.\n3. Recommend the next processing step.\nReply in plain English — no bullet points, no markdown.\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: