API Reference
Model Building
Model Building Module
This module provides tools and classes for building and setting up seismic velocity models. It focuses on model construction and parameterization, not forward modeling or inversion.
Key components: - Basic geometry elements (Point2d, ZNode2d) - Model cell definitions (TrapezoidCell2d) - Zelt format velocity model construction (ZeltVelocityModel2d) - Enhanced model building capabilities (EnhancedZeltModel)
- class pyAOBS.model_building.EnhancedZeltModel(base_model: ZeltVelocityModel2d)[source]
Bases:
ZeltVelocityModel2d增强型 Zelt 速度模型类,提供额外的处理功能。
- compare_with_base() dict[source]
比较当前模型与基础模型的差异。
- Returns:
- 包含比较结果的字典,包括:
’velocity_changes’: 每层速度变化的列表,每个元素是一个元组 ((base_top, base_bottom), (current_top, current_bottom))
’depth_changes’: 每层深度变化的列表,每个元素是一个元组 (base_depth, current_depth)
’boundary_changes’: 模型边界的变化 {‘xmin’: (base, current), ‘xmax’: (base, current),
’zmin’: (base, current), ‘zmax’: (base, current)}
- Return type:
dict
- class pyAOBS.model_building.Point2d(x: float, z: float)[source]
Bases:
objectA 2D point representation.
- x
X-coordinate
- Type:
float
- z
Z-coordinate (depth)
- Type:
float
- x: float
- z: float
- class pyAOBS.model_building.TrapezoidCell2d(x1: float, x2: float, z1: float, z2: float, z3: float, z4: float, v1: float, v2: float, v3: float, v4: float)[source]
Bases:
objectA trapezoid cell in the velocity model.
This class represents a trapezoid-shaped cell in the velocity model, defined by four corners with their respective velocities. The cell provides methods for point-in-cell testing and velocity interpolation.
- x1
Left x-coordinate
- Type:
float
- x2
Right x-coordinate
- Type:
float
- s1
Upper boundary slope
- Type:
float
- b1
Upper boundary intercept
- Type:
float
- s2
Lower boundary slope
- Type:
float
- b2
Lower boundary intercept
- Type:
float
- class pyAOBS.model_building.ZNode2d(x: ~typing.List[float] = <factory>, val: ~typing.List[float] = <factory>, flags: ~typing.List[int] = <factory>)[source]
Bases:
objectA velocity node in the ZELT model.
This class represents a node in the velocity model, containing x-coordinates, corresponding values (velocity or depth), and flags for inversion control.
- x
X-coordinates of the node points
- Type:
List[float]
- val
Values (velocity or depth) at each x-coordinate
- Type:
List[float]
- flags
Inversion flags for each point (0: fixed, 1: free)
- Type:
List[int]
- add_point(x: float, val: float, flag: int = 0) None[source]
Add a new point to the node.
- Parameters:
x (float) – X-coordinate
val (float) – Value at the point (velocity or depth)
flag (int, optional) – Inversion flag. Defaults to 0 (fixed).
- flags: List[int]
- get_value_at(x: float) float[source]
Get interpolated value at given x-coordinate.
- Parameters:
x (float) – X-coordinate to interpolate at
- Returns:
Interpolated value
- Return type:
float
- Raises:
ValueError – If x is outside the node’s range
- get_values() List[float][source]
Get list of values.
- Returns:
List of values (velocity or depth)
- Return type:
List[float]
- get_x_coords() List[float][source]
Get list of x-coordinates.
- Returns:
List of x-coordinates
- Return type:
List[float]
- val: List[float]
- x: List[float]
- class pyAOBS.model_building.ZeltVelocityModel2d(model_file: str | None = None)[source]
Bases:
objectBase class for 2D velocity models in Zelt format.
This class provides basic functionality for handling 2D velocity models in Zelt format, including velocity calculations and model manipulation.
- cells
Trapezoid cells for velocity interpolation
- Type:
List[TrapezoidCell2d]
- at(x: float, z: float) float[source]
获取指定位置的速度值。
- Parameters:
x (float) – x 坐标。
z (float) – z 坐标。
- Returns:
速度值。
- Return type:
float
- Raises:
ValueError – 如果点超出模型边界。
- get_layer_geometry(layer_idx: int) Tuple[List[float], List[float]][source]
Get the geometry of a layer.
- Parameters:
layer_idx (int) – Layer index
- Returns:
X-coordinates and depths of layer nodes
- Return type:
Tuple[List[float], List[float]]
Visualization
Visualization module for seismic processing.
This module provides visualization tools for seismic data and models. It includes: - ZeltModelVisualizer: For visualizing Zelt velocity models - GridModelVisualizer: For visualizing grid format velocity models - GridModelProcessor: For processing and converting grid format velocity models
Rock Classification
Utilities
Utility functions for the seismic_processing package.