API configuration#
pycsamt.api is the front door of the package. It is a single import
point that gathers three things every workflow needs:
Readers that turn field data into survey objects —
read_edis(),read_edi(),read_sites().Views that present tabular results for interactive work — the opt-in
APIFrame/APIResultlayer behindapi=True.Configuration for every runtime behaviour of the package — output directories, plot styles, axis conventions, CLI defaults, agent budgets — through one consistent
configure_*/reset_*pattern.
Everything documented here is importable directly from pycsamt.api:
from pycsamt.api import (
read_edis, # data in
configure_api_view, # what api=True returns
configure_pipe, # where pipeline outputs go
use_style, # how figures look
)
configure_api_view(backend="pycsamt")
configure_pipe(output_root="results/run01", plot_dpi=200)
use_style("publication")
survey = read_edis("data/edi/", progress="auto")
print(survey.summary()) # APIFrame: compact, metadata-rich
One Pattern Everywhere#
Each behaviour family follows the same contract, so learning one family teaches you all of them:
Entry point |
Role |
|---|---|
|
Module-level singleton holding the current settings. Print it to see the active configuration. |
|
Update settings with dotted-path keywords, e.g.
|
|
Restore package defaults for the current session. |
|
Where presets exist (styles, interpretation), apply a named preset in
one call, e.g. |
Configuration Families#
Family |
Entry points |
Controls |
|---|---|---|
View layer |
|
What |
Pipeline |
|
Output roots, plot DPI/format, progress display, step-error policy. |
CLI |
|
Logging level, output format and directory, parallel build jobs. |
Plot styles |
|
MT component colours, multiline gradients, correction, rose, and
phase-tensor ellipse styles. Presets: |
Figure output |
|
Global figure saving defaults: DPI, formats, output directory. |
View controls |
|
Apparent-resistivity and phase axis behaviour, frequency-axis direction, phase wrapping. |
Sections |
|
Resistivity-section figure, axis, and colourbar styling. |
Station rendering |
|
Station map markers and axis styling. |
Interpretation |
|
Hydrogeological profile and section styles. |
Topography |
|
Topography handling and depth/frequency y-axis conventions. |
Agents |
|
LLM provider selection and spending budget for AI agents. |
Besides the families above, pycsamt.api also exposes shared axis-label
constants (STATION_LABEL, FREQUENCY_LABEL, PERIOD_LABEL, …) and
the base objects (PyCSAMTObject,
MetadataMixin) that carry metadata through workflows.
To build your own classes on these bases — and inherit the MT math and
EDI interop that come with them — see Extending pyCSAMT.
In This Section#
- API Views
The opt-in view layer:
api=True,APIFrame, multi-tableAPIResultcontainers, global backend policy, custom wrappers, and the public readers.- Configuration
The configuration system in depth: the dotted-path convention, worked examples for each family, recommended setups, environment variables, and how to reset everything.
See also
- Configuration
First-session setup: the settings most users touch on day one.
- pycsamt.api
Auto-generated reference for every
pycsamt.apifunction and class.