Geomechanics module
Geophysics module
- quick_pp.rock_physics.geophysics.calculate_acoustic_impedance(rhob, dtc)[source]
Calculate acoustic impedance from density and sonic logs.
Acoustic impedance is the product of density and velocity: AI = rho * Vp where rho is density in g/cm³ and Vp is P-wave velocity in m/s.
- Parameters:
rhob (np.ndarray) – Bulk density log [g/cm³].
dtc (np.ndarray) – Compressional slowness log [us/ft].
- Returns:
Acoustic impedance [(g/cm³)*(m/s)].
- Return type:
np.ndarray
- quick_pp.rock_physics.geophysics.auto_identify_layers_from_seismic_trace(df, method='peaks_troughs', min_distance=30)[source]
Auto-identify layers from seismic trace using peaks/troughs or zero crossings.
- Parameters:
- Returns:
The input DataFrame with an added ‘LAYERS’ column.
- Return type:
pd.DataFrame
- quick_pp.rock_physics.geophysics.calculate_reflectivity_from_layers(df)[source]
Calculate reflection coefficients from acoustic impedance log.
The reflection coefficient at an interface is calculated as: R = (Z2 - Z1)/(Z2 + Z1) where Z2 and Z1 are the acoustic impedances of the layers above and below the interface.
- Parameters:
df (pd.DataFrame) – Input DataFrame with ‘RHOB’, ‘DT’, and ‘LAYERS’ columns.
- Returns:
The input DataFrame with an added ‘REFLECTIVITY’ column.
- Return type:
pd.DataFrame
- quick_pp.rock_physics.geophysics.calculate_reflectivity_each_step(df)[source]
Calculate reflection coefficients for each step in the well log.
- Parameters:
df (pd.DataFrame) – Input DataFrame with ‘RHOB’ and ‘DT’ columns.
- Returns:
The input DataFrame with a ‘REFLECTIVITY’ column.
- Return type:
pd.DataFrame
- quick_pp.rock_physics.geophysics.convert_depth_to_time(depth, velocity)[source]
Convert depth domain to time domain using velocity information.
The two-way-time (TWT) is calculated by integrating interval times over depth: 1. Calculate interval time: dt = 2/velocity (s/m) 2. Multiply by depth gradient: dt * gradient(depth) 3. Cumulative sum to get total TWT: cumsum(dt * gradient(depth))
- Parameters:
depth (np.ndarray) – Depth values [m].
velocity (np.ndarray) – P-wave velocity [m/s]. Must be the same length as depth.
- Returns:
Two-way-time (TWT) values [s].
- Return type:
np.ndarray
Note
This uses integration rather than simple division to account for varying velocities at different depths. The gradient and cumsum ensure proper accumulation of travel times through each depth interval.
- quick_pp.rock_physics.geophysics.convert_md_to_tvd(df, well_coords)[source]
Convert MD to TVD using well coordinates and resample to 0.5m interval. :param df: Input DataFrame with ‘DEPTH’ (as MD) and other log columns. :type df: pd.DataFrame :param well_coords: DataFrame with well deviation survey data, including
‘md’, ‘incl’, and ‘azim’ columns.
- Returns:
A new DataFrame resampled by TVD with a 0.5m interval.
- Return type:
pd.DataFrame
- quick_pp.rock_physics.geophysics.extract_seismic_along_well(seismic_cube, well_trajectory)[source]
Extract seismic data along a well trajectory from a 3D seismic cube.
- Parameters:
seismic_cube (xarray.Dataset) – A 3D seismic cube with coordinates (inline, xline, twt/depth).
well_trajectory (pd.DataFrame) – A DataFrame defining the well path with ‘x’, ‘y’, and ‘z’ (depth/time) coordinates.
- Returns:
An array of seismic trace values extracted along the well path.
- Return type:
np.ndarray
Notes
The seismic cube and well trajectory must be in the same coordinate reference system
For time domain seismic, the well trajectory depth must be converted to time first
Uses xarray’s interp() method for extraction
Handles both inline/xline and CDP coordinate systems
- quick_pp.rock_physics.geophysics.convert_well_trajectory_to_ilxl(seismic_cube, well_trajectory)[source]
Convert well trajectory to inline/crossline coordinates.
- Parameters:
seismic_cube (xarray.Dataset) – A 3D seismic cube.
well_trajectory (pd.DataFrame) – A DataFrame with well deviation survey data, including ‘md’, ‘incl’, ‘azim’, ‘x’, ‘y’, and ‘z’ columns.
- quick_pp.rock_physics.geophysics.plot_well_trajectory(seismic_cube, well_coords)[source]
Plot well trajectory in map view and cross sections.
- Parameters:
seismic_cube (xarray.Dataset) – The 3D seismic cube for context.
well_coords (pd.DataFrame) – A DataFrame with ‘x’, ‘y’, and ‘z’ coordinates of the well path.
- Returns:
The generated figure object.
- Return type:
matplotlib.figure.Figure
- quick_pp.rock_physics.geophysics.plot_seismic_along_well(seismic_cube, well_trajectory)[source]
Plot seismic trace along well trajectory.
- Parameters:
seismic_cube (xarray.Dataset) – A 3D seismic cube.
well_trajectory (pd.DataFrame) – A DataFrame defining the well path with ‘x’, ‘y’, and ‘z’ coordinates.
- quick_pp.rock_physics.geophysics.optimize_wavelet(seismic_trace, reflectivity)[source]
Estimate the seismic wavelet by matching synthetic to actual seismic trace.
This implementation uses a combination of frequency-domain and time-domain methods based on the approaches described in: - White (1980) “Inverse Problems in Reflection Seismology” - Edgar & van der Baan (2011) “How reliable is statistical wavelet estimation?” - Rosa (2018) “Seismic Inversion Methods”
- Parameters:
seismic_trace (np.ndarray) – The observed seismic trace.
reflectivity (np.ndarray) – The calculated reflectivity series.
- Returns:
- A tuple containing:
The estimated wavelet.
The final root mean square error (RMSE).
The synthetic seismic trace generated with the estimated wavelet.
- Return type:
- quick_pp.rock_physics.geophysics.create_synthetic_seismogram(wavelet, reflectivity)[source]
Create synthetic seismogram by convolving wavelet with reflectivity series.
- Parameters:
wavelet (np.ndarray) – The seismic wavelet.
reflectivity (np.ndarray) – The reflectivity coefficient series.
- Returns:
The resulting synthetic seismogram trace.
- Return type:
np.ndarray
- quick_pp.rock_physics.geophysics.qc_synthetic_seismogram(synthetic, seismic, title='Synthetic vs Seismic')[source]
Quality control plot comparing synthetic seismogram to actual seismic trace.
- Parameters:
synthetic (np.ndarray) – The synthetic seismogram trace.
seismic (np.ndarray) – The actual seismic trace.
title (str, optional) – Plot title. Defaults to “Synthetic vs Seismic”.
- Returns:
The generated QC figure.
- Return type:
matplotlib.figure.Figure