diff --git a/wetb/hawc2/Hawc2io.py b/wetb/hawc2/Hawc2io.py index 2cb9ddf52c4df0301481e04b8b11b20033a7fbc5..e1cb85ad2563b3ef44209ec98c0265bcd8e730bb 100644 --- a/wetb/hawc2/Hawc2io.py +++ b/wetb/hawc2/Hawc2io.py @@ -159,7 +159,7 @@ class ReadHawc2(object): self._ReadSensorFile() elif FileName.lower().endswith('.hdf5') or os.path.isfile(self.FileName + ".hdf5"): self.FileFormat = 'GTSDF' - self.ReadAll() + self.ReadGtsdf() else: print ("unknown file: " + FileName) ################################################################################ @@ -197,14 +197,15 @@ class ReadHawc2(object): def ReadGtsdf(self): self.t, data, info = gtsdf.load(self.FileName + '.hdf5') self.Time = self.t - self.ChInfo = [info['attribute_names'], - info['attribute_units'], - info['attribute_descriptions']] - self.NrCh = data.shape[1] + self.ChInfo = [['Time'] + info['attribute_names'], + ['s'] + info['attribute_units'], + ['Time'] + info['attribute_descriptions']] + self.NrCh = data.shape[1] + 1 self.NrSc = data.shape[0] self.Freq = self.NrSc / self.Time self.FileFormat = 'GTSDF' self.gtsdf_description = info['description'] + data = np.hstack([self.Time[:,np.newaxis], data]) return data ################################################################################ # One stop call for reading all data formats diff --git a/wetb/hawc2/htc_contents.py b/wetb/hawc2/htc_contents.py index 45967be5480f1792a7710e9057d48fa1c5449dae..9135ed91b8c70db9bb2e6b5cd9cb048f304ad852 100644 --- a/wetb/hawc2/htc_contents.py +++ b/wetb/hawc2/htc_contents.py @@ -131,7 +131,12 @@ class HTCContents(object): def add_section(self, name, allow_duplicate=False): if name in self and allow_duplicate is False: return self[name] - section = HTCSection(name) + if name == "output": + section = HTCOutputSection(name) + elif name.startswith("output_at_time"): + section = HTCOutputAtTimeSection(name) + else: + section = HTCSection(name) self._add_contents(section) return section