Beispiel #1
0
def test_from_dict():
    """
    Test gen from dictionary.
    """
    striplog = Striplog.from_dict(top_dict)
    assert len(striplog) == 7
    assert striplog.thinnest().summary() == '0.00 m of Cody'
Beispiel #2
0
    def add_striplog(self, data: pd.DataFrame):
        unique_borehole = np.unique(data.index)
        self.add_wells(unique_borehole)
        for b in unique_borehole:
            w = self.p.get_well(b)
            data_dict = data.loc[b].to_dict('list')
            s = Striplog.from_dict(data_dict, points=True)

            start, stop, step_size = self._calculate_basis_parameters(w, w.location.md.shape[0])
            s_log, basis, table = s.to_log(step_size, start, stop, return_meta=True)

            w.data['lith'] = s
            w.data['lith_log'] = Curve(s_log, basis)

        return self.p
def test_striplog_2():
    data = pd.read_excel(data_path.joinpath('borehole_lith.xlsx'))
    well_name_column = 'SITE_ID'
    well_names = data[well_name_column].unique()
    foo = data.groupby(well_name_column).get_group(well_names[0])
    data_dict = foo.to_dict('list')

    s = Striplog.from_dict(data_dict,
                           remap={
                               'DEPTH_FROM': 'top',
                               'DEPTH_TO': 'base',
                               'LITHOLOGY': 'component lith',
                               'SITE_ID': 'description'
                           })

    s.plot()
    plt.show()
    print(s)