dripy package

Submodules

dripy.dripy module

Module for working with drilling data.

dripy.dripy.las_to_excel(las_file_path: str)[source]

Converts a .las file to a .xlsx file. Creates a .xlsx file with the same name (different extension) as the input file.

Parameters

las_file_path (str) – Filepath to data in .las format

dripy.lodestar module

class dripy.lodestar.LodeStarData(filename, stack_order=None, date_parser=None, write_pickle=True)[source]

Bases: object

MAX_TIME_DEC = 4
STANDARD_SIGNALS = {'moment': ['bobmag'], 'rpm': ['rpmacc'], 'torque': ['tob'], 'wob': ['wob']}
slice_at_indices(i_start, i_end, shift_time=True)[source]

Returns a :class:LodeStarData object sliced at the provided times

Parameters
  • i_start (int) – Index to start the slice at.

  • i_end (int) – Index to end the slice at.

Returns

Sliced :class:LodeStarData object.

Return type

LodeStarData

slice_at_times(t_start, t_end, shift_time=True)[source]

Returns a :class:LodeStarData object sliced at the provided times

Parameters
  • t_start (float) – Time to start the slice at.

  • t_end (float) – Time to end the slice at.

Returns

Sliced :class:LodeStarData object.

Return type

LodeStarData

dripy.lodestar.combine_with_pason(lodestar_dataframe, pason_dataframe, pickle_file=None)[source]

Combine a pandas :obj:DataFrame containing Lodestar data with a pandas :obj:DataFrame containing Pason Data.

Parameters
  • lodestar_dataframe (DataFrame) – pandas :obj:DataFrame containing Lodestar data

  • pason_dataframe (DataFrame) – pandas :obj:DataFrame containing Pason Data.

  • pickle_file (str (Optional)) – If given, resulting dataframe will be pickled.

Returns

Compined pandas :obj:DataFrame

Return type

DataFrame

dripy.pason module

Module for working with Pason Data

class dripy.pason.PasonData(filename, date_parser=None, motor_factor=None)[source]

Bases: object

Object representing a Pason dataset.

Examples

Referring to the rpm by the rpm attribute

>>> filename = 'pason.csv'
>>> pason_data = PasonData(filename)
>>> pason_data.rpm[1000:1002]
[84.95, 83.89]

Refering to the rpm by the standard signal name ‘rpm’ in the data attribute.

>>> pason_data.data['rpm'][1000:1002].values
array([84.95, 83.89])

Refering to the rpm by its name in the referenced .csv file

>>> pason_data.data['rotary_rpm'][1000:1002].values
array([84.95, 83.89])

Plotting all the standard signals. NOTE: matplotlib.pyplot is included in the class and can be accessed via PasonData.plt

>>> for signal in PasonData.STANDARD_SIGNALS:
>>>     pason_data.plt.figure()
>>>     plot = pason_data.data[signal].plot())
>>>     plot.set_ylabel('{} ({})'.format(signal.capitalize(), pason_data.units[signal]))
>>>     plot.set_xlabel('{} ({})'.format(pason_data.data.index.name, pason_data.units[pason_data.data.index.name]))
>>>     plot.grid()
>>> PasonData.plt.show()
<matplotlib.axes._subplots.AxesSubplot object at 0x000000001C517EF0>
filename

Name of the file from which Pason data was loaded.

Type

str

wob

Weight on bit signal

Type

list

rpm

Rotary RPM signal

Type

list

flow

Mud flow rate signal

Type

list

torque

Surface torque signal

Type

list

md

Measured depth signal

Type

list

rop

Rate of penetration signal

Type

list

pressure

Differential pressure signal

Type

list

mse

Mechanical specific energy signal

Type

list

units

Dictionary indicicating the units associated with each column in data

Type

dict

data

Pandas DataFrame containing all the data from filename.

Type

pandas.core.frame.DataFrame

STANDARD_SIGNALS

Class attribute with standard signal name as keys and lists of expected names in the pason csv files as values.

Type

dict

MAX_TIME_DEC = 2
SETPOINT_FILTER_CUTOFF = 0.1
SETPOINT_SIGMA = 4
STANDARD_SIGNALS = {'gpm': ['total_pump_output'], 'md': ['bit_depth'], 'mse': ['mechanical_specific_energy'], 'pressure': ['differential_pressure'], 'rop': ['rate_of_penetration'], 'rpm': ['rotary_rpm'], 'torque': ['convertible_torque', 'rotary_torque', 'top_drive_torque'], 'wob': ['weight_on_bit']}
get_setpoints(signal_type, show_plot=True)[source]

Gets the setpoints from the rpm or gpm Pason signals.

Notes

This method is experimental. It is highly recommended to set show_plot=True to visually confirm that the extracted setpoints are sensible. This method has been tested on rpm and gpm signals only. It has not been tested on other types of Pason signals.

Setting show_plot=True will halt execution until the figure window is closed.

Parameters
  • signal_type (str) – ‘rpm’, ‘gpm’, or ‘wob’

  • show_plot (bool, optional) – If True, shows a plot of the resulting setpoints (the default is True)

Returns

List of tuples where each tuple contains the setpoint time and setpoint value.

Return type

list

plt = <module 'matplotlib.pyplot' from 'c:\\users\\bthornt\\code\\dripy\\env\\lib\\site-packages\\matplotlib\\pyplot.py'>
slice_at_indices(i_start, i_end, shift_time=True)[source]

Returns a :class:PasonData object sliced at the provided times

Parameters
  • i_start (int) – Index to start the slice at.

  • i_end (int) – Index to end the slice at.

Returns

Sliced :class:PasonData object.

Return type

PasonData

slice_at_times(t_start, t_end, shift_time=True)[source]

Returns a :class:PasonData object sliced at the provided times

Parameters
  • t_start (float) – Time to start the slice at.

  • t_end (float) – Time to end the slice at.

Returns

Sliced :class:PasonData object.

Return type

PasonData

dripy.pason.pason_post_processing(t, sig)[source]

Process a signal as it would be processed by pason

This function applies the following processing steps:
  1. Sample at 50 Hz

  2. Apply a digital low pass filter with a cutoff frequency of 0.99 Hz

  3. Resample at 5 Hz

  4. Calculate maximum over each 1 second period

Parameters
  • t (list) – Time series corresponding to the signal to be processed

  • sig (list) – Signal to be processed

Returns

time, processed signal

Return type

tuple

dripy.pason.slice_step_tests(pason, step_test_times, include_tagging_bottom=False, expand_forward=None, expand_backward=None)[source]

Slices the step test data out of the pason data

Parameters
  • pason (PasonData) – :class:PasonData object

  • step_test_times (list of lists of strs) – list of pairs of date strings containing the start and end times of the slice

  • include_tagging_bottom (bool (Optional)) – If True, slices the test starting at the preceeding bottom tag time

  • expand_forward (float (Optional)) – Number of seconds to expand slice forward in time

  • expand_backward (float (Optional)) – Number of seconds to expand slice backward in time

Returns

Sliced :class:PasonData object

Return type

PasonData

dripy.survey module

Module contents