Skip to content
Snippets Groups Projects
Commit 811d3a63 authored by tlbl's avatar tlbl
Browse files

some fixes to pass tests :)

parent 09934feb
No related branches found
No related tags found
1 merge request!4Integration of HAWCio into Windio and further fatigue tools marging
......@@ -90,8 +90,8 @@ class ReadHawc2(object):
Name = []; Unit = []; Description = [];
for i in range(0, self.NrCh):
temp = str(Lines[i + 12][12:43]); Name.append(temp.strip())
temp = str(Lines[i + 12][43:48]); Unit.append(temp.strip())
temp = str(Lines[i + 12][49:]); Description.append(temp.strip())
temp = str(Lines[i + 12][43:54]); Unit.append(temp.strip())
temp = str(Lines[i + 12][54:-1]); Description.append(temp.strip())
self.ChInfo = [Name, Unit, Description]
# if binary file format, scaling factors are read
if Format.lower() == 'binary':
......
......@@ -129,13 +129,26 @@ class LoadResults(ReadHawc2):
ReadOnly = 0 if readdata else 1
super(LoadResults, self).__init__(FileName, ReadOnly=ReadOnly)
self.FileType = self.FileFormat[6:]
self.N = int(self.NrSc)
self.Nch = int(self.NrCh)
self.ch_details = np.ndarray(shape=(self.Nch,3),dtype='<U100')
for ic in range(self.Nch):
self.ch_details[ic, 0] = self.ChInfo[0][ic]
self.ch_details[ic, 1] = self.ChInfo[1][ic]
self.ch_details[ic, 2] = self.ChInfo[2][ic]
ChVec = [] if usecols is None else usecols
self.sig = super(LoadResults, self).__call__(ChVec=ChVec)
self._unified_channel_names()
if readdata:
self.sig = super(LoadResults, self).__call__(ChVec=ChVec)
if self.debug:
stop = time() - start
print('time to load HAWC2 file:', stop, 's')
def reformat_sig_details(self):
"""Change HAWC2 output description of the channels short descriptive
strings, usable in plots
......
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