def add_canstrat_striplogs(self, path, uwi_transform=None, name='canstrat'): """ This may be too specific a method... just move it to the workflow. Requires striplog. """ from striplog import Striplog uwi_transform = uwi_transform or utils.null for w in self.__list: try: dat_file = utils.find_file(str(uwi_transform(w.uwi)), path) except: print("- Skipping {}: something went wrong".format(w.uwi)) continue if dat_file is None: print("- Omitting {}: no data".format(w.uwi)) continue # If we got here, we're using it. print("+ Adding {} from {}".format(w.uwi, dat_file)) w.data[name] = Striplog.from_canstrat(dat_file) return
def add_canstrat_striplogs(self, path, name='canstrat'): """ This may be to specific a method... just move it to the workflow. Requires striplog. """ from striplog import Striplog for w in self.__list: dat_file = utils.find_file(w.uwi, path) if dat_file is None: print("- Omitting {}: no data".format(w.uwi)) continue # If we got here, we're using it. print("+ Adding {}".format(w.uwi)) w.data[name] = Striplog.from_canstrat(dat_file) return
def test_canstrat(): """Read a file. """ s = Striplog.from_canstrat('tests/data/test_canstrat.dat') assert len(s) == 28 assert abs(s[3].data['grains_mm'] - 0.0012) < 0.0000001