18. 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. If you are new to pyCSAMT v2, read the tutorials in order below; the first two pages teach the basic survey object and QC workflow, and the later pages build on that foundation.
- 18.1. Overview
- 18.2. Read an EDI Survey
- 18.2.1. What You Will Learn
- 18.2.2. Input Layouts
- 18.2.3. Read a Survey Directory
- 18.2.4. Read One EDI File
- 18.2.5. Build a Station Inventory
- 18.2.6. Inspect Stations Programmatically
- 18.2.7. Handle Parser Errors
- 18.2.8. Choose a Duplicate Policy
- 18.2.9. Control Progress Output
- 18.2.10. Read Several Sources
- 18.2.11. Use the CLI for Quick Checks
- 18.2.12. Move to QC
- 18.2.13. Troubleshooting
- 18.2.14. Next Steps
- 18.2.15. See Also
- 18.3. Inspect and QC a Survey
- 18.3.1. What You Will Learn
- 18.3.2. Input Assumptions
- 18.3.3. Load the Survey
- 18.3.4. Create an Output Folder
- 18.3.5. Build the Station QC Table
- 18.3.6. Sort Stations by Review Priority
- 18.3.7. Create Simple QC Flags
- 18.3.8. Compute Station Confidence
- 18.3.9. Review Low-Confidence Stations
- 18.3.10. Inspect Frequency-Level Confidence
- 18.3.11. Create a Confidence Profile Plot
- 18.3.12. Select Stations for the Next Step
- 18.3.13. CLI Quick Checks
- 18.3.14. What to Do With Poor Stations
- 18.3.15. Troubleshooting
- 18.3.16. See Also
- 18.4. Compare Survey Lines for QC
- 18.4.1. What You Will Learn
- 18.4.2. Input Assumptions
- 18.4.3. Load Both Lines
- 18.4.4. Build Comparable Inventory Tables
- 18.4.5. Compare Frequency Coverage
- 18.4.6. Compare QC and Confidence Metrics
- 18.4.7. Make the Processing Decision
- 18.4.8. Recommended Next Step
- 18.4.9. Adapting This Tutorial
- 18.4.10. See Also
- 18.5. Correct Static Shift
- 18.5.1. What You Will Learn
- 18.5.2. Prerequisites
- 18.5.3. When Static Shift Is a Good Candidate
- 18.5.4. Three Real Surveys, Three Different Pictures
- 18.5.5. Create a Review Folder
- 18.5.6. Estimate AMA Correction Factors
- 18.5.7. Choose the Spatial Order
- 18.5.8. Use a Period Band
- 18.5.9. Inspect Large Corrections
- 18.5.10. Apply Factors Manually
- 18.5.11. Apply AMA in One Step
- 18.5.12. Compare Before and After
- 18.5.13. Read the Static-Shift Radar
- 18.5.14. Use One-Call QC Wrappers
- 18.5.15. Try Alternative Estimators
- 18.5.16. A Long-Period MT Line Where Large Factors Are Not Enough (KAP03)
- 18.5.17. A CSAMT Line Where Factors And Classification Disagree (Tongkeng)
- 18.5.18. Export Corrected EDI Files
- 18.5.19. Run Through a Pipeline
- 18.5.20. Checklist Before Inversion
- 18.5.21. Troubleshooting
- 18.5.22. See Also
- 18.6. Condition an MT Line With Tipper and Rotation
- 18.6.1. Recommended Order
- 18.6.2. Load the KP Line
- 18.6.3. Recover Coordinates and Add Sourced Topography
- 18.6.4. Plot Raw Tensor Curves
- 18.6.5. Plot Tipper Components
- 18.6.6. Build QC Tables
- 18.6.7. Drop Weak Rows and Filter Conservatively
- 18.6.8. Check Dimensionality and Induction Vectors
- 18.6.9. Test, Then Reject, Automatic Static Shift
- 18.6.10. Estimate Strike and Plot Phase Tensors
- 18.6.11. Rotate Impedance and Tipper
- 18.6.12. Export and Prove the EDI Round Trip
- 18.6.13. Prepare the Classical 3-D ModEM Inversion
- 18.6.14. Compile and Run ModEM
- 18.6.15. Build an Optional Triangular Profile Mesh
- 18.6.16. Configure the MT3D AI Inversion
- 18.6.17. Processing Decision Table
- 18.6.18. Adapting This Tutorial
- 18.6.19. See Also
- 18.7. Process Zonge AVG Lines K1 and K2
- 18.7.1. Read the field files before converting them
- 18.7.2. Attach and reconcile station geometry
- 18.7.3. Preview coordinate-bearing EDI serialization
- 18.7.4. Choose processing from evidence
- 18.7.4.1. Run and inspect a static-shift trial
- 18.7.4.2. Screen controlled-source effects without inventing geometry
- 18.7.4.3. Process the converted EDIs and export the inversion input
- 18.7.4.4. Compare station responses before tensor diagnostics
- 18.7.4.5. Decide whether phase-tensor rotation is supported
- 18.7.5. Prepare the classical Occam2D baseline
- 18.7.6. Compile and run on the user’s machine
- 18.7.7. Train an AI counterpart, not a replacement baseline
- 18.8. Process A TEMAVG Survey: TEM To Corrected EDI
- 18.8.1. Read the survey folder
- 18.8.2. Pick one profile and inspect its geometry
- 18.8.3. Quality-control the raw time-domain decay before transforming
- 18.8.4. Determine a geographic anchor for the local site grid
- 18.8.5. Transform to frequency domain and write EDI
- 18.8.6. Correct the EDI collection
- 18.8.7. Compare raw and corrected responses at three stations
- 18.8.8. What this profile cannot support
- 18.8.9. Write the corrected collection and a coordinate manifest
- 18.8.10. Build and view the 2-D triangular mesh
- 18.8.11. Train And Gate A Maxwell AI Inversion
- 18.8.12. Gate The Result Before Interpretation
- 18.8.13. A Real Station-Label Bug, Found By Running This At 51 Stations
- 18.9. Stratagem Field Data To Occam2D Inversion
- 18.9.1. What You Will Learn
- 18.9.2. Starting Point
- 18.9.3. Loading Raw Stratagem Data
- 18.9.4. Injecting Real Coordinates
- 18.9.5. Cross-Validating Against An Independent Tool
- 18.9.6. Static Shift, Frequency Filtering, And Noise Removal
- 18.9.7. Station Map And Pseudosections
- 18.9.8. Quality Control And Export
- 18.9.9. Preparing And Running An Occam2D Inversion
- 18.9.10. Interpreting The Inversion
- 18.9.11. Reusing This With Your Own Data
- 18.9.12. See Also
- 18.10. Prepare an Occam2D Inversion
- 18.10.1. What You Will Learn
- 18.10.2. When To Use Occam2D
- 18.10.3. Prepare the Survey
- 18.10.4. Apply Optional Static-Shift Correction
- 18.10.5. Choose an Occam Configuration
- 18.10.6. Build Native Occam2D Files
- 18.10.7. Inspect the Built Objects
- 18.10.8. Validate File Types
- 18.10.9. Build a TM-Only First Trial
- 18.10.10. Run Occam2D
- 18.10.11. Load Finished Results
- 18.10.12. Plot Model and Misfit
- 18.10.13. Backend-Neutral Preparation
- 18.10.14. CLI Equivalent
- 18.10.15. Preparation Checklist
- 18.10.16. Troubleshooting
- 18.10.17. See Also
- 18.11. Prepare A ModEM Inversion
- 18.11.1. What You Will Learn
- 18.11.2. When A 3-D ModEM Run Is The Right Preparation
- 18.11.3. Load The Area Survey
- 18.11.4. Choose A ModEM 3-D Configuration
- 18.11.5. Build The Native Input Set
- 18.11.6. Inspect The Horizontal Grid
- 18.11.7. Inspect The Vertical Grid And Skin Depth
- 18.11.8. Covariance And Control
- 18.11.9. Validate The Native Files
- 18.11.10. Hand Off To ModEM
- 18.11.11. CLI Equivalent
- 18.11.12. Preparation Checklist
- 18.11.13. Troubleshooting
- 18.11.14. See Also
- 18.12. Prepare A MARE2DEM Inversion
- 18.12.1. What You Will Learn
- 18.12.2. When To Prepare A MARE2DEM Run
- 18.12.3. Load And QC The Profile
- 18.12.4. Convert To Native MARE2DEM Data
- 18.12.5. Reason About The Starting Grid
- 18.12.6. Build The Mesh And Starting Model
- 18.12.7. Inspect The Triangulation Boundary
- 18.12.8. Validate The Native Files
- 18.12.9. Hand Off To MARE2DEM
- 18.12.10. No CLI Support Yet
- 18.12.11. Preparation Checklist
- 18.12.12. Troubleshooting
- 18.12.13. See Also
- 18.13. Run Classical Inversions: Occam2D, ModEM, and MARE2DEM
- 18.13.1. What You Will Learn
- 18.13.2. Where Each Backend Stands
- 18.13.3. Recap: Prepared Native Inputs
- 18.13.4. Locate Or Build The Binary
- 18.13.5. Build The Command, Then Run
- 18.13.6. Running Externally Or On A Cluster
- 18.13.7. CLI Equivalent
- 18.13.8. Load And Compare Finished Runs
- 18.13.9. Pre-Run Checklist
- 18.13.10. Common Mistakes
- 18.13.11. See Also
- 18.14. AI Inversion From Corrected EDIs
- 18.14.1. What You Will Learn
- 18.14.2. Reproducibility before the private case study
- 18.14.3. Load and Audit the Survey
- 18.14.4. Ground a Geological Prior in the Survey
- 18.14.5. Build the Training Mesh and 2-D Maxwell Dataset
- 18.14.6. Run 2-D AI Inversion
- 18.14.7. Run 3-D AI Inversion
- 18.14.8. Run the Experimental Candidate Outside the Tutorial
- 18.14.9. Catch a Confidently Wrong Prediction
- 18.14.10. Recommended Decision
- 18.14.11. See Also
- 18.15. Building a Defensible 3-D AI Inversion Problem
- 18.16. Map Porphyry Mineralization From Noisy AMT
- 18.16.1. Starting From Non-EDI Data
- 18.16.2. What You Will Learn
- 18.16.3. Recommended Order
- 18.16.4. Load Both Lines
- 18.16.5. Baseline Quality Check
- 18.16.6. Remove Powerline Harmonics
- 18.16.7. Dimensionality Dictionary
- 18.16.8. Remove Galvanic Distortion
- 18.16.9. Correct Static Shift
- 18.16.10. EMAP Spatial Filter
- 18.16.11. Drop Weak Frequencies
- 18.16.12. Skew And Dimensionality
- 18.16.13. Estimate Strike
- 18.16.14. Rotate To Strike
- 18.16.15. Prepare Occam2D Inputs
- 18.16.16. Prepare ModEM 3-D Inputs
- 18.16.17. Maxwell-Trained 2-D AI Inversion of Both Lines
- 18.16.18. Maxwell-Trained 3-D AI Inversion of Both Lines
- 18.16.19. Correction Parameter Report
- 18.16.20. Adapting This Tutorial
- 18.16.21. See Also
- 18.17. Forward Model One Real Line In 1-D, 2-D, And 3-D
- 18.17.1. What You Will Learn
- 18.17.2. When To Do This
- 18.17.3. Load The Line And Establish A Trustworthy Band
- 18.17.4. A Real 1-D Sounding
- 18.17.5. Choose Frequencies The Triangular Solver Can Trust
- 18.17.6. A Real 2-D Triangular Mesh
- 18.17.7. A 3-D Volume Mesh, Real Profile Embedded
- 18.17.8. What Each Dimension Added
- 18.17.9. Troubleshooting
- 18.17.10. See Also
- 18.18. Map Groundwater Geology From CSAMT
- 18.18.1. What You Will Learn
- 18.18.2. Recommended Order
- 18.18.3. Load The Line
- 18.18.4. Baseline Quality Check
- 18.18.5. Classify Field Zones
- 18.18.6. Apply Near-Field Correction
- 18.18.7. Check Source Overprint
- 18.18.8. Rule Out Phase-Tensor And Distortion Diagnostics
- 18.18.9. Static Shift And Near-Surface Effects
- 18.18.10. EMAP Spatial Filter
- 18.18.11. Drop Weak Frequencies And Export Corrected EDIs
- 18.18.12. Select The Trustworthy Band For Training
- 18.18.13. Build The Geology Grid And Triangular Mesh
- 18.18.14. Maxwell-Trained Triangular AI Inversion
- 18.18.15. Gate The Result Before Interpretation
- 18.18.16. Adapting This Tutorial
- 18.18.17. See Also
- 18.19. Build A Two-Line Occam2D Survey For Interpretation
- 18.19.1. A true earth model, independent of the inversion mesh
- 18.19.2. Forward-model real physics
- 18.19.3. Package sites for Occam2D
- 18.19.4. Build native Occam2D input files
- 18.19.5. Run the real compiled solver
- 18.19.6. A real coordinate-alignment bug, found while bridging into interp
- 18.19.7. Drape synthetic topography for display
- 18.19.8. What carries forward to Part 2
- 18.20. Interpret A Two-Line Occam2D Survey With interp And geology
- 18.20.1. A project-specific rock table
- 18.20.2. Boreholes, sampled honestly from the true model
- 18.20.3. See every borehole at a glance
- 18.20.4. Calibrate against the two boreholes
- 18.20.5. See where calibration actually changed the model
- 18.20.6. Classify into lithology and draw the fence diagram
- 18.20.7. Record the fault as structural evidence
- 18.20.8. Validate against the held-out boreholes
- 18.20.9. What this adds up to
- 18.20.10. See Also
- 18.21. Run a Pipeline From Config
- 18.21.1. What You Will Learn
- 18.21.2. Why Use a Config File?
- 18.21.3. Input Assumptions
- 18.21.4. Create a Minimal YAML Config
- 18.21.5. Load and Inspect the Pipeline
- 18.21.6. Read the Survey
- 18.21.7. Run the Pipeline
- 18.21.8. Inspect the Result
- 18.21.9. Understand the Output Folder
- 18.21.10. Generate a Starter Config
- 18.21.11. Seed a Config From a Preset
- 18.21.12. Discover Steps and Presets
- 18.21.13. Run From the CLI
- 18.21.14. Debug Before Running
- 18.21.15. Error Policy
- 18.21.16. Choose a Method-Aware Preset
- 18.21.17. Beyond the Basics
- 18.21.18. Common Workflow Pattern
- 18.21.19. Troubleshooting
- 18.21.20. Next Steps
- 18.21.21. See Also