pygeopressure.basic package

Submodules

pygeopressure.basic.horizon module

class Horizon for accessing horizon

Created on Fri July 20 2017

class pygeopressure.basic.horizon.Horizon(data_file)[source]

Bases: object

Horizon using excel file as input

Parameters

data_file (str) – path to excel data file

get_cdp(cdp)[source]

Get value for a CDP point on the horizon.

Parameters

cdp (tuple of int (inline, crossline))

pygeopressure.basic.indexes module

class for survey index definition

created on Jun 10th 2017

class pygeopressure.basic.indexes.CdpIndex(cdp)[source]

Bases: pygeopressure.basic.indexes.SurveyIndex

class pygeopressure.basic.indexes.CrlineIndex(value)[source]

Bases: pygeopressure.basic.indexes.SurveyIndex

class pygeopressure.basic.indexes.DepthIndex(value)[source]

Bases: pygeopressure.basic.indexes.SurveyIndex

class pygeopressure.basic.indexes.InlineIndex(value)[source]

Bases: pygeopressure.basic.indexes.SurveyIndex

class pygeopressure.basic.indexes.SurveyIndex(value)[source]

Bases: object

pygeopressure.basic.las module

an interface for interacting with Las file

Created on Thu May 10 2018

class pygeopressure.basic.las.LasData(las_file)[source]

Bases: object

Class for reading LAS and pseudo-LAS file data

null_values could be set to more values in order to deal with messy files

property data_frame
property file_type
find_logs()[source]
property logs
read_las()[source]
read_pseudo_las()[source]
property units

pygeopressure.basic.log_tools module

pygeopressure.basic.optimizer module

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

check_error(obp_log, vel_log, pres_log)[source]
error_sigma()[source]
fit()[source]
plot()[source]
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.plots.plot_eaton_error(ax, well, vel_log, obp_log, a, b, pres_log='loading')[source]
pygeopressure.basic.plots.plot_multivariate(axes, well, vel_log, por_log, vsh_log, obp_log, upper, lower, a0, a1, a2, a3, B)[source]

pygeopressure.basic.seisegy module

pygeopressure.basic.survey module

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

static angle(x, y)[source]

Return angle from 0 to pi

x : tuple y : tuple

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)

coord_2_line(coordinate)[source]
draw_survey_line(ax)[source]
four_corner_on_canvas(canvas_width, canvas_height, scale_factor=0.8)[source]

get the coordinaiton of four corners of survey area on canvas

line_2_coord(inline, crline)[source]

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

exception pygeopressure.basic.threepoints.Not_threepoints_v2_Exception(message=None)[source]

Bases: Exception

class pygeopressure.basic.threepoints.ThreePoints(json_file=None)[source]

Bases: object

inline, crossline and z coordinates of three points in survey

pygeopressure.basic.utils module

some utilities

pygeopressure.basic.utils.methdispatch(func)[source]
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.utils.rmse(measure, predict)[source]

Relative Root-Mean-Square Error

with RMS(y - y*) as nominator, and RMS(y) as denominator

pygeopressure.basic.utils.split_sequence(sequence, length)[source]

Split a sequence into fragments with certain length

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

wiggle(values)[source]

Plot a trace in VAWT(Variable Area Wiggle Trace)

wiggles()[source]

2-D Wiggle Trace Variable Amplitude Plot

pygeopressure.basic.vawt.img(data, extent, ax, cm='seismic', ptype='seis')[source]
pygeopressure.basic.vawt.opendtect_seismic_colormap()[source]
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=None, vmax=None, 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

Log

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

Log

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

Log

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

Log

get_pressure_normal()[source]

return pressure points within normally pressured zone.

Returns

Log object containing normally pressured measurements

Return type

Log

hydro_log()[source]
Returns

Hydrostatic Pressure

Return type

Log

property hydrostatic

Hydrostatic Pressure

Returns

Return type

numpy.ndarray

property lithostatic

Overburden Pressure (Lithostatic)

Returns

Return type

numpy.ndarray

property logs

logs stored in this well

Returns

Return type

list

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

plot_horizons(ax, color_dict=None)[source]

Plot horizons stored in well

rename_log(log_name, new_log_name)[source]
Parameters
  • log_name (str) – log name to be replaced

  • new_log_name (str)

save_params()[source]

Save edited parameters to well information file

save_well_logs()[source]

Save current well logs to file

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

update_log(log_name, log)[source]

Update well log already in current well with a new Log

Parameters
  • log_name (str) – name of the log to be replaced in current well

  • log (Log) – Log to replace

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

classmethod from_scratch(depth, data, name=None, units=None, descr=None, prop_type=None)[source]
get_data(depth)[source]

get data at certain depth

get_depth_idx(d)[source]

return index of depth

get_resampled(rate)[source]

return resampled 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

to_las(file_name)[source]

Save as pseudo-las file

property top

top depth of this log

pygeopressure.basic.well_storage module

an interface to a hdf5 storage file

Created on Thu May 10 2018

class pygeopressure.basic.well_storage.WellStorage(hdf5_file=None)[source]

Bases: object

interface to hdf5 file storing well logs

this class is designed to accept only LasData.data_frame as input data

add_well(well_name, well_data_frame)[source]
get_well_data(well_name)[source]
logs_into_well(well_name, logs_data_frame)[source]
remove_well(well_name)[source]
update_well(well_name, well_data_frame)[source]
property wells

Module contents