def add_wells(self, well_names: Iterable): new_boreholes = self._well_names.symmetric_difference(well_names) self._well_names = self._well_names.union(well_names) for b in new_boreholes: # TODO: Name and uwi should be different w = Well(params={'header': {'name': b, 'uwi': b}}) w.location = Location(params={'kb': 100}) self.p += w return self.p
def test_deviation_to_position_conversion(): """ Test that we can convert a deviation survey – a N x 3 array with columns MD, INC, and AZI and compute position (a.k.a path) – a N x 3 arry with columns X, Y, Z relative to the KB location. Tests the minimum curvature method only. """ tolerance = 0.1 # absolute distance in metres we'll allow to be off. location = {'x': 382769.09, 'y': 4994021.65, 'kb': 94.8} well = Well({'location': Location(params=location)}) survey = np.loadtxt(DNAME2, skiprows=2, delimiter=',') dev_surv = survey[:, 2:5] # MD, Incl, Azim columns in test file posx, posy, posz = survey[:, 8], survey[:, 7], survey[:, 5] # E/W, N/S, Z well.location.add_deviation(dev_surv) assert well.location.position.shape == (83, 3) assert well.location.position.shape == (83, 3) assert (np.allclose(posx, well.location.position[:, 0], atol=0.1)) assert (np.allclose(posy, well.location.position[:, 1], atol=0.1))
def __init__(self, well_name: str = None): """ Class that wraps `welly` to read borehole data - las files and deviations, csv, excel - and converts it into a `subsurface.UnstructuredData` This class is only meant to be extended with all the necessary functionality to load borehole data. For extensive manipulations of the data it should be done in `welly` itself. We need a class because it is going to be quite difficult to make one single function that fits all A borehole has: - Datum (XYZ location) - Deviation - Lithology: For this we are going to need striplog - Logs Everything would be a LineSet with a bunch of properties Parameters ---------- well_name (Optional[str]): Name of the borehole Notes ----- TODO: I think welly can initialize a Well from a file. That would be something to consider later on """ # Init empty Project self.p = Project([]) self._well_names = set() # Init empty well self.well = Well(params={'header': {'name': well_name}}) self.well.location = Location(params={'kb': 100})