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

Read an EDI Survey

You need to load one EDI file, a line directory, or a recursive survey tree and inspect what pyCSAMT found.

APISurvey, station inventory, parser diagnostics.

Inspect and QC a Survey

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.

Compare Survey Lines for QC

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.

Correct Static Shift

You have inspected the survey and want a conservative static-shift correction workflow before inversion preparation.

Static-shift factors, corrected site collection, corrected EDIs.

Condition an MT Line With Tipper and Rotation

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.

Prepare an Occam2D Inversion

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.

AI Inversion From Corrected EDIs

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.

Essential 3-D AI Inversion With Embedded Topography

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.

Run a Pipeline From Config

You want a repeatable processing workflow stored in YAML, JSON, or Python config files and runnable from Python or the CLI.

Processed EDIs, plots, pipeline.yaml, summary.txt, report.html.

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:

survey

Public survey object returned by pycsamt.api.read_edis().

sites

Lower-level site or EDI collection passed into QC, editing, pipeline, and export helpers. In many examples it is obtained from survey.collection.

result

Returned object from an operation, such as a pipeline run or inversion preparation step.

outdir

Root output directory for generated files.

strict=False

Used during first inspection so the reader can continue past recoverable EDI issues.

strict=True or --on-error raise

Used 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.

Tutorial Index#