Hydro_modular package#

Submodules#

Hydro_modular.hydro_to_ert module#

Module for converting hydrologic model output to ERT apparent resistivity.

Hydro_modular.hydro_to_ert.hydro_to_ert(water_content: ndarray, porosity: ndarray, mesh: pygimli.Mesh, profile_interpolator: ProfileInterpolator, layer_idx: int | List[int], structure: ndarray, marker_labels: List[int], rho_parameters: Dict[str, Any], electrode_spacing: float = 1.0, electrode_start: float = 0.0, num_electrodes: int = 72, scheme_name: str = 'wa', noise_level: float = 0.05, abs_error: float = 0.0, rel_error: float = 0.05, save_path: str | None = None, mesh_markers: ndarray | None = None, verbose: bool = False, seed: int | None = None) Tuple[pygimli.DataContainer, ndarray][source]#

Convert hydrologic model output to ERT apparent resistivity.

This function performs the complete workflow from water content to synthetic ERT data: 1. Interpolates water content to mesh 2. Calculates saturation 3. Converts saturation to resistivity using petrophysical models 4. Creates electrode array along surface profile 5. Performs forward modeling to generate synthetic ERT data

Parameters:
  • water_content – Water content array (nlay, ny, nx) or mesh values

  • porosity – Porosity array (nlay, ny, nx) or mesh values

  • mesh – PyGIMLI mesh

  • profile_interpolator – ProfileInterpolator for surface interpolation

  • marker_labels – Layer marker labels [top, middle, bottom]

  • rho_parameters

    Dictionary of resistivity parameters: {

    ’rho_sat’: [100, 500, 2400], # Saturated resistivity values ‘n’: [2.2, 1.8, 2.5], # Cementation exponents ‘sigma_s’: [1/500, 0, 0] # Surface conductivity values

    }

  • electrode_spacing – Spacing between electrodes

  • electrode_start – Starting position of electrode array

  • num_electrodes – Number of electrodes

  • scheme_name – ERT scheme name (‘wa’, ‘dd’, etc.)

  • noise_level – Relative noise level for synthetic data

  • abs_error – Absolute error for data estimation

  • rel_error – Relative error for data estimation

  • save_path – Path to save synthetic data (None = don’t save)

  • mesh_markers – Mesh cell markers (None = get from mesh)

  • verbose – Whether to display verbose information

  • seed – Random seed for noise generation

Returns:

Tuple of (synthetic ERT data container, resistivity model)

Hydro_modular.hydro_to_srt module#

Module for converting hydrologic model output to seismic travel times.

Hydro_modular.hydro_to_srt.hydro_to_srt(water_content: ndarray, porosity: ndarray, mesh: pygimli.Mesh, profile_interpolator: ProfileInterpolator, layer_idx: int | List[int], structure: ndarray, marker_labels: List[int], vel_parameters: Dict[str, Any], sensor_spacing: float = 1.0, sensor_start: float = 0.0, num_sensors: int = 72, shot_distance: float = 5, noise_level: float = 0.05, noise_abs: float = 1e-05, save_path: str | None = None, mesh_markers: ndarray | None = None, verbose: bool = False, seed: int | None = None) Tuple[pygimli.DataContainer, ndarray][source]#

Convert hydrologic model output to seismic travel times.

This function performs the complete workflow from water content to synthetic SRT data:

  1. Interpolates water content to mesh

  2. Calculates saturation

  3. Converts saturation to seismic velocities using petrophysical models

  4. Creates sensor array along surface profile

  5. Performs forward modeling to generate synthetic travel time data

Parameters:
  • water_content – Water content array (nlay, ny, nx) or mesh values

  • porosity – Porosity array (nlay, ny, nx) or mesh values

  • mesh – PyGIMLI mesh

  • profile_interpolator – ProfileInterpolator for surface interpolation

  • marker_labels – Layer marker labels [top, middle, bottom]

  • vel_parameters – Dictionary of velocity parameters containing ‘top’: {‘bulk_modulus’: 30.0, ‘shear_modulus’: 20.0, ‘mineral_density’: 2650, ‘depth’: 1.0}, ‘mid’: {‘bulk_modulus’: 50.0, ‘shear_modulus’: 35.0, ‘mineral_density’: 2670, ‘aspect_ratio’: 0.05}, ‘bot’: {‘bulk_modulus’: 55.0, ‘shear_modulus’: 50.0, ‘mineral_density’: 2680, ‘aspect_ratio’: 0.03}

  • sensor_spacing – Spacing between sensors

  • sensor_start – Starting position of sensor array

  • num_sensors – Number of sensors

  • shot_distance – Distance between shot points

  • noise_level – Relative noise level for synthetic data

  • noise_abs – Absolute noise level for synthetic data

  • save_path – Path to save synthetic data (None = don’t save)

  • mesh_markers – Mesh cell markers (None = get from mesh)

  • verbose – Whether to display verbose information

  • seed – Random seed for noise generation

Returns:

Tuple of (synthetic SRT data container, velocity model)

Module contents#

Hydro_modular package for hydrologic to geophysical conversion utilities.

Hydro_modular.hydro_to_fdem(water_content: ndarray, porosity: ndarray, layer_boundaries: ndarray, frequencies: ndarray | None = None, sigma_w: float = 0.05, m: float = 1.5, n: float = 2.0, sigma_s: float = 0.0, source_location: ndarray | None = None, receiver_location: ndarray | None = None, source_radius: float = 10.0, receiver_orientation: str = 'z', receiver_component: str = 'secondary', waveform_type: str = 'dipole', noise_level: float = 0.03, seed: int | None = None, min_thickness: float = 0.1, verbose: bool = False) Tuple[ndarray, ndarray, ndarray, ndarray][source]#

Simulate pseudo-2D FDEM response from one hydrologic profile.

A 1D FDEM sounding is simulated at each profile station and stacked into a response matrix.

Parameters:
  • water_content – Water content matrix, shape (n_layers, n_stations).

  • porosity – Porosity matrix, same shape as water_content.

  • layer_boundaries – Elevation matrix for layer interfaces, shape (n_layers + 1, n_stations), or 1D (n_layers + 1).

  • frequencies – FDEM frequencies.

  • sigma_w – Pore-water conductivity (S/m).

  • m – Cementation exponent.

  • n – Saturation exponent.

  • sigma_s – Surface conductivity (S/m).

  • source_location – Source location [x, y, z].

  • receiver_location – Receiver location [x, y, z].

  • source_radius – Source loop radius (m).

  • receiver_orientation – Receiver orientation.

  • receiver_component – ‘secondary’, ‘total’, or ‘both’.

  • waveform_type – ‘dipole’ or ‘loop’.

  • noise_level – Relative noise level.

  • seed – Random seed.

  • min_thickness – Lower bound for finite layer thicknesses (m).

  • verbose – Print progress.

Returns:

Shape (n_stations, n_frequencies), complex. clean_data: Shape (n_stations, n_frequencies), complex. uncertainty: Shape (n_stations, n_frequencies), float. conductivity: Shape (n_layers, n_stations), float.

Return type:

noisy_data

Hydro_modular.hydro_to_gravity(water_content: ndarray, porosity: ndarray, layer_boundaries: ndarray, station_positions: ndarray | None = None, rho_matrix: float = 2650.0, rho_water: float = 1000.0, rho_air: float = 1.225, sensor_height: float = 0.5, noise_level: float = 0.01, seed: int | None = None, mesh_nx: int = 80, mesh_nz: int = 60, model_width_y: float = 12.0, verbose: bool = False) Tuple[ndarray, ndarray, ndarray, ndarray][source]#

Simulate gravity response from a 2D hydrologic profile using SimPEG.

The 2D profile is interpolated to a thin 3D TensorMesh (single y strip), then Simulation3DIntegral is used to compute gz.

Parameters:
  • water_content – Water content matrix, shape (n_layers, n_stations).

  • porosity – Porosity matrix, same shape as water_content.

  • layer_boundaries – Elevation matrix for layer interfaces, shape (n_layers + 1, n_stations), or 1D (n_layers + 1).

  • station_positions – Profile x coordinates.

  • rho_matrix – Grain density (kg/m^3).

  • rho_water – Water density (kg/m^3).

  • rho_air – Air density (kg/m^3).

  • sensor_height – Sensor height above ground (m).

  • noise_level – Relative noise level.

  • seed – Random seed.

  • mesh_nx – Number of mesh cells in x.

  • mesh_nz – Number of mesh cells in z.

  • model_width_y – Width of the single y strip (m).

  • verbose – Print progress.

Returns:

Gravity anomaly with noise (mGal), shape (n_stations,). clean_data: Noise-free gravity anomaly (mGal), shape (n_stations,). uncertainty: Data uncertainty (mGal), shape (n_stations,). density_contrast: Profile density contrast model (kg/m^3),

shape (n_layers, n_stations).

Return type:

noisy_data

Hydro_modular.hydro_to_tdem(water_content: ndarray, porosity: ndarray, layer_boundaries: ndarray, times: ndarray | None = None, sigma_w: float = 0.05, m: float = 1.5, n: float = 2.0, sigma_s: float = 0.0, source_radius: float = 10.0, noise_level: float = 0.03, seed: int | None = None, min_thickness: float = 0.1, verbose: bool = False) Tuple[ndarray, ndarray, ndarray, ndarray][source]#

Simulate pseudo-2D TDEM response from one hydrologic profile.

The input is a 2D section (layers x profile stations). A 1D TDEM sounding is simulated at each profile station and stacked into a response matrix.

Parameters:
  • water_content – Water content matrix, shape (n_layers, n_stations).

  • porosity – Porosity matrix, same shape as water_content.

  • layer_boundaries – Elevation matrix for layer interfaces, shape (n_layers + 1, n_stations), or 1D (n_layers + 1).

  • times – TDEM time channels.

  • sigma_w – Pore-water conductivity (S/m).

  • m – Cementation exponent.

  • n – Saturation exponent.

  • sigma_s – Surface conductivity (S/m).

  • source_radius – Source loop radius (m).

  • noise_level – Relative noise level.

  • seed – Random seed.

  • min_thickness – Lower bound for finite layer thicknesses (m).

  • verbose – Print progress.

Returns:

Shape (n_stations, n_times). clean_data: Shape (n_stations, n_times). uncertainty: Shape (n_stations, n_times). conductivity: Shape (n_layers, n_stations).

Return type:

noisy_data