Skip to content
Snippets Groups Projects
Commit 1927dab8 authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

fixed that some stfiles does not start with int specifying the number of sets

parent 37a8a825
No related branches found
No related tags found
No related merge requests found
Pipeline #
from ._io import load, read_sensor_info from ._io import load, read_sensor_info
from wetb import gtsdf from wetb import gtsdf
import numpy as np
class Dataset(gtsdf.Dataset): class Dataset(gtsdf.Dataset):
def __init__(self, filename): def __init__(self, filename, name_stop=8,dtype=np.float):
self.time, self.data, self.info = load(filename) self.time, self.data, self.info = load(filename, name_stop,dtype)
\ No newline at end of file \ No newline at end of file
...@@ -68,7 +68,8 @@ class StFile(object): ...@@ -68,7 +68,8 @@ class StFile(object):
def __init__(self, filename): def __init__(self, filename):
with open (filename) as fid: with open (filename) as fid:
txt = fid.read() txt = fid.read()
no_maindata_sets = int(txt.replace("#","").strip()[0]) # Some files sat
no_maindata_sets = int(txt.strip()[0])
assert no_maindata_sets == txt.count("#") assert no_maindata_sets == txt.count("#")
self.main_data_sets = {} self.main_data_sets = {}
for mset in txt.split("#")[1:]: for mset in txt.split("#")[1:]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment