Tutorials#
Tutorials are practical, end-to-end recipes for common pyCSAMT survey tasks. They are written in a workflow style: each page states the input assumptions, shows runnable Python snippets, includes CLI equivalents where available, describes expected outputs, and points to the related API and user-guide sections.
The tutorial sequence follows the normal path from raw EDI files to reviewed, processed data that can be used for modelling or inversion.
How to Use These Tutorials#
If you are new to pyCSAMT v2, read the tutorials in order. The first two pages teach the basic survey object and QC workflow. The later pages build on that foundation.
If you already know the data-loading API, use the table below to jump to the task you need.
Tutorial |
Use It When |
Main Outputs |
|---|---|---|
You need to load one EDI file, a line directory, or a recursive survey tree and inspect what pyCSAMT found. |
|
|
You want to review station coverage, usable frequencies, skew proxies, signal quality, and stations that need manual attention. |
QC tables, confidence tables, review CSV files, diagnostic plots. |
|
You need to decide whether two line surveys can start from the same first-pass QC and processing configuration. |
Line-comparison tables, frequency overlap, confidence distributions, processing decision table. |
|
You have inspected the survey and want a conservative static-shift correction workflow before inversion preparation. |
Static-shift factors, corrected site collection, corrected EDIs. |
|
You have MT data with tipper and full impedance tensors and need a transparent conditioning workflow before inversion. |
Raw tensor/tipper plots, bad-frequency screen, filters, static shift, strike rose, phase tensor grid, rotated tensors. |
|
You have cleaned and reviewed a line survey and want to prepare a 2-D Occam2D inversion workspace. |
Occam2D data, model, startup, and run-directory files. |
|
You have corrected EDIs and want to use AI inversion instead of, or alongside, classical inversion. |
AI-mode decision table, training coverage check, 1-D/2-D/3-D code paths, prediction and validation figures. |
|
You want a focused L18PLT 3-D AI inversion workflow using real station geometry, real EDI topography, and agent-returned depth layers. |
L18 station-topography profile and embedded-topography 3-D AI inversion block. |
|
You want a repeatable processing workflow stored in YAML, JSON, or Python config files and runnable from Python or the CLI. |
Processed EDIs, plots, |
Recommended Learning Path#
Start with Read an EDI Survey.
This page introduces
pycsamt.api.read_edis(), theAPISurveyobject, station summaries, duplicate policies, parser errors, and the basic EDI CLI commands.Continue with Inspect and QC a Survey.
Use this after loading the survey. It helps you decide whether the data are ready for correction, whether some stations should be reviewed, and which frequency bands look reliable.
Use Compare Survey Lines for QC when a project has several lines.
This page helps you decide whether one first-pass config can be reused across related lines, or whether each line needs separate QC parameters.
Move to Correct Static Shift when the QC pass is understood.
Static-shift correction should not be the first operation applied blindly. The tutorial shows how to estimate, inspect, apply, and export correction factors conservatively.
Use Condition an MT Line With Tipper and Rotation for advanced MT data.
KP-style MT data with tipper need a fuller pre-inversion review: raw tensor curves, tipper response, weak-frequency handling, static-shift review, phase tensors, strike, and rotation.
Use Prepare an Occam2D Inversion for a cleaned profile.
This tutorial connects the processing workflow to inversion preparation. It focuses on the files and checks needed before handing data to Occam2D.
Use AI Inversion From Corrected EDIs when choosing AI inversion.
This page starts from corrected EDIs and explains when to use 1-D AI, when to bypass it for 2-D profile inversion, and when 3-D graph AI is justified.
Use Essential 3-D AI Inversion With Embedded Topography for a focused real-topography 3-D AI run.
This page treats L18PLT as corrected EDI, runs 3-D AI, and drapes the result on package-extracted station topography.
Use Run a Pipeline From Config when the workflow should be repeated.
Once the steps are stable, move them into a config file. This gives you a reproducible processing chain that can be reviewed, rerun, and archived with the results.
Before You Start#
The tutorials assume that pyCSAMT is installed and that you have a folder of EDI files. If you are still setting up the environment or learning the data formats, read these pages first:
Most examples use paths such as data/edis and results/first_qc. Replace
them with your local project paths.
Workflow Conventions#
The tutorial pages use the same conventions:
surveyPublic survey object returned by
pycsamt.api.read_edis().sitesLower-level site or EDI collection passed into QC, editing, pipeline, and export helpers. In many examples it is obtained from
survey.collection.resultReturned object from an operation, such as a pipeline run or inversion preparation step.
outdirRoot output directory for generated files.
strict=FalseUsed during first inspection so the reader can continue past recoverable EDI issues.
strict=Trueor--on-error raiseUsed for production validation when the workflow should fail immediately on malformed input or processing errors.
Choosing Python or the CLI#
Use Python when you need to keep objects in memory, combine tables, make custom plots, or integrate pyCSAMT with notebooks and analysis scripts.
Use the CLI when you need quick inspection, reproducible batch processing, or a shell-friendly workflow:
1pycsamt edi info data/edis
2pycsamt edi validate data/edis
3pycsamt pipe init --preset basic_qc --name first_qc
4pycsamt pipe run --config first_qc.yaml --survey data/edis --out results/first_qc
The tutorials usually show both forms when a CLI command exists.