Skip to content
Snippets Groups Projects
Commit db1193e7 authored by Alán Muñoz's avatar Alán Muñoz
Browse files

fix signals

Former-commit-id: 1350a0a00f92c081caeecc264a1be046c470e83f
parent 821718e4
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ class BridgeH5: ...@@ -13,6 +13,7 @@ class BridgeH5:
""" """
def __init__(self, file): def __init__(self, file):
self.filename = file
self._hdf = h5py.File(file, "r") self._hdf = h5py.File(file, "r")
self._filecheck() self._filecheck()
......
...@@ -10,12 +10,16 @@ class Signal(BridgeH5): ...@@ -10,12 +10,16 @@ class Signal(BridgeH5):
def __init__(self, file): def __init__(self, file):
super().__init__(file) super().__init__(file)
self._hdf.close() # Close the file to use pandas hdf functions
# hdf = pd.HDFStore(file)
# self.file = file
def __getitem__(self, dataset): def __getitem__(self, dataset):
return pd.read_hdf(self.file, dataset) dset = self._hdf[dataset]
index = pd.MultiIndex.from_arrays(
[dset[lbl][()] for lbl in dset.keys() if "axis1_label" in lbl]
)
columns = dset["axis0"][()]
return pd.DataFrame(dset[("block0_values")][()], index=index, columns=columns)
@staticmethod @staticmethod
def _if_ext_or_post(name): def _if_ext_or_post(name):
......
...@@ -10,7 +10,7 @@ from postprocessor.core.io.signal import Signal ...@@ -10,7 +10,7 @@ from postprocessor.core.io.signal import Signal
from core.cells import Cells from core.cells import Cells
class PostProParameters(ParametersABC): class PostProcessorParameters(ParametersABC):
""" """
Anthology of parameters used for postprocessing Anthology of parameters used for postprocessing
:merger: :merger:
......
from postprocessor.core.processor import PostProcessor, PostProcessorParameters
params = PostProcessorParameters.default()
pp = PostProcessor(
"/shared_libs/pipeline-core/scripts/data/ph_calibration_dual_phl_ura8_5_04_5_83_7_69_7_13_6_59__01/ph_5_04_005store.h5",
params,
)
tmp = pp.run()
from postprocessor.core.io.signals import Signal from postprocessor.core.io.signal import Signal
signal = Signal( signal = Signal(
"/shared_libs/pipeline-core/scripts/data/ph_calibration_dual_phl_ura8_5_04_5_83_7_69_7_13_6_59__01/ph_5_04_001store.h5" "/shared_libs/pipeline-core/scripts/data/ph_calibration_dual_phl_ura8_5_04_5_83_7_69_7_13_6_59__01/ph_5_04_001store.h5"
......
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