class watex.geology.drilling.Borehole(lat=None, lon=None, area=None, status=None, depth=None, base_depth=None, geol=None, staticlevel=None, airlift=None, id=None, qmax=None, **kwds)[source]#

Bases: Geology

Focused on Wells and Borehole offered to the population. To use the data for prediction purpose, each Borehole provided must be referenced on coordinates values or provided the same as the one used on ves or erp file.

fit(data)[source]#

Fit Borehole data and populate the corrsponding attributes

class watex.geology.drilling.DSBorehole(name=None, dname=None, projection='ll', utm_zone=None, datum='WGS84', epsg=None, reference_ellipsoid=23, encoding='utf-8', lonlat=None, verbose=0)[source]#

Bases: object

Class delas with Borehole datasets.

watex.geology.drilling.DSBorehole works with data collected in a single borehole. For instance, it could follow the arrangement of h502 data in watex.datasets.load_hlogs()

Parameters:
  • name (str) – Name or ID of the borehole.

  • dname (str, optional) – Depth column name. If depth is specify an attribute depth_ should be created. Depth specification is usefull for log plotting of machine training.

  • utm_zone (Optional, string) – zone number and ‘S’ or ‘N’ e.g. ‘55S’. Default to the centre point of coordinates points in the survey area. It should be a string (##N or ##S) in the form of number and North or South hemisphere, 10S or 03N

  • projection (str, ['utm'|'dms'|'ll']) – The coordinate system in which the data points for the profile is collected. If not given, the auto-detection will be triggered and find the suitable coordinate system. However, it is recommended to provide it for consistency. Note that if x and y are composed of value less than 180 degrees for longitude and 90 degrees for latitude, it should be considered as longitude-latitude (ll) coordinates system. If x and y are degree-minutes-second (dms or dd:mm:ss) data, they must be specify as coordinate system in order to accept the non-numerical data before transforming to ll. If data is passed to the fit() method and dms is not specify, x and y values should be discarded.

  • datum (string, default = 'WGS84') – well known datum ex. WGS84, NAD27, NAD83, etc.

  • epsg (Optional, int) –

    epsg number defining projection (

    see http://spatialreference.org/ref/ for moreinfo)

    Overrides utm_zone if both are provided.

  • reference_ellipsoid (int, default=23) – reference ellipsoids is derived from Peter H. Dana’s website- http://www.utexas.edu/depts/grg/gcraft/notes/datum/elist.html Department of Geography, University of Texas at Austin Internet: pdana@mail.utexas.edu . Default is 23 constrained to WGS84.

  • encoding (str, default ='utf8') – Default encoding for parsing data. Can also be [‘utf-16-be’] for reading bytes characters.

  • lonlat (Tuple, Optional) – longitude/latitude for borehole coordinates. The location where the borehole is performed.

  • verbose (int, default=0) – Output messages.

depth_#

Depth array if dname is specified.

Type:

Series

data_#

Sanitized dataframe.

Type:

Pandas DataFrame

Note

Each columns of the dataframe is an attribute. Note that all the non- alphabetic letters is removed and replace by ‘_’.

fit(data, **fit_params)[source]#

Fit Borehole data and populate attribute data.

By default if the projection is given as latitude/longitude xlon, ylat are longitude and latitude respectively.

Parameters:

data (pd.DataFrame or Path-like object.) – Data containing xlon and y values as series. Then if xlon and y are given as string argument, their names must be included in the data columns. Otherwise an error will raise.

Returns:

self – Instanced object for chaining method.

Return type:

Instanced object

property inspect#

Inspect object whether is fitted or not

set_depth(z0=0.0, max_depth=None)[source]#

Set the a random depth if depth is not given.

To fetch the depth, use attribute depth_. Note that if the depth exist, calling set_depth will arase the former depth value. Use in cautioness.

Parameters:
  • z0 (float, default=0.) – The surface reference. Preferably, it is set to null.

  • max_depth (float, default=700.) – The maximum depth. Depth size must fit the length of the data in meters. Default depth is fixed to 700 meters.

Returns:

self – Instanced object for chaining method.

Return type:

Instanced object

set_thickness(h0=1, **kws)[source]#

Set a random layer thickness from borehole refering to the depth.

To fetch the thickness, use attribute layer_thickness_.

Parameters:
  • h0 (int, default='1m') – Thickness of the first layer.

  • shuffle (bool, default=True) – Shuffle the random generated thicknesses.

  • dirichlet_dis (bool, default=False) – Draw samples from the Dirichlet distribution. A Dirichlet-distributed random variable can be seen as a multivariate generalization of a Beta distribution. The Dirichlet distribution is a conjugate prior of a multinomial distribution in Bayesian inference.

  • random_state (int, array-like, BitGenerator, np.random.RandomState, np.random.Generator, optional) – If int, array-like, or BitGenerator, seed for random number generator. If np.random.RandomState or np.random.Generator, use as given.

  • unit (str, default='m') – The reference unit for generated layer thicknesses. Default is meters

Returns:

self – Instanced object for chaining method.

Return type:

Instanced object

class watex.geology.drilling.DSBoreholes(area=None, holeid=None, lat=None, lon=None, projection='ll', utm_zone=None, datum='WGS84', epsg=None, encoding='utf-8', interp_coords=False, reference_ellipsoide=23, verbose=False)[source]#

Bases: object

Class deals with many boreholes dataset.

DSBoreholes works with the data set composed of multiple borehole data. The data columns are the all attributes of the object and any non-alphateic character is replaced by _. For instance, a column name layer thickness should have an attribute named layer_thickness. Each borehole (row) data become its own object which encompasses all columns as attributes. To have full control of how data must be retrieved, holeid parameter must be set. For instance, to retrieve the borehole with ID equals to bx02, after fitting the class with appropriate parameters, attibute hole depth ( if exist in the data) can be retrieved as self.hole.bx02.hole_depth.

By default if the projection is given as latitude/longitude

Parameters:
  • area (str) – Name of area where the data collection is made.

  • holeid (str, optional) – The name of column of the boreholes collections ID. Note that if given, it should exist in the borehole datasets.

  • lon (ArrayLike 1d /str , optional) – One dimensional arrays. xlon can be consider as the abscissa of the landmark and ylat as ordinates array. If xlon or ylat is passed as string argument, data must be passed as fit_params keyword arguments and the name of xlon and y must be a column name of the data. By default xlon and ylat are considered as longitude and latitude when dms or ll coordinate system is passed.

  • lat (ArrayLike 1d /str , optional) – One dimensional arrays. xlon can be consider as the abscissa of the landmark and ylat as ordinates array. If xlon or ylat is passed as string argument, data must be passed as fit_params keyword arguments and the name of xlon and y must be a column name of the data. By default xlon and ylat are considered as longitude and latitude when dms or ll coordinate system is passed.

  • utm_zone (Optional, string) – zone number and ‘S’ or ‘N’ e.g. ‘55S’. Default to the centre point of coordinates points in the survey area. It should be a string (##N or ##S) in the form of number and North or South hemisphere, 10S or 03N

  • projection (str, ['utm'|'dms'|'ll']) – The coordinate system in which the data points for the profile is collected. If not given, the auto-detection will be triggered and find the suitable coordinate system. However, it is recommended to provide it for consistency. Note that if x and y are composed of value less than 180 degrees for longitude and 90 degrees for latitude, it should be considered as longitude-latitude (ll) coordinates system. If x and y are degree-minutes-second (dms or dd:mm:ss) data, they must be specify as coordinate system in order to accept the non-numerical data before transforming to ll. If data is passed to the fit() method and dms is not specify, x and y values should be discarded.

  • datum (string, default = 'WGS84') – well known datum ex. WGS84, NAD27, NAD83, etc.

  • epsg (Optional, int) –

    epsg number defining projection (

    see http://spatialreference.org/ref/ for moreinfo)

    Overrides utm_zone if both are provided.

  • encoding (str, default ='utf8') – Default encoding for parsing data. Can also be [‘utf-16-be’] for reading bytes characters.

  • interp_coords (bool, default=False) – Interpolate position coordinates.

  • reference_ellipsoid (int, default=23) – reference ellipsoids is derived from Peter H. Dana’s website- http://www.utexas.edu/depts/grg/gcraft/notes/datum/elist.html Department of Geography, University of Texas at Austin Internet: pdana@mail.utexas.edu . Default is 23 constrained to WGS84.

  • verbose (int, default=0) – Output messages.

lon_, lat_

longitude/latitude of coordinates arrays.

Type:

Arraylike,

`hole.<holeid>.<data_column>`

Each borehole, commonly which ID correspond to each row. Each row can be fetched as ‘holeID’. If holeid is nt specified, the string literal hole+index of data composed the borehole object.

Type:

Boxspace

Notes

When data is supplied and lon and lat are given by their names existing in the dataframe columns, by default, the non-numerical data are removed. However, if y and x are given in DD:MM:SS in the dataframe, the coordinate system must explicitly set to ``dms` to keep the non-numerical values in the data.

fit(data, **fit_params)[source]#

Fit Hole data set and populate attributes.

Parameters:
  • data (Path-like Object or DataFrame) – Hole data.

  • fit_params (dict,) – Keyword arguments passed to watex.to_numeric_dtypes() to sanitize the data.

Returns:

self – Instanced object for chaining methods.

Return type:

DSBoreholes

property inspect#

Inspect object whether is fitted or not

set_coordinates(reflong, reflat, step='5m', todms=False, r=45, **kws)[source]#

Generate longitude and latitude coordinates for boreholes.

It assumes boreholes are aligned along the same axis.

Parameters:
  • reflong (float or string or list of [start, stop]) – Reference longitude in degree decimal or in DD:MM:SS for the first site considered as the origin of the landmark.

  • reflat (float or string or list of [start, stop]) – Reference latitude in degree decimal or in DD:MM:SS for the reference site considered as the landmark origin. If value is given in a list, it can containt the start point and the stop point.

  • step (float or str) – Offset or the distance of seperation between different sites in meters. If the value is given as string type, except the km, it should be considered as a m value. Only meters and kilometers are accepables.

  • r (float or int) – The rotate angle in degrees. Rotate the angle features toward the direction of the projection profile. Default value use the bearing() value in degrees.

  • todms (bool, Default=False) – Reconvert the longitude/latitude degree decimal values into the DD:MM:SS.

  • kws (dict,) – Additional keywords of makeCoords().

Returns:

self – Instanced object for method chaining.

Return type:

Instanced object

class watex.geology.drilling.Drill(well_filename=None, auto=True, **kwargs)[source]#

Bases: Geology

This class is focus on well logs . How to generate well Log for Oasis:

Parameters:
  • **well_filename** (string ,) – The well filename. 02 options is set : 1rst option is to build well data manually and the program will generate a report. 2nd option is to send to the program a typical file type to be parsed . the programm parses only the typical well datafile. If None , the program will redirect to build mannually option .

  • **auto** (bool) –

    option to automatically well data . set to True

    if you want to build manually a well data .

    default is False

  • ========================================= (==================== ==========) –

  • Description (Key Words/Attributes Type) –

  • =========================================

  • S. (utm_zone str utm WGS84 zone. should be N or) – default is 49N .

  • provided. (compute_azimuth bool if no azimuth is) – set to True to letprogram to compute azimuth .*Default* is False.

  • 90 (Drill_dip float The dip of drill hole.*default* is) –

  • drill (Drill_buttom float The average bottom of) – can be filled during the well buiding . default is None

:paramcan be filled during the well

buiding . default is None

Parameters:
  • data. (mask int the mask of DrillHole(DH)) – *Default * is 1.

  • ========================================= (==================== ==========) –

  • ======================================================= (==================) –

  • Description (Methods) –

  • =======================================================

  • dataframe (_collar build _collar data return collar log) – format dhGeology build DH log geology return geology log dataframe.

  • sample (dhSample build DH Geochemistry-Strutural) – log dataframe

  • Sample (*return*) – log dataframe

  • Elevation (dhSurveyElevAz build DH Elevation & Azimuth logs.*return *) – & Azimuth dataframes

  • log (writeDHDATA output) – Oasis Montaj

  • =======================================================

:param : :type : Example: :param >>> from watex.geoloy.drilling import Drill: :param >>> parser_file =’nbleDH.csv’: :param >>> drill_obj=Drill(well_filename=’data/drill/drill_example_files’): :param >>> scollar=drill._collar(DH_Top=None): :param >>> sgeo=drill.dhGeology(): :param >>> ssam=drill.dhSample(): :param >>> selevaz=drill.dhSurveyElevAz( add_elevation=None: :param : :param … add_azimuth=None): :param >>> swrite=drill.writeDHData(data2write =”*”: :param savepath =None):

dhGeology(dh_geomask=None)[source]#

Method to build geology drillhole log. The name of input rock must feell exaction accordinag to a convention AGSO file . If not sure for the name of rock and Description and label. You may consult the geocode folder before building the well_filename. If the entirely rock name is given , program will search on the AGSO file the corresponding Label and code . If the rock name is founc then it will take its CODE else it will generate exception.

Parameters:

dh_geomask (*) – geology mask. send mask value can take exactly the np.ndarray(num_of_geology set ,). The better way to set geology maskis to fill on the wellfilename. if not , programm will take the general mask value. The default is None.

Returns:

geology drillhole log.

Return type:

pd.DataFrame

dhSample(path_to_agso_codefile=None, dh_sampmask=None)[source]#

Method to build Sample log. This method focuses on the sample obtained during the DH trip.it may georeferenced as the well_filename needed. A main thing is to set the AGSO_STCODES file. AGSO_STCODES is the conventional code of structurals sample. If you have an own AGSO_STCODES , you may provide the path * kwargs=path_to_ags_codefile * . the program will read and generate logs according to the DESCRIPTION and STCODES figured. if None, the program will take it STCODES and set the samplelogs. When you set the Sample code aor sample name , make sur that the name match the same name on STCODES. If not , program will raises an error.

Parameters:
  • path_to_agso_codefile (*) – path to conventional AGSO_STRUCTURAL CODES. The default is None.

  • dh_sampmask (*) – Structural mask. The default is None.

Returns:

Sample DH log.

Return type:

pd.DataFrame

dhSurveyElevAz(add_elevation=None, add_azimuth=None, **kwargs)[source]#

Method to build Elevation & Azimuth DH logs. if add_elevation and . add_azimuth are set . The programm will ignore the computated azimuth, and it will replace to the new azimuth provided . all elevation will be ignore and set by the new elevation . *kwargs arguments {add_elevation , add-azimuth } must match the same size like the number of Drillholes . Each one must be on ndarray(num_of_holes, 1).

Parameters:
  • add_elevation (*) – elevation data (num_of_holes, 1) The default is None.

  • add_azimuth (*) – azimuth data (num_of_holes,1). The default is None.

  • DH_RL (*) – if not provided , it’s set to 0. means No topography is added’.

Returns:

  • pd.Dataframe – Elevation DH log .

  • pd.DataFrame – Azimuth DH log.

writeDHData(data2write=None, **kwargs)[source]#

Method to write allDH logs. It depends to the users to sort which data want to export and which format. the program support only two format (.xlsx and .csv) if one is set , it will ouptput the convenience format. Users can give a list of the name of log he want to export. Program is dynamic and flexible. It tolerates quite symbols number to

extract data logs.

Parameters:
  • data2write (*) – the search key. The default is None.

  • datafn (*) – savepath to exported file Default is current work directory.

  • write_index_on_sheet (*) – choice to write the sheet with pandas.Dataframe index.

  • writeType (*) – file type . its may .csv or *.xlsx . *Default is *.xlsx

  • add_header (*) – add head on exported sheet. set False to mask heads. Default is True.

  • csv_separateType (*) – Indicated for csv exported files , the type of comma delimited . defaut is ‘,’.