dripy package¶
Submodules¶
dripy.dripy module¶
Module for working with drilling data.
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
- Returns
Sliced :class:LodeStarData object.
- Return type
-
-
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>
-
STANDARD_SIGNALS
¶ Class attribute with standard signal name as keys and lists of expected names in the pason csv files as values.
- Type
-
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.
-
plt
= <module 'matplotlib.pyplot' from 'c:\\users\\bthornt\\code\\dripy\\env\\lib\\site-packages\\matplotlib\\pyplot.py'>¶
-
-
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:
Sample at 50 Hz
Apply a digital low pass filter with a cutoff frequency of 0.99 Hz
Resample at 5 Hz
Calculate maximum over each 1 second period
-
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