### Install pyGeoPressure from GitHub (Unzipped Archive) Source: https://github.com/whimian/pygeopressure/blob/master/docs/install.md Install pyGeoPressure by downloading the repository as a zip archive, unzipping it, navigating to the directory, and then using pip to install. This method is an alternative if git is not available. ```bash pip install pyGeoPressure ``` -------------------------------- ### Install pyGeoPressure from PyPI Source: https://github.com/whimian/pygeopressure/blob/master/docs/install.md Install the pyGeoPressure package using pip from the Python Package Index. This is the standard method for installing released versions. ```bash pip install pygeopressure ``` -------------------------------- ### Install pyGeoPressure from GitHub (Develop Branch) Source: https://github.com/whimian/pygeopressure/blob/master/docs/install.md Install the latest development version of pyGeoPressure directly from its GitHub repository using pip. This requires git to be installed. ```bash pip install -e git://github.com/whimian/pyGeoPressure.git@develop ``` -------------------------------- ### Importing Libraries and Setting Up Path Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_seis.ipynb Imports necessary libraries and configures the system path for pygeopressure. This is a common setup for Python scripts interacting with the library. ```python import warnings warnings.filterwarnings(action='ignore') # for python 2 and 3 compatibility # from builtins import str # try: # from pathlib import Path # except: # from pathlib2 import Path #-------------------------------------------- import sys ppath = "../.." if ppath not in sys.path: sys.path.append(ppath) #-------------------------------------------- ``` -------------------------------- ### Minimal .well File Structure Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/new_well.md This is a minimal example of a .well file, containing essential information for defining a new well. Ensure all fields are correctly populated. ```default { "well_name": "CUG1", "loc": [ 707838, 3274780 ], "KB": 23, "WD": 85, "TD": 5000, "hdf_file": "well_data.h5" } ``` -------------------------------- ### Create Development Environment with Conda (Python 2.7) Source: https://github.com/whimian/pygeopressure/blob/master/docs/install.md Set up a development environment for pyGeoPressure using a conda environment file, specifically for Python 2.7. This ensures all necessary dependencies for testing are installed. ```bash conda env create --file test/test_env_2.yml ``` -------------------------------- ### Pore Pressure Prediction Example Source: https://github.com/whimian/pygeopressure/blob/master/README.md Demonstrates pore pressure prediction using well log data with pyGeoPressure. It includes optimizing parameters for Eaton's method and plotting the results against overburden pressure and horizons. ```python import pygeopressure as ppp survey = ppp.Survey("CUG") well = survey.wells['CUG1'] a, b = ppp.optimize_nct(well.get_log("Velocity"), well.params['horizon']["T16"], well.params['horizon']["T20"]) n = ppp.optimize_eaton(well, "Velocity", "Overburden_Pressure", a, b) pres_eaton_log = well.eaton(np.array(well.get_log("Velocity").data), n) fig, ax = plt.subplots() ax.invert_yaxis() pres_eaton_log.plot(ax, color='blue') well.get_log("Overburden_Pressure").plot(ax, 'g') ax.plot(well.hydrostatic, well.depth, 'g', linestyle='--') well.plot_horizons(ax) ``` -------------------------------- ### Create Development Environment with Conda (Python 3.6) Source: https://github.com/whimian/pygeopressure/blob/master/docs/install.md Set up a development environment for pyGeoPressure using a conda environment file, specifically for Python 3.6. This ensures all necessary dependencies for testing are installed. ```bash conda env create --file test/test_env_3.yml ``` -------------------------------- ### Extracting Log Data for Optimization Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/multivariate.ipynb Gets the Velocity, Porosity, Shale Volume, and Overburden Pressure logs for a specific well. These logs are required for multivariate model optimization. ```python vel_log = well_cug1.get_log("Velocity") por_log = well_cug1.get_log("Porosity") vsh_log = well_cug1.get_log("Shale_Volume") obp_log = well_cug1.get_log("Overburden_Pressure") ``` -------------------------------- ### Create Conda Environment with Python 2.7 Source: https://github.com/whimian/pygeopressure/blob/master/docs/install.md Use this command to create a new conda environment named 'ENV' with Python 2.7 and pip installed, if Python 2.7 is required. ```bash conda update conda conda create -n ENV python=2.7 pip ``` -------------------------------- ### Get velocity log data Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_well.ipynb Extracts the velocity log data for the selected well. This log is crucial for Bowers' method calculations. ```python vel_log = well_cug1.get_log("Velocity") ``` -------------------------------- ### Get LAS File Type Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/import_well_log_data.ipynb Determines the type of the loaded LAS file (e.g., 'las' or 'pseudo-las'). This can be useful for understanding how to process the data. ```python las_data.file_type ``` -------------------------------- ### Create Conda Environment with Python 3.6 Source: https://github.com/whimian/pygeopressure/blob/master/docs/install.md Use this command to create a new conda environment named 'ENV' with Python 3.6 and pip installed. This is recommended for isolating project dependencies. ```bash conda update conda conda create -n ENV python=3.6 pip ``` -------------------------------- ### Get Specific Well Object Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/import_well_log_data.ipynb Accesses a specific well object from the survey using its name. This object is then used for further data manipulation. ```python cug3 = survey.wells['CUG3'] ``` -------------------------------- ### Survey Geometry Definition Example Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/survey.md This JSON structure defines the geometry of a geophysical survey, including its name, coordinates of three reference points (A, B, C), and the extents and step for inline, crossline, and z-coordinates. ```json { "name": "CUG_depth", "point_A": [6400, 4100, 701319, 3274887], "point_B": [6400, 4180, 702185, 3274387], "point_C": [6440, 4180, 702685, 3275253], "inline_range": [6400, 7000, 20], "crline_range": [4100, 6020, 40], "z_range": [0, 5000, 4, "m"] } ``` -------------------------------- ### Import necessary libraries and configure warnings Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_seis.ipynb Imports warnings and configures them to be ignored. Includes compatibility for Python 2 and 3 path manipulation. ```python import warnings warnings.filterwarnings(action='ignore') # for python 2 and 3 compatibility # from builtins import str # try: # from pathlib import Path # except: # from pathlib2 import Path #-------------------------------------------- import sys ppath = "../.." if ppath not in sys.path: sys.path.append(ppath) #--------------------------------------------- ``` -------------------------------- ### Create Survey Directory Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/survey.md Use the `create_survey_directory` function to automatically build the necessary folder structure for a new survey. This includes sub-folders for Seismics, Surfaces, and Wellinfo, along with a base .survey file. ```python import pygeopressure as ppp ppp.create_survey_directory(ROOTDIR, SURVEY_NAME) ``` -------------------------------- ### Initialize a Survey Object Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/survey.md Initialize a Survey object by providing the path to the survey folder. This object will hold survey geometry and references to associated seismic and well data. ```python import pygeopressure as ppp survey = ppp.Survey('path/to/survey/folder') ``` -------------------------------- ### Visualizing Multivariate Model Optimization Results Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/multivariate.ipynb Plots the input logs (Velocity, Porosity, Shale Volume, Overburden Pressure) and the Velocity predicted by the optimized multivariate model. This helps in assessing the model's fit. ```python fig, axes = plt.subplots(ncols=4, nrows=1, sharey=True) axes[0].invert_yaxis() ppp.plot_multivariate( axes, well_cug1, vel_log, por_log, vsh_log, obp_log, 1500, 3500, a0, a1, a2, a3, well_cug1.params['bowers']['B']) ``` -------------------------------- ### Seismic Cube Configuration Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/new_seismic.md Configure a seismic cube by creating a .seis file in the 'Seismics' folder. This JSON defines the path to the SEGY file and the ranges for inline, z, and crossline data, along with depth information and property type. ```default { "path": "velocity.sgy", "inline_range": [200, 650, 2], "z_range": [400, 1100, 4], "crline_range": [700, 1200, 2], "inDepth": true, "Property_Type": "Velocity" } ``` -------------------------------- ### Initialize Survey Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/import_well_log_data.ipynb Initializes the survey object with the path to the survey folder. This is a prerequisite for accessing well data. ```python survey = ppp.Survey(Path(SURVEY_FOLDER)) ``` -------------------------------- ### Import plotting and pygeopressure libraries Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_seis.ipynb Imports plotting libraries like matplotlib and the pygeopressure library. Sets up plotting styles for better visualization. ```python from __future__ import print_function, division, unicode_literals %matplotlib inline import matplotlib.pyplot as plt plt.style.use(['seaborn-paper', 'seaborn-whitegrid']) plt.rcParams['font.sans-serif']=['SimHei'] plt.rcParams['axes.unicode_minus']=False import numpy as np import pygeopressure as ppp ``` -------------------------------- ### Optimizing Multivariate Model Coefficients Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/multivariate.ipynb Calculates the optimal coefficients (a0, a1, a2, a3) for the multivariate pressure model using provided well logs and parameters. The 'upper' and 'lower' bounds define the depth range for optimization. ```python a0, a1, a2, a3 = ppp.optimize_multivaraite( well=well_cug1, obp_log=obp_log, vel_log=vel_log, por_log=por_log, vsh_log=vsh_log, B=well_cug1.params['bowers']['B'], upper=1500, lower=3500) ``` -------------------------------- ### Load seismic survey data Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_seis.ipynb Initializes a Survey object using a specified survey folder. This step is required to access seismic data like velocity cubes. ```python # set to the directory on your computer SURVEY_FOLDER = "C:/Users/yuhao/Desktop/CUG_depth" survey = ppp.Survey(Path(SURVEY_FOLDER)) ``` -------------------------------- ### Load seismic data cubes Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_seis.ipynb Loads the 'velocity' and 'obp_new' seismic data cubes from the survey. ```python vel_cube = survey.seismics['velocity'] obp_cube = survey.seismics['obp_new'] ``` -------------------------------- ### Optimize Bowers loading equation coefficients Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_well.ipynb Calculates the 'A' and 'B' coefficients for Bowers' loading equation using the processed velocity log and overburden pressure log. This step requires specifying the well, logs, and relevant horizons. ```python a, b, err = ppp.optimize_bowers_virgin( well=well_cug1, vel_log=vel_log_filter_smooth, obp_log='Overburden_Pressure', upper='T12', lower='T20', pres_log='loading', mode='both') ``` -------------------------------- ### Pressure Prediction with Multivariate Model Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/multivariate.ipynb Generates a pressure log using the optimized multivariate model. This log represents the predicted pressure based on velocity, porosity, and shale volume. ```python pres_log = well_cug1.multivariate(vel_log, por_log, vsh_log) ``` -------------------------------- ### Clone pyGeoPressure GitHub Repository Source: https://github.com/whimian/pygeopressure/blob/master/docs/install.md Clone the pyGeoPressure GitHub repository to your local machine. This is the first step for developers who want to work with the source code. ```bash git clone https://github.com/whimian/pyGeoPressure.git ``` -------------------------------- ### Run Pytest with Code Coverage Source: https://github.com/whimian/pygeopressure/blob/master/docs/install.md Execute all tests for pyGeoPressure using pytest and generate a code coverage report. This command should be run from the project's root directory. ```bash pytest --cov ``` -------------------------------- ### Calculate Hydrostatic Pressure (Shortcut) Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_well.ipynb Provides a shortcut for calculating hydrostatic pressure using well parameters stored within the Well object. This function is commented out in the source. ```python # hydro_log = ppp.hydrostatic_well( # obp_log.depth, kb=well_cug1.kelly_bushing, wd=well_cug1.water_depth, ``` -------------------------------- ### Visualize predicted pressure against other logs Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_well.ipynb Plots the predicted pore pressure (Bowers model) alongside hydrostatic and lithostatic pressure logs, and well horizons. This visualization aids in assessing the prediction's plausibility. ```python fig_pres, ax_pres = plt.subplots() ax_pres.invert_yaxis() # plot hydrostatic well_cug1.hydro_log().plot(ax_pres, linestyle='--', color='green', label='Hydrostatic') # plot OBP well_cug1.get_log("Overburden_Pressure").plot(ax_pres, color='green', label='Lithostatic') # plot pressure pres_log.plot(ax_pres, label='Bowers', color='blue') # plot horizon well_cug1.plot_horizons(ax_pres) # set fig style ax_pres.set(ylim=(5000,0), aspect=(100/5000)*2) ax_pres.legend() fig_pres.set_figheight(8) ``` -------------------------------- ### Applying Bowers Method for Pressure Prediction Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_seis.ipynb Performs pore pressure prediction using the Bowers method with seismic velocity. The 'optimize' mode is used, and horizons T16 and T20 define the boundaries for the prediction. ```python bowers_cube = ppp.bowers_seis( "bowers_new", obp_cube, vel_cube, upper=survey.horizons['T16'], lower=survey.horizons['T20'], mode='optimize') ``` -------------------------------- ### Select Well and Load Density Log Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_well.ipynb Selects a specific well ('CUG1') from the survey and retrieves its density log data. ```python well_cug1 = survey.wells['CUG1'] den_log = well_cug1.get_log("Density") ``` -------------------------------- ### Extract Normal Compaction Trend parameters 'a' and 'b' Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_seis.ipynb Extracts the 'a' and 'b' parameters for the Normal Compaction Trend from the 'CUG1' well data. ```python a = well_cug1.params['nct']["a"] b = well_cug1.params['nct']["b"] ``` -------------------------------- ### Optimize Normal Compaction Trend Coefficients Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_well.ipynb Optimizes the coefficients 'a' and 'b' for the normal compaction trend (NCT) using velocity log data between specified horizon depths. ```python a, b = ppp.optimize_nct( vel_log=well_cug1.get_log("Velocity"), fit_start=well_cug1.params['horizon']["T16"], fit_stop=well_cug1.params['horizon']["T20"]) ``` -------------------------------- ### Adding Overburden Pressure Log Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_well.ipynb This snippet shows how to add a calculated Overburden Pressure log to the well data. It is commented out as the data may already be saved. ```python # well_cug1.add_log("Overbuden_Pressure") ``` -------------------------------- ### Optimize Eaton's Exponent 'n' Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_well.ipynb Optimizes Eaton's exponent 'n' using processed velocity, overburden pressure log, and NCT coefficients. This is a key step in Eaton's method for pore pressure prediction. ```python n = ppp.optimize_eaton( well=well_cug1, vel_log=vel_log_filter_smooth, obp_log="Overburden_Pressure", a=a, b=b) ``` -------------------------------- ### View density data section Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_seis.ipynb Displays a 2D section of the computed density cube. This visualization aids in verifying the density estimation results. ```python fig_den, ax_den = plt.subplots() im = den_cube.plot(ppp.InlineIndex(7400), ax_den, kind='img', cm='gist_earth') fig_den.colorbar(im) fig_den.set(figwidth=8) ``` -------------------------------- ### View Imported Logs Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/import_well_log_data.ipynb Lists the names of the well log curves that have been successfully imported into the Well object. This is useful for verification. ```python cug3.logs ``` -------------------------------- ### Load survey data Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_seis.ipynb Loads the seismic survey data from a specified directory. Ensure the SURVEY_FOLDER path is correctly set to your data location. ```python # set to the directory on your computer SURVEY_FOLDER = "M:/CUG_depth" survey = ppp.Survey(SURVEY_FOLDER) ``` -------------------------------- ### Process Density Log (Filter and Smooth) Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_well.ipynb Applies filtering and smoothing to the density log data to reduce noise and high-frequency variations. This prepares the log for extrapolation. ```python den_log_filter = ppp.upscale_log(den_log, freq=20) den_log_filter_smooth = ppp.smooth_log(den_log_filter, window=1501) ``` -------------------------------- ### Apply Eaton method for pressure prediction Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_seis.ipynb Applies the Eaton method using seismic data to predict pore pressure. This function optimizes 'a' and 'b' coefficients and requires seismic cubes and horizon data. ```python eaton_cube = ppp.eaton_seis( "eaton_new", obp_cube, vel_cube, n=3, upper=survey.horizons['T16'], lower=survey.horizons['T20']) ``` -------------------------------- ### Plotting Predicted Pressure Data Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_seis.ipynb Visualizes a slice of the predicted pore pressure cube generated by the Bowers method. Uses a custom seismic colormap for display. ```python from pygeopressure.basic.vawt import opendtect_seismic_colormap fig_pres, ax_pres = plt.subplots() im = bowers_cube.plot( ppp.InlineIndex(8000), ax_pres, kind='img', cm=opendtect_seismic_colormap()) fig_pres.colorbar(im) fig_pres.set(figwidth=8) ``` -------------------------------- ### Load Survey Data Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_well.ipynb Loads the survey data from a specified directory. This step is crucial for accessing well logs and other survey-specific information. ```python # set to the directory on your computer SURVEY_FOLDER = "C:/Users/yuhao/Desktop/CUG_depth" survey = ppp.Survey(SURVEY_FOLDER) ``` -------------------------------- ### Predict pore pressure using Bowers model Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_well.ipynb Applies the calculated Bowers coefficients (A, B, U) to predict pore pressure using the processed velocity log. The result is stored in a new log object. ```python pres_log = well_cug1.bowers( vel_log=vel_log_filter_smooth, a=a, b=b, u=u) ``` -------------------------------- ### Extract Normal Compaction Trend parameter 'n' Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_seis.ipynb Extracts the 'n' parameter for the Normal Compaction Trend from the 'CUG1' well data. ```python n = well_cug1.params['n'] ``` -------------------------------- ### Plot Velocity Log and Horizons Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_well.ipynb Visualizes the velocity log data along with the well's geological horizons. This helps in understanding the subsurface structure and identifying key intervals. ```python fig_vel, ax_vel = plt.subplots() ax_vel.invert_yaxis() vel_log.plot(ax_vel) well_cug1.plot_horizons(ax_vel) # set fig style ax_vel.set(ylim=(5000,0), aspect=(5000/4600)*2) ax_vel.set_aspect(2) fig_vel.set_figheight(8) ``` -------------------------------- ### Predict Pore Pressure using Eaton's Method Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_well.ipynb Calculates pore pressure using Eaton's method with the optimized exponent 'n', processed velocity log, normal velocity trend, hydrostatic pressure, and overburden pressure. ```python pres_eaton_log = well_cug1.eaton(vel_log_filter_smooth, n=n) ``` -------------------------------- ### Plotting Pressure Prediction Results Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/multivariate.ipynb Visualizes the predicted pressure log against hydrostatic and lithostatic pressure curves. Includes the original, upscaled, and smoothed predicted pressure logs for comparison. ```python fig_pres, ax_pres = plt.subplots() ax_pres.invert_yaxis() well_cug1.hydro_log().plot(ax_pres, color='green', linestyle='--', zorder=2, label='hydrostatic') well_cug1.get_log("Overburden_Pressure").plot(ax_pres, color='g', label='lithostatic') pres_log.plot(ax_pres, label='mutlivaraite', zorder=1) pres_log_filter_smooth.plot(ax_pres, label='smoothed', zorder=5, color='b') ax_pres.set(xlim=[0,100], ylim=[5000,0], aspect=(100/5000)*2) ax_pres.legend() fig_pres.set(figheight=8) fig_pres.show() ``` -------------------------------- ### Calculate Overburden Pressure Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_well.ipynb Calculates the Overburden Pressure (OBP) log using the extrapolated density log and well parameters like kelly bushing and water depth. ```python obp_log = ppp.obp_well(extra_log, kb=well_cug1.kelly_bushing, wd=well_cug1.water_depth, rho_w=1.01) ``` -------------------------------- ### Plot Density Log with Traugott Trend Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_well.ipynb Visualizes the original density log along with the fitted density trend line calculated using the optimized Traugott equation coefficients. ```python fig_den, ax_den = plt.subplots() ax_den.invert_yaxis() # draw density log den_log.plot(ax_den, label='Density') # draw fitted density trend line den_trend = ppp.traugott_trend( np.array(den_log.depth), a, b, kb=well_cug1.kelly_bushing, wd=well_cug1.water_depth) ax_den.plot(den_trend, den_log.depth, color='r', linestyle='--', zorder=2, label='Trend') # set style ax_den.set(ylim=(5000,0), aspect=(1.2/5000)*2) ax_den.legend() fig_den.set_figheight(8) fig_den.show() ``` -------------------------------- ### Manage Well Storage in HDF5 Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/import_well_log_data.ipynb Initializes a WellStorage object to manage well log data stored in an HDF5 file. This is used for persistent storage and retrieval. ```python storage = ppp.WellStorage(hdf5_file='C:/Users/yuhao/Desktop/CUG_depth/Wellinfo/well_data.h5') ``` -------------------------------- ### Optimize Traugott Equation Coefficients Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_well.ipynb Calculates the optimized coefficients (a, b) for the Traugott equation using density log data within a specified depth range. ```python a, b = ppp.optimize_traugott( den_log, 2000, 3000, kb=well_cug1.kelly_bushing, wd=well_cug1.water_depth) ``` -------------------------------- ### Plot Bowers loading and unloading curves Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_well.ipynb Draws both the virgin (loading) and unloading curves on the same plot using the optimized parameters. This provides a comprehensive view of the pressure model. ```python fig_bowers, ax_bowers = plt.subplots() # draw virgin(loading) curve ppp.plot_bowers_vrigin( ax=ax_bowers, well=well_cug1, a=a, b=b, vel_log=vel_log_filter_smooth, obp_log='Overburden_Pressure', upper='T12', lower='T20', pres_log='loading', mode='both') # draw unloading curve ppp.plot_bowers_unloading( ax=ax_bowers, a=a, b=b, vmax=4600, u=u, well=well_cug1, vel_log=vel_log_filter_smooth, obp_log='Overburden_Pressure', pres_log='unloading') ``` -------------------------------- ### Read LAS/Pseudo-LAS File Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/import_well_log_data.ipynb Reads well log data from a specified LAS or pseudo-LAS file using the LasData class. This is the first step in importing data from external files. ```python las_data = ppp.LasData(las_file="C:/Users/yuhao/Desktop/CUG_depth/log_curves.las") ``` -------------------------------- ### Calculate Overburden Pressure Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_seis.ipynb Calculates the overburden pressure (OBP) cube using the previously computed density cube. The 'obp_new' parameter likely specifies the calculation method or output name. ```python obp_cube = ppp.obp_seis("obp_new", den_cube) ``` -------------------------------- ### Retrieving Bowers Coefficients Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_seis.ipynb Extracts the Bowers method coefficients 'A' and 'B' from the well data. These coefficients are crucial for the pressure prediction calculation. ```python a = well_cug1.params['bowers']["A"] b = well_cug1.params['bowers']['B'] ``` -------------------------------- ### Plotting OBP Seismic Data Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_seis.ipynb Visualizes a slice of the OBP seismic data cube. This provides a visual reference for the overburden pressure data. ```python fig, ax = plt.subplots() im = obp_cube.plot(ppp.InlineIndex(7400), ax, kind='img') fig.colorbar(im) fig.set(figwidth=8) ``` -------------------------------- ### Plot calculated OBP section with custom colormap Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_seis.ipynb Visualizes a 2D section of the calculated overburden pressure cube. It utilizes a custom colormap defined in OpenDtect for display. ```python from pygeopressure.basic.vawt import opendtect_seismic_colormap fig_obp, ax_obp = plt.subplots() im = obp_cube.plot(ppp.InlineIndex(7400), ax_obp, kind='img', cm=opendtect_seismic_colormap()) fig_obp.colorbar(im) fig_obp.set(figwidth=8) ``` -------------------------------- ### BibTeX Citation for pyGeoPressure Source: https://github.com/whimian/pygeopressure/blob/master/README.md Provides the BibTeX entry for citing the pyGeoPressure package in academic work. ```bibtex @article{yu2018pygeopressure, title = {{PyGeoPressure}: {Geopressure} {Prediction} in {Python}}, author = {Yu, Hao}, journal = {Journal of Open Source Software}, volume = {3}, pages = {922} number = {30}, year = {2018}, doi = {10.21105/joss.00992}, } ``` -------------------------------- ### pygeopressure.basic.indexes.InlineIndex Source: https://github.com/whimian/pygeopressure/blob/master/docs/api/pygeopressure.basic.md Represents a survey index based on inline values. ```APIDOC ## class pygeopressure.basic.indexes.InlineIndex(value) Bases: [`SurveyIndex`](#pygeopressure.basic.indexes.SurveyIndex) ``` -------------------------------- ### pygeopressure.basic.indexes.SurveyIndex Source: https://github.com/whimian/pygeopressure/blob/master/docs/api/pygeopressure.basic.md Base class for survey index definitions. ```APIDOC ## class pygeopressure.basic.indexes.SurveyIndex(value) Bases: `object` ``` -------------------------------- ### Plot Normal Compaction Trend Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_well.ipynb Visualizes the original velocity log, geological horizons, and the calculated normal compaction trend (NCT). This comparison aids in assessing the quality of the NCT. ```python fig_vel, ax_vel = plt.subplots() ax_vel.invert_yaxis() # plot velocity vel_log.plot(ax_vel, label='Velocity') # plot horizon well_cug1.plot_horizons(ax_vel) # plot fitted nct nct_log.plot(ax_vel, color='r', zorder=2, label='NCT') # set fig style ax_vel.set(ylim=(5000,0), aspect=(5000/4600)*2) ax_vel.set_aspect(2) ax_vel.legend() fig_vel.set_figheight(8) ``` -------------------------------- ### pygeopressure.basic.indexes.DepthIndex Source: https://github.com/whimian/pygeopressure/blob/master/docs/api/pygeopressure.basic.md Represents a survey index based on depth values. ```APIDOC ## class pygeopressure.basic.indexes.DepthIndex(value) Bases: [`SurveyIndex`](#pygeopressure.basic.indexes.SurveyIndex) ``` -------------------------------- ### Process velocity log data Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_well.ipynb Applies upscaling and smoothing filters to the raw velocity log. This prepares the data for accurate coefficient optimization. ```python vel_log_filter = ppp.upscale_log(vel_log, freq=20) vel_log_filter_smooth = ppp.smooth_log(vel_log_filter, window=1501) ``` -------------------------------- ### Upscaling and Smoothing Pressure Log Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/multivariate.ipynb Applies upscaling and smoothing filters to the predicted pressure log. This can help in reducing noise and highlighting trends in the pressure data. ```python pres_log_filter = ppp.upscale_log(pres_log, freq=20) pres_log_filter_smooth = ppp.smooth_log(pres_log_filter, window=1501) ``` -------------------------------- ### pygeopressure.basic.threepoints.Not_threepoints_v1_Exception Source: https://github.com/whimian/pygeopressure/blob/master/docs/api/pygeopressure.basic.md Custom exception for data not conforming to three points version 1 format. ```APIDOC ## exception pygeopressure.basic.threepoints.Not_threepoints_v1_Exception(message=None) Bases: `Exception` ``` -------------------------------- ### Plot Predicted Pore Pressure Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_well.ipynb Visualizes the predicted pore pressure using Eaton's method alongside the lithostatic pressure, hydrostatic pressure, and geological horizons. This provides a comprehensive view of the pressure regime. ```python fig_pres, ax_pres = plt.subplots() ax_pres.invert_yaxis() well_cug1.get_log("Overburden_Pressure").plot(ax_pres, 'g', label='Lithostatic') ax_pres.plot(well_cug1.hydrostatic, well_cug1.depth, 'g', linestyle='--', label="Hydrostatic") pres_eaton_log.plot(ax_pres, color='blue', label='Pressure_Eaton') well_cug1.plot_horizons(ax_pres) # set figure and axis size ax_pres.set_aspect(2/50) ax_pres.legend() fig_pres.set_figheight(8) ``` -------------------------------- ### View Wells in HDF5 Storage Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/import_well_log_data.ipynb Lists the names of all wells currently stored in the HDF5 file. This is useful for verifying that data has been correctly added. ```python storage.wells ``` -------------------------------- ### Process Velocity Log for Eaton's Method Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_well.ipynb Applies filtering and smoothing to the velocity log data. Processed velocity is required for accurate optimization of Eaton's exponent 'n'. ```python # Velocity log processing (filtering and smoothing): vel_log_filter = ppp.upscale_log(vel_log, freq=20) vel_log_filter_smooth = ppp.smooth_log(vel_log_filter, window=1501) ``` -------------------------------- ### Visualize processed velocity log Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_well.ipynb Plots the original and processed velocity logs along with well horizons. This helps in visually assessing the effect of the filtering steps. ```python fig_vel, ax_vel = plt.subplots() ax_vel.invert_yaxis() # plot velocity vel_log.plot(ax_vel, label='Velocity') # plot horizon well_cug1.plot_horizons(ax_vel) # plot processed velocity vel_log_filter_smooth.plot(ax_vel, color='g', zorder=2, label='Processed', linewidth=1) # set fig style ax_vel.set(ylim=(5000,0), aspect=(4600/5000)*2) ax_vel.legend() fig_vel.set_figheight(8) ``` -------------------------------- ### Plot Bowers virgin (loading) curve Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_well.ipynb Visualizes the calculated Bowers virgin curve using the optimized 'A' and 'B' coefficients. This plot helps in validating the loading equation fit. ```python fig_bowers, ax_bowers = plt.subplots() ppp.plot_bowers_vrigin( ax=ax_bowers, well=well_cug1, a=a, b=b, vel_log=vel_log_filter_smooth, obp_log='Overburden_Pressure', upper='T12', lower='T20', pres_log='loading', mode='both') ``` -------------------------------- ### pygeopressure.basic.threepoints.Not_threepoints_v2_Exception Source: https://github.com/whimian/pygeopressure/blob/master/docs/api/pygeopressure.basic.md Custom exception for data not conforming to three points version 2 format. ```APIDOC ## exception pygeopressure.basic.threepoints.Not_threepoints_v2_Exception(message=None) Bases: `Exception` ``` -------------------------------- ### Plotting Hydrostatic and OBP Logs Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_well.ipynb Plots the hydrostatic and Overburden Pressure (OBP) logs for a well. Ensure matplotlib is imported as plt and the necessary log data (hydro_log, obp_log) is available. The y-axis is inverted to represent depth correctly. ```python fig_obp, ax_obp = plt.subplots() ax_obp.invert_yaxis() hydro_log.plot(ax_obp, color='g', linestyle='--', label='Hydrostatic') obp_log.plot(ax_obp, color='b', label='OBP') # set style ax_obp.set(ylim=(5000,0), aspect=(100/5000)*2) ax_obp.legend() fig_obp.set_figheight(8) fig_obp.show() ``` -------------------------------- ### Calculate density from velocity Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_seis.ipynb Computes the density cube from the velocity cube using the Gardner equation. This function 'den_from_vel' is a specific implementation for this conversion. ```python den_cube = ppp.gardner_seis("den_from_vel", vel_cube) ``` -------------------------------- ### pygeopressure.basic.indexes.CdpIndex Source: https://github.com/whimian/pygeopressure/blob/master/docs/api/pygeopressure.basic.md Represents a survey index based on CDP (Common Depth Point). ```APIDOC ## class pygeopressure.basic.indexes.CdpIndex(cdp) Bases: [`SurveyIndex`](#pygeopressure.basic.indexes.SurveyIndex) ``` -------------------------------- ### Plot predicted pressure cube Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_seis.ipynb Visualizes a slice of the predicted pressure cube generated by the Eaton method. Uses a custom OpendTect seismic colormap for display. ```python from pygeopressure.basic.vawt import opendtect_seismic_colormap fig_pres, ax_pres = plt.subplots() im = eaton_cube.plot( ppp.InlineIndex(8000), ax_pres, kind='img', cm=opendtect_seismic_colormap()) fig_pres.colorbar(im) fig_pres.set(figwidth=8) ``` -------------------------------- ### Horizon File Header Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/new_seismic.md Define the header for a horizon data file. This TSV file requires three columns: 'inline', 'crline', and 'z', representing the inline, crossline, and Z values for each point on the horizon. ```default inline crline z ``` -------------------------------- ### pygeopressure.basic.indexes.CrlineIndex Source: https://github.com/whimian/pygeopressure/blob/master/docs/api/pygeopressure.basic.md Represents a survey index based on crossline values. ```APIDOC ## class pygeopressure.basic.indexes.CrlineIndex(value) Bases: [`SurveyIndex`](#pygeopressure.basic.indexes.SurveyIndex) ``` -------------------------------- ### Plot velocity data section Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_seis.ipynb Visualizes a 2D section of the velocity cube using a specified inline index and colormap. Helps in understanding the seismic data. ```python fig_vel, ax_vel = plt.subplots() im = vel_cube.plot(ppp.InlineIndex(7400), ax_vel, kind='img', cm='gist_rainbow') fig_vel.colorbar(im) fig_vel.set(figwidth=8) ``` -------------------------------- ### Plot seismic velocity data Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_seis.ipynb Visualizes a slice of the seismic velocity data cube. The plot uses a 'gist_rainbow' colormap and is set to a figure width of 8. ```python fig_vel, ax_vel = plt.subplots() im = vel_cube.plot( ppp.InlineIndex(8000), ax_vel, kind='img', cm='gist_rainbow') fig_vel.colorbar(im) fig_vel.set(figwidth=8) ``` -------------------------------- ### Plot Extrapolated Density Log Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_well.ipynb Visualizes the original density log, the trend line, the smoothed log, and the final extrapolated density log. ```python fig_den, ax_den = plt.subplots() ax_den.invert_yaxis() # draw density log den_log.plot(ax_den, label='Density') # draw trend line ax_den.plot(den_trend, den_log.depth, color='r', linestyle='--', zorder=2, label='Trend') # draw processed density log ax_den.plot(den_log_filter_smooth.data, den_log_filter_smooth.depth, color='g', zorder=3, label='Smoothed') # draw extrapolated density ax_den.plot(extra_log.data, extra_log.depth, color='b', zorder=4, label='Extrapolated') # set style ax_den.set(ylim=(5000,0), aspect=(1.2/5000)*2) fig_den.set_figheight(8) fig_den.show() ``` -------------------------------- ### pygeopressure.basic.threepoints.Invalid_threepoints_Exception Source: https://github.com/whimian/pygeopressure/blob/master/docs/api/pygeopressure.basic.md Custom exception for invalid three points data. ```APIDOC ## exception pygeopressure.basic.threepoints.Invalid_threepoints_Exception(message=None) Bases: `Exception` ``` -------------------------------- ### pygeopressure.basic.threepoints.ThreePoints Source: https://github.com/whimian/pygeopressure/blob/master/docs/api/pygeopressure.basic.md Represents the inline, crossline, and z coordinates of three points within a survey. ```APIDOC ## class pygeopressure.basic.threepoints.ThreePoints(json_file=None) Bases: `object` inline, crossline and z coordinates of three points in survey ``` -------------------------------- ### Optimize Bowers unloading equation coefficient U Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/bowers_well.ipynb Calculates the 'U' coefficient for Bowers' unloading equation. This optimization is performed after manually selecting a value for Vmax and using the previously determined 'A' and 'B' coefficients. ```python u = ppp.optimize_bowers_unloading( well=well_cug1, vel_log=vel_log_filter_smooth, obp_log='Overburden_Pressure', a=a, b=b, vmax=4600, pres_log='unloading') ``` -------------------------------- ### Extrapolate Density Log Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_well.ipynb Extrapolates the processed (filtered and smoothed) density log to the sea bottom using the Traugott equation and fitted coefficients. ```python extra_log = ppp.extrapolate_log_traugott( den_log_filter_smooth, a, b, kb=well_cug1.kelly_bushing, wd=well_cug1.water_depth) ``` -------------------------------- ### Add Well Data to HDF5 Storage Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/import_well_log_data.ipynb Adds a well's data, provided as a pandas DataFrame, to the HDF5 storage file. This allows for persistent storage of well log data. ```python storage.add_well(well_name='cug3', well_data_frame=las_data.data_frame) ``` -------------------------------- ### Plot Processed Density Log with Trend Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_well.ipynb Displays the original density log, the Traugott trend line, and the filtered and smoothed density log for comparison. ```python fig_den, ax_den = plt.subplots() ax_den.invert_yaxis() # draw density log den_log.plot(ax_den, label='Density') # draw fitted density trend line ax_den.plot(den_trend, den_log.depth, color='r', linestyle='--', zorder=2, label='Trend') # draw processed density log ax_den.plot(den_log_filter_smooth.data, den_log_filter_smooth.depth, color='g', zorder=3, label='Smoothed') # set style ax_den.set(ylim=(5000,0), aspect=(1.2/5000)*2) ax_den.legend() fig_den.set_figheight(8) fig_den.show() ``` -------------------------------- ### Access Survey Wells Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/import_well_log_data.ipynb Retrieves information about wells within the survey. This is useful for checking available wells or accessing specific well objects. ```python survey.wells ``` -------------------------------- ### Plot Original Density Log Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_well.ipynb Plots the raw density log data. The y-axis is inverted to represent depth from surface downwards. ```python fig_den, ax_den = plt.subplots() ax_den.invert_yaxis() den_log.plot(ax_den) # set style ax_den.set(ylim=(5000,0), aspect=(1.2/5000)*2) fig_den.set_figheight(8) fig_den.show() ``` -------------------------------- ### Access velocity data Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/obp_seis.ipynb Retrieves the velocity data cube from the loaded survey object. This velocity data is a prerequisite for density calculation. ```python vel_cube = survey.seismics['velocity'] ``` -------------------------------- ### Read Pseudo-LAS Data Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/import_well_log_data.ipynb Executes the reading process for pseudo-LAS files. This populates the `data_frame` attribute of the `LasData` object. ```python las_data.read_pseudo_las() ``` -------------------------------- ### Access well data Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_seis.ipynb Retrieves a specific well object, 'CUG1', from the loaded survey data. ```python well_cug1 = survey.wells['CUG1'] ``` -------------------------------- ### Calculate Normal Velocity Trend Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_well.ipynb Calculates the normal velocity trend (NCT) using the optimized coefficients 'a' and 'b'. This trend represents the expected velocity in a normally compacted state. ```python from pygeopressure.velocity.extrapolate import normal_log nct_log = normal_log(vel_log, a=a, b=b) ``` -------------------------------- ### Assign DataFrame to Well Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/import_well_log_data.ipynb Assigns a pandas DataFrame containing well log data to a specific Well object. This imports the data into the survey at runtime. ```python cug3.data_frame = las_data.data_frame ``` -------------------------------- ### Assign Partial DataFrame to Well Source: https://github.com/whimian/pygeopressure/blob/master/docs/howtos/import_well_log_data.ipynb Assigns a subset of a pandas DataFrame to a Well object, allowing for the import of specific log curves only. ```python cug3.data_frame = las_data.data_frame[['Depth(m)', 'Shale_Volume(Fraction)', 'Density(G/C3)']] ``` -------------------------------- ### Plot Eaton's Exponent Error Source: https://github.com/whimian/pygeopressure/blob/master/docs/tutorial/eaton_well.ipynb Visualizes the Root Mean Square (RMS) error variation with respect to Eaton's exponent 'n'. This plot helps in selecting the optimal 'n' value that minimizes prediction error. ```python from pygeopressure.basic.plots import plot_eaton_error fig_err, ax_err = plt.subplots() plot_eaton_error( ax=ax_err, well=well_cug1, vel_log=vel_log_filter_smooth, obp_log="Overburden_Pressure", a=a, b=b) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.