pygeopressure.basic package¶
Submodules¶
pygeopressure.basic.indexes module¶
class for survey index definition
created on Jun 10th 2017
pygeopressure.basic.las module¶
an interface for interacting with Las file
Created on Thu May 10 2018
pygeopressure.basic.log_tools module¶
well log processing tools
Created on Sep 19 2018
-
pygeopressure.basic.log_tools.
extrapolate_log_traugott
(den_log, a, b, kb=0, wd=0)[source]¶ Extrapolate density log using Traugott equation
-
pygeopressure.basic.log_tools.
local_average
(log, rad=10)[source]¶ upscale data using local averaging
- Parameters
data (Log()) – log data to be upscaled
rad (int) – local radius, data within this radius will be represented by a single value
- Returns
new_log – upscaled log data
- Return type
Log()
-
pygeopressure.basic.log_tools.
shale
(log, vsh_log, thresh=0.35)[source]¶ Discern shale intervals
- logLog
log to discern
- vsh_logLog
shale volume log
- threshscalar
percentage threshold, 0 < thresh < 1
-
pygeopressure.basic.log_tools.
smooth_log
(log, window=1500)[source]¶ - Parameters
log (Log object) – log to smooth
window (scalar) – window size of the median filter
- Returns
smoothed log – smoothed log
- Return type
Log object
-
pygeopressure.basic.log_tools.
truncate_log
(log, top, bottom)[source]¶ Remove unreliable values in the top and bottom section of well log
- Parameters
log (Log object)
top, bottom (scalar) – depth value
- Returns
trunc_log
- Return type
Log object
pygeopressure.basic.optimizer module¶
optimizer for different models
Created on Sep 16 2018
-
pygeopressure.basic.optimizer.
optimize_bowers_trace
(depth_tr, vel_tr, obp_tr, hydro_tr, depth_upper, depth_lower)[source]¶
-
pygeopressure.basic.optimizer.
optimize_bowers_unloading
(well, vel_log, obp_log, a, b, vmax, pres_log='unloading')[source]¶ Optimize for Bowers Unloading curve parameter U
- Parameters
well (Well)
vel_log (Log or str) – Log object or well log name stored in well
obp_log (Log or str) – Log object or well log name stored in well
vmax (float) – vmax in bowers unloading curve
pres_log (Log or str) – Log object storing measured pressure value or Pressure name stored in well
- Returns
u (float) – unloading curve cofficient U
error (float) – Relative RMS error
-
pygeopressure.basic.optimizer.
optimize_bowers_virgin
(well, vel_log, obp_log, upper, lower, pres_log='loading', mode='nc', nnc=5)[source]¶ Optimizer for Bowers loading curve
- Parameters
well (Well)
vel_log (Log or str) – Log object or well log name stored in well
obp_log (Log or str) – Log object or well log name stored in well
upper (float or str) – upper bound of nct, depth value or horizon name
lower (float or str) – lower bound of nct, depth value or horizon name
pres_log (Log or str) – Log object storing measured pressure value or Pressure name stored in well
mode ({‘nc’, ‘pres’, ‘both’}) – which pressure to use for optimization, - ‘nc’ : points on NCT - ‘pres’ : points in pres_log - ‘both’ : both of them
nnc (int) – number of points to pick on NCT
- Returns
a, b (tuple of floats) – optimized bowers loading curve coefficients
rms_err (float) – root mean square error of pressure
-
pygeopressure.basic.optimizer.
optimize_eaton
(well, vel_log, obp_log, a, b, pres_log='loading')[source]¶ Optimizer for Eaton model
- Parameters
well (Well)
vel_log (Log or str) – Log object or well log name stored in well
obp_log (Log or str) – Log object or well log name stored in well
a, b (float) – coefficients of NCT
pres_log (Log or str) – Log object storing measured pressure value or Pressure name stored in well
- Returns
n (float) – optimized eaton exponential
min_eer (float) – minimum error abtained by optimized n
rms_err (array) – array of rms error of different n around minmum
-
pygeopressure.basic.optimizer.
optimize_multivaraite
(well, obp_log, vel_log, por_log, vsh_log, B, upper, lower)[source]¶
-
pygeopressure.basic.optimizer.
optimize_nct
(vel_log, fit_start, fit_stop)[source]¶ Fit velocity NCT
- Parameters
vel_log (Log) – Velocity log
fit_start, fit_stop (float) – start and end depth for fitting
- Returns
a, b – NCT coefficients
- Return type
-
pygeopressure.basic.optimizer.
optimize_nct_trace
(depth, vel, fit_start, fit_stop, pick=True)[source]¶
-
pygeopressure.basic.optimizer.
optimize_traugott
(den_log, fit_start, fit_stop, kb=0, wd=0)[source]¶ Fit density variation against depth with Traugott equation
- Parameters
den_log (Log) – Density log
fit_start, fit_stop (float) – start and end depth for fitting
kb (float) – kelly bushing height in meters
wd (float) – water depth in meters
- Returns
a, b – Traugott equation coefficients
- Return type
pygeopressure.basic.plots module¶
a Well class utilizing pandas DataFrame and hdf5 storage
Created on May 27 2018
-
class
pygeopressure.basic.plots.
LoadingPlot
(ax, obp_logs, vel_logs, pres_logs, well_names)[source]¶ Bases:
object
- Parameters
json_file (str) – path to parameter file
-
pygeopressure.basic.plots.
plot_bowers_unloading
(ax, a, b, u, vmax, well, vel_log, obp_log, pres_log='unloading')[source]¶ plot bowers unloading plot
-
pygeopressure.basic.plots.
plot_bowers_vrigin
(ax, a, b, well, vel_log, obp_log, upper, lower, pres_log='loading', mode='nc', nnc=5)[source]¶
pygeopressure.basic.seisegy module¶
class for interfacing with segy file.
Created on Feb. 7th 2018
-
class
pygeopressure.basic.seisegy.
SeiSEGY
(segy_file, like=None)[source]¶ Bases:
object
-
data
(indexes)[source]¶ Retrieve Data according to the index provided.
- Parameters
indexes ({InlineIndex, CrlineIndex, DepthIndex, CdpIndex}) – index of data to retrieve
- Returns
- Return type
numpy.ndarray
-
classmethod
from_json
(json_file, segy_file=None)[source]¶ Initialize SeiSEGY from an json file containing information
- Parameters
json_file (str) – json file path
segy_file (str) – segy file path for overriding information in json file.
-
inline_crlines
()[source]¶ Iterator for both inline and crline numbers
- Yields
tuple of int – (inline number, crossline number)
-
plot
(index, ax, kind='vawt', cm='seismic', ptype='seis')[source]¶ Plot seismic section according to index provided.
- Parameters
index ({InlineIndex, CrlineIndex, DepthIndex, CdpIndex}) – index of data to plot
ax (matplotlib.axes._subplots.AxesSubplot) – axis to plot on
kind ({‘vawt’, ‘img’}) – ‘vawt’ for variable area wiggle trace plot ‘img’ for variable density plot
cm (str) – colormap for plotting
ptype (str, optional) – property type
- Returns
- Return type
matplotlib.image.AxesImage
-
pygeopressure.basic.survey module¶
Class for defining a seismic survey
Created on Fri Dec 11 20:24:38 2015
-
class
pygeopressure.basic.survey.
Survey
(survey_dir)[source]¶ Bases:
pygeopressure.basic.survey_setting.SurveySetting
Survey object for combining seismic data and well log data.
- Parameters
survey_dir (str) – survey directory.
-
seisCube
¶ SeisCube object holding seismic data.
- Type
SeisCube
-
add_well
(well)¶ add a well to survey
pygeopressure.basic.survey_setting module¶
A survey setting class
Created on Sat Jan 20 2018
-
class
pygeopressure.basic.survey_setting.
SurveySetting
(threepoints)[source]¶ Bases:
object
class to hold survey settings and compute additional coordination property
-
azimuth_and_invertedAxis
()[source]¶ Determine azimuth (Crossline axis direction from Coordination North) and Inline axis is positive to the right (invertedAxis=False) or to the left (invertedAxis=True)
-
pygeopressure.basic.threepoints module¶
Created on Feb. 14th 2018
-
exception
pygeopressure.basic.threepoints.
Invalid_threepoints_Exception
(message=None)[source]¶ Bases:
Exception
-
exception
pygeopressure.basic.threepoints.
Not_threepoints_v1_Exception
(message=None)[source]¶ Bases:
Exception
pygeopressure.basic.utils module¶
some utilities
-
pygeopressure.basic.utils.
nmse
(measure, predict)[source]¶ Normalized Root-Mean-Square Error
with RMS(y - y*) as nominator, and MEAN(y) as denominator
-
pygeopressure.basic.utils.
pick_sparse
(a_array, n)[source]¶ Pick n equally spaced samples from array
- Parameters
a_array (1-d ndarray)
n (int) – number of samples to pick
pygeopressure.basic.vawt module¶
Created on Thu Apr 26 2017
-
class
pygeopressure.basic.vawt.
Wiggles
(data, wiggleInterval=10, overlap=1, posFill='black', negFill=None, lineColor='black', rescale=True, extent=None, ax=None)[source]¶ Bases:
object
-
pygeopressure.basic.vawt.
wiggle
(values, origin=0, posFill='black', negFill=None, lineColor='black', resampleRatio=10, rescale=False, zmin=0, zmax=None, ax=None)[source]¶ Plot a trace in VAWT(Variable Area Wiggle Trace)
- Parameters
x (input data (1D numpy array))
origin ((default, 0) value to fill above or below (float))
posFill ((default, black)) – color to fill positive wiggles with (string or None)
negFill ((default, None)) – color to fill negative wiggles with (string or None)
lineColor ((default, black)) – color of wiggle trace (string or None)
resampleRatio ((default, 10)) – factor to resample traces by before plotting (1 = raw data) (float)
rescale ((default, False)) – If True, rescale “x” to be between -1 and 1
zmin ((default, 0)) – The minimum z to use for plotting
zmax ((default, len(x))) – The maximum z to use for plotting
ax ((default, current axis)) – The matplotlib axis to plot onto
- Returns
- Return type
Plot
-
pygeopressure.basic.vawt.
wiggles
(data, wiggleInterval=10, overlap=5, posFill='black', negFill=None, lineColor='black', rescale=True, extent=None, ax=None)[source]¶ 2-D Wiggle Trace Variable Amplitude Plot
- Parameters
x (input data (2D numpy array))
wiggleInterval ((default, 10) Plot ‘wiggles’ every wiggleInterval traces)
overlap ((default, 0.7) amount to overlap ‘wiggles’ by (1.0 = scaled) – to wiggleInterval)
posFill ((default, black) color to fill positive wiggles with (string) – or None)
negFill ((default, None) color to fill negative wiggles with (string) – or None)
lineColor ((default, black) color of wiggle trace (string or None))
resampleRatio ((default, 10) factor to resample traces by before) – plotting (1 = raw data) (float)
extent ((default, (0, nx, 0, ny)) The extent to use for the plot.) – A 4-tuple of (xmin, xmax, ymin, ymax)
ax ((default, current axis) The matplotlib axis to plot onto.)
Output – a matplotlib plot on the current axes
pygeopressure.basic.well module¶
a Well class utilizing pandas DataFrame and hdf5 storage
Created on Tue Dec 27 2016
-
class
pygeopressure.basic.well.
Well
(json_file, hdf_path=None)[source]¶ Bases:
object
A class representing a well with information and log curve data.
-
add_log
(log, name=None, unit=None)[source]¶ Add new Log to current well
- Parameters
log (Log) – log to be added
name (str, optional) – name for the newly added log, None, use log.name
unit (str, optional) – unit for the newly added log, None, use log.unit
-
bowers
(vel_log, obp_log=None, a=None, b=None, u=1, vmax=4600, start_depth=None, buf=20, end_depth=None, end_buffer=10)[source]¶ Predict pore pressure using Eaton method
- Parameters
vel_log (Log) – velocity log
obp_log (Log) – overburden pressure log
a, b, u (float) – bowers model coefficients
- Returns
a Log object containing calculated pressure.
- Return type
-
property
depth
¶ depth values of the well
- Returns
- Return type
numpy.ndarray
-
drop_log
(log_name)[source]¶ delete a Log in current Well
- Parameters
log_name (str) – name of the log to be deleted
-
eaton
(vel_log, obp_log=None, n=None, a=None, b=None)[source]¶ Predict pore pressure using Eaton method
- Parameters
vel_log (Log) – velocity log
obp_log (Log) – overburden pressure log
n (scalar) – Eaton exponent
- Returns
a Log object containing calculated pressure.
- Return type
-
get_log
(logs, ref=None)[source]¶ Retreive one or several logs in well
- Parameters
logs (str or list str) – names of logs to be retrieved
ref ({‘sea’, ‘kb’}) – depth reference, ‘sea’ references to sea level, ‘kb’ references to Kelly Bushing
- Returns
one or a list of Log objects
- Return type
-
get_pressure
(pres_key, ref=None, hydrodynamic=0, coef=False)[source]¶ Get Pressure Values or Pressure Coefficients
- Parameters
pres_key (str) – Pressure data name
ref ({‘sea’, ‘kb’}) – depth reference, ‘sea’ references to sea level, ‘kb’ references to Kelly Bushing
hydrodynamic (float) – return Pressure at depth deeper than this value
coef (bool) – True - get pressure coefficient else get pressure value
- Returns
Log object containing Pressure or Pressure coefficients
- Return type
-
get_pressure_normal
()[source]¶ return pressure points within normally pressured zone.
- Returns
Log object containing normally pressured measurements
- Return type
-
property
hydrostatic
¶ Hydrostatic Pressure
- Returns
- Return type
numpy.ndarray
-
property
lithostatic
¶ Overburden Pressure (Lithostatic)
- Returns
- Return type
numpy.ndarray
-
multivariate
(vel_log, por_log, vsh_log, obp_log=None, a0=None, a1=None, a2=None, a3=None, b=None)[source]¶
-
property
normal_velocity
¶ Normal Velocity calculated using NCT stored in well
- Returns
- Return type
numpy.ndarray
-
rename_log
(log_name, new_log_name)[source]¶ - Parameters
log_name (str) – log name to be replaced
new_log_name (str)
-
to_las
(file_path, logs_to_export=None, full_las=False, null_value=1e+30)[source]¶ Export logs to LAS or pseudo-LAS file
- Parameters
file_path (str) – output file path
logs_to_export (list of str) – Log names to be exported, None export all logs
full_las (bool) – True, export LAS header; False export only data hence psuedo-LAS
null_value (scalar) – Null Value representation in output file.
-
property
unit_dict
¶ properties and their units
-
pygeopressure.basic.well_log module¶
class Log for well log data
Created on Fri Apr 18 2017
-
class
pygeopressure.basic.well_log.
Log
(file_name=None, log_name='unk')[source]¶ Bases:
object
class for well log data
-
property
bottom
¶ bottom depth of this log
-
property
data
¶ property data of the log
-
property
depth
¶ depth data of the log
-
plot
(ax=None, color='gray', linewidth=0.5, linestyle='-', label=None, zorder=1)[source]¶ Plot log curve
- Parameters
ax (matplotlib.axes._subplots.AxesSubplot) – axis object to plot on, a new axis will be created if not provided
- Returns
- Return type
matplotlib.axes._subplots.AxesSubplot
-
property
start
¶ start depth of available property data
-
property
start_idx
¶ start index of available property data
-
property
stop
¶ end depth of available property data
-
property
stop_idx
¶ end index of available property data
-
property
top
¶ top depth of this log
-
property
pygeopressure.basic.well_storage module¶
an interface to a hdf5 storage file
Created on Thu May 10 2018