# pesionzhao/seismic_avo_inversion architecture

> Architecture diagram of the GitHub repository pesionzhao/seismic_avo_inversion, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pesionzhao/seismic_avo_inversion
- Repository: https://github.com/pesionzhao/seismic_avo_inversion

## Overview

This repository is a teaching framework for three-parameter prestack seismic inversion. The documented workflow prepares elastic-property data and wavelet settings, predicts seismic observations with a selectable forward model, then iteratively estimates vp/vs/density using a solver and optional regularization. Builder.py is the workflow orchestrator; forward-model variants, optimization methods, Bayesian estimation, dataset preparation, and result plotting are distinct capabilities. Edges are limited to relationships visible in the excerpts, SOURCE INDEX references, or README; unsampled implementation details are not inferred.

Main entry points: [`demo.py`](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/demo.py) (Demo workflow), [`Builder.py`](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Builder.py) (Inversion workflow), [`Forward/BasicForward.py`](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Forward/BasicForward.py) (Forward interface), [`util/DataSet.py`](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/util/DataSet.py) (Dataset preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_config["Run configuration<br/>[prestack.yaml]"]
  node_marmousi["Marmousi input"]
  node_dataset["Dataset preparation<br/>[DataSet.py]"]
  node_settings["Wavelet settings<br/>[DataSet.py]"]
end

subgraph group_forward["Forward modeling"]
  node_forwardbase["Forward interface<br/>[BasicForward.py]"]
  node_aki["Aki-Richards<br/>[Aki_Richards.py]"]
  node_aki_simple["Linear Aki-Richards"]
  node_zoeppritz["Zoeppritz<br/>[Zoeppritz.py]"]
  node_zoeppritz_complex["Complex Zoeppritz"]
end

subgraph group_inverse["Inversion methods"]
  node_builder["Inversion workflow<br/>[Builder.py]"]
  node_regularization["Regularization<br/>[Regularization.py]"]
  node_solver["Optimization solvers<br/>[Solver.py]"]
  node_bayesian["Bayesian solver<br/>[Bayesian.py]"]
  node_bayes_builder["Bayesian builder<br/>[Builder.py]"]
end

subgraph group_presentation["Results"]
  node_utilities["Plot and helpers<br/>[utils.py]"]
end

node_user(("User"))
node_demo["Demo workflow<br/>[demo.py]"]

node_user -->|"runs"| node_demo
node_demo -->|"reads"| node_config
node_demo -->|"loads"| node_marmousi
node_demo -->|"prepares"| node_dataset
node_demo -->|"builds"| node_settings
node_demo -->|"constructs"| node_builder
node_dataset -->|"reads"| node_marmousi
node_builder -->|"calls model"| node_forwardbase
node_builder -->|"uses wavelet"| node_settings
node_builder -->|"uses properties"| node_dataset
node_builder -->|"updates penalty"| node_regularization
node_builder -->|"takes step"| node_solver
node_aki -->|"implements"| node_forwardbase
node_aki_simple -->|"implements"| node_forwardbase
node_zoeppritz -->|"implements"| node_forwardbase
node_zoeppritz_complex -->|"implements"| node_forwardbase
node_bayes_builder -->|"extends"| node_builder
node_bayes_builder -.->|"uses solver"| node_bayesian
node_demo -->|"imports"| node_bayesian
node_demo -->|"uses plots"| node_utilities

click node_demo "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/demo.py"
click node_config "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/config/prestack.yaml"
click node_marmousi "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/DataSet/Marmousi_dataset_dt%3D8ms.mat"
click node_dataset "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/util/DataSet.py"
click node_settings "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/util/DataSet.py"
click node_builder "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Builder.py"
click node_forwardbase "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Forward/BasicForward.py"
click node_aki "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Forward/Aki_Richards.py"
click node_aki_simple "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Forward/Simplify_Aki_Richards.py"
click node_zoeppritz "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Forward/Zoeppritz.py"
click node_zoeppritz_complex "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Forward/Zoeppritz_Complex.py"
click node_regularization "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Regularization/Regularization.py"
click node_solver "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Solver/Solver.py"
click node_bayesian "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Solver/Bayesian.py"
click node_bayes_builder "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Builder.py"
click node_utilities "https://github.com/pesionzhao/seismic_avo_inversion/blob/main/util/utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_config,node_marmousi,node_dataset,node_settings,node_user toneBlue
class node_forwardbase,node_aki,node_aki_simple,node_zoeppritz,node_zoeppritz_complex toneAmber
class node_builder,node_regularization,node_solver,node_bayesian,node_bayes_builder toneMint
class node_utilities toneRose
class node_demo toneTeal
```

## Components

### Data preparation

- [Run configuration](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/config/prestack.yaml): `config/prestack.yaml`
- [Marmousi input](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/DataSet/Marmousi_dataset_dt%3D8ms.mat): `DataSet/Marmousi_dataset_dt=8ms.mat`
- [Dataset preparation](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/util/DataSet.py): `util/DataSet.py`
- [Wavelet settings](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/util/DataSet.py): `util/DataSet.py`

### Forward modeling

- [Forward interface](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Forward/BasicForward.py): `Forward/BasicForward.py`
- [Aki-Richards](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Forward/Aki_Richards.py): `Forward/Aki_Richards.py`
- [Linear Aki-Richards](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Forward/Simplify_Aki_Richards.py): `Forward/Simplify_Aki_Richards.py`
- [Zoeppritz](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Forward/Zoeppritz.py): `Forward/Zoeppritz.py`
- [Complex Zoeppritz](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Forward/Zoeppritz_Complex.py): `Forward/Zoeppritz_Complex.py`

### Inversion methods

- [Inversion workflow](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Builder.py): `Builder.py`
- [Regularization](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Regularization/Regularization.py): `Regularization/Regularization.py`
- [Optimization solvers](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Solver/Solver.py): `Solver/Solver.py`
- [Bayesian solver](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Solver/Bayesian.py): `Solver/Bayesian.py`
- [Bayesian builder](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/Builder.py): `Builder.py`

### Results

- [Plot and helpers](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/util/utils.py): `util/utils.py`

### Other components

- **User**
- [Demo workflow](https://github.com/pesionzhao/seismic_avo_inversion/blob/main/demo.py): `demo.py`

## Connections

- User → Demo workflow: runs (evidence: `README.md`)
- Demo workflow → Run configuration: reads (evidence: `demo.py`)
- Demo workflow → Marmousi input: loads (evidence: `README.md`)
- Demo workflow → Dataset preparation: prepares (evidence: `demo.py`)
- Demo workflow → Wavelet settings: builds (evidence: `demo.py`)
- Demo workflow → Inversion workflow: constructs (evidence: `demo.py`)
- Dataset preparation → Marmousi input: reads (evidence: `util/DataSet.py`)
- Inversion workflow → Forward interface: calls model (evidence: `Builder.py`)
- Inversion workflow → Wavelet settings: uses wavelet (evidence: `Builder.py`)
- Inversion workflow → Dataset preparation: uses properties (evidence: `Builder.py`)
- Inversion workflow → Regularization: updates penalty (evidence: `Builder.py`)
- Inversion workflow → Optimization solvers: takes step (evidence: `Builder.py`)
- Aki-Richards → Forward interface: implements (evidence: `Forward/Aki_Richards.py`)
- Linear Aki-Richards → Forward interface: implements (evidence: `Forward/Simplify_Aki_Richards.py`)
- Zoeppritz → Forward interface: implements (evidence: `Forward/Zoeppritz.py`)
- Complex Zoeppritz → Forward interface: implements (evidence: `Forward/Zoeppritz_Complex.py`)
- Bayesian builder → Inversion workflow: extends (evidence: `Builder.py`)
- Bayesian builder → Bayesian solver: uses solver
- Demo workflow → Bayesian solver: imports (evidence: `demo.py`)
- Demo workflow → Plot and helpers: uses plots (evidence: `demo.py`)
