Geophy_modular package

Submodules

Geophy_modular.ERT_to_WC module

Geophy_modular.seismic_processor module

Seismic data processing module for structure identification.

Geophy_modular.seismic_processor.extract_velocity_structure(mesh, velocity_data, threshold=1200, interval=4.0)[source]

Extract structure interface from velocity model at the specified threshold.

Parameters:
  • mesh – PyGIMLi mesh

  • velocity_data – Velocity values for each cell

  • threshold – Velocity threshold defining interface (default: 1200)

  • interval – Horizontal sampling interval (default: 4.0)

Returns:

Horizontal coordinates of interface points z_coords: Vertical coordinates of interface points interface_data: Dictionary with interface information

Return type:

x_coords

Geophy_modular.seismic_processor.process_seismic_tomography(ttData, mesh=None, **kwargs)[source]

Process seismic tomography data and perform inversion.

Parameters:
  • ttData – Travel time data container

  • mesh – Mesh for inversion (optional, created if None)

  • **kwargs – Additional parameters including: - lam: Regularization parameter (default: 50) - zWeight: Vertical regularization weight (default: 0.2) - vTop: Top velocity constraint (default: 500) - vBottom: Bottom velocity constraint (default: 5000) - quality: Mesh quality if creating new mesh (default: 31) - paraDepth: Maximum depth for parametric domain (default: 30) - verbose: Verbosity level (default: 1)

Returns:

TravelTimeManager object with inversion results

Geophy_modular.seismic_processor.save_velocity_structure(filename, x_coords, z_coords, interface_data=None)[source]

Save velocity structure data to file.

Parameters:
  • filename – Output filename

  • x_coords – X coordinates of interface

  • z_coords – Z coordinates of interface

  • interface_data – Additional data to save (optional)

Geophy_modular.seismic_processor.seismic_velocity_classifier(velocity_data, mesh, threshold=1200)[source]

Classify mesh cells based on velocity threshold.

Parameters:
  • velocity_data – Velocity values for each cell

  • mesh – PyGIMLi mesh

  • threshold – Velocity threshold for classification (default: 1200)

Returns:

below threshold, 2: above threshold)

Return type:

Array of cell markers (1

Geophy_modular.structure_integration module

Structure integration module for constrained geophysical inversion.

Geophy_modular.structure_integration.create_ert_mesh_with_structure(ertData, interface_data, **kwargs)[source]

Create ERT mesh with structure interface for constrained inversion.

Parameters:
  • ertData – PyGIMLi ERT data container

  • interface_data – Interface data (can be a tuple of (x, z) or a dictionary with smooth_x, smooth_z)

  • **kwargs – Additional parameters including: - paraBoundary: Extra boundary size (default: 2) - quality: Mesh quality parameter (default: 28) - paraMaxCellSize: Maximum cell size (default: 30) - paraDepth: Maximum depth (default: 30.0)

Returns:

Mesh with interface structure markers: Cell markers array regions: Dictionary with region definitions

Return type:

meshafter

Geophy_modular.structure_integration.create_joint_inversion_mesh(ertData, ttData, velocity_threshold=1200, **kwargs)[source]

Create a mesh for joint ERT-seismic inversion by first inverting seismic data, extracting the velocity interface, and then creating a constrained ERT mesh.

Parameters:
  • ertData – PyGIMLi ERT data container

  • ttData – PyGIMLi seismic travel time data container

  • velocity_threshold – Threshold for velocity interface (default: 1200)

  • **kwargs – Additional parameters including: - seismic_params: Dictionary of seismic inversion parameters - mesh_params: Dictionary of mesh generation parameters

Returns:

Mesh suitable for constrained joint inversion seismic_manager: TravelTimeManager with seismic inversion results structure_data: Structure interface data

Return type:

joint_mesh

Geophy_modular.structure_integration.integrate_velocity_interface(ertData, smooth_x, smooth_z, paraBoundary=2, quality=28, paraMaxCellSize=30, paraDepth=30.0)[source]

Integrate velocity interface into mesh for constrained ERT inversion.

Parameters:
  • ertData – PyGIMLi ERT data container

  • smooth_x – X coordinates of velocity interface

  • smooth_z – Z coordinates of velocity interface

  • paraBoundary – Extra boundary size (default: 2)

  • quality – Mesh quality parameter (default: 28)

  • paraMaxCellSize – Maximum cell size (default: 30)

  • paraDepth – Maximum depth of the model (default: 30.0)

Returns:

Cell markers array meshafter: Mesh with interface structure

Return type:

markers

Module contents

Geophysical data processing module for watershed monitoring.

class Geophy_modular.ERTtoWC(mesh: pygimli.Mesh, resistivity_values: ndarray, cell_markers: ndarray, coverage: ndarray | None = None)[source]

Bases: object

Class for converting ERT resistivity models to water content.

extract_time_series(positions: List[Tuple[float, float]]) Tuple[ndarray, List[int]][source]

Extract time series at specific positions.

get_statistics() Dict[str, ndarray][source]

Calculate statistics across Monte Carlo realizations.

plot_water_content(time_idx: int = 0, ax=None, cmap: str = 'jet', cmin: float = 0.0, cmax: float = 0.32, coverage_threshold: float | None = None)[source]

Plot water content for a specific time step.

run_monte_carlo(n_realizations: int = 100, progress_bar: bool = True) Tuple[source]

Run Monte Carlo simulation for uncertainty quantification.

Parameters:
  • n_realizations – Number of Monte Carlo realizations

  • progress_bar – Whether to show progress bar

Returns:

Tuple of (water_content_all, saturation_all, params_used)

save_results(output_dir: str, base_filename: str) None[source]

Save Monte Carlo results to files.

setup_layer_distributions(layer_distributions: Dict[int, Dict[str, Dict[str, float]]]) None[source]

Set up parameter distributions for different layers.

Parameters:

layer_distributions – Dictionary mapping layer markers to parameter distributions

Geophy_modular.create_ert_mesh_with_structure(ertData, interface_data, **kwargs)[source]

Create ERT mesh with structure interface for constrained inversion.

Parameters:
  • ertData – PyGIMLi ERT data container

  • interface_data – Interface data (can be a tuple of (x, z) or a dictionary with smooth_x, smooth_z)

  • **kwargs – Additional parameters including: - paraBoundary: Extra boundary size (default: 2) - quality: Mesh quality parameter (default: 28) - paraMaxCellSize: Maximum cell size (default: 30) - paraDepth: Maximum depth (default: 30.0)

Returns:

Mesh with interface structure markers: Cell markers array regions: Dictionary with region definitions

Return type:

meshafter

Geophy_modular.create_joint_inversion_mesh(ertData, ttData, velocity_threshold=1200, **kwargs)[source]

Create a mesh for joint ERT-seismic inversion by first inverting seismic data, extracting the velocity interface, and then creating a constrained ERT mesh.

Parameters:
  • ertData – PyGIMLi ERT data container

  • ttData – PyGIMLi seismic travel time data container

  • velocity_threshold – Threshold for velocity interface (default: 1200)

  • **kwargs – Additional parameters including: - seismic_params: Dictionary of seismic inversion parameters - mesh_params: Dictionary of mesh generation parameters

Returns:

Mesh suitable for constrained joint inversion seismic_manager: TravelTimeManager with seismic inversion results structure_data: Structure interface data

Return type:

joint_mesh

Geophy_modular.extract_velocity_structure(mesh, velocity_data, threshold=1200, interval=4.0)[source]

Extract structure interface from velocity model at the specified threshold.

Parameters:
  • mesh – PyGIMLi mesh

  • velocity_data – Velocity values for each cell

  • threshold – Velocity threshold defining interface (default: 1200)

  • interval – Horizontal sampling interval (default: 4.0)

Returns:

Horizontal coordinates of interface points z_coords: Vertical coordinates of interface points interface_data: Dictionary with interface information

Return type:

x_coords

Geophy_modular.integrate_velocity_interface(ertData, smooth_x, smooth_z, paraBoundary=2, quality=28, paraMaxCellSize=30, paraDepth=30.0)[source]

Integrate velocity interface into mesh for constrained ERT inversion.

Parameters:
  • ertData – PyGIMLi ERT data container

  • smooth_x – X coordinates of velocity interface

  • smooth_z – Z coordinates of velocity interface

  • paraBoundary – Extra boundary size (default: 2)

  • quality – Mesh quality parameter (default: 28)

  • paraMaxCellSize – Maximum cell size (default: 30)

  • paraDepth – Maximum depth of the model (default: 30.0)

Returns:

Cell markers array meshafter: Mesh with interface structure

Return type:

markers

Geophy_modular.plot_time_series(time_steps: ndarray, time_series_data: ndarray, true_values: ndarray | None = None, labels: List[str] | None = None, colors: List[str] | None = None, output_file: str | None = None)[source]

Plot time series with uncertainty bands.

Geophy_modular.process_seismic_tomography(ttData, mesh=None, **kwargs)[source]

Process seismic tomography data and perform inversion.

Parameters:
  • ttData – Travel time data container

  • mesh – Mesh for inversion (optional, created if None)

  • **kwargs – Additional parameters including: - lam: Regularization parameter (default: 50) - zWeight: Vertical regularization weight (default: 0.2) - vTop: Top velocity constraint (default: 500) - vBottom: Bottom velocity constraint (default: 5000) - quality: Mesh quality if creating new mesh (default: 31) - paraDepth: Maximum depth for parametric domain (default: 30) - verbose: Verbosity level (default: 1)

Returns:

TravelTimeManager object with inversion results

Geophy_modular.seismic_velocity_classifier(velocity_data, mesh, threshold=1200)[source]

Classify mesh cells based on velocity threshold.

Parameters:
  • velocity_data – Velocity values for each cell

  • mesh – PyGIMLi mesh

  • threshold – Velocity threshold for classification (default: 1200)

Returns:

below threshold, 2: above threshold)

Return type:

Array of cell markers (1