Do only clear projections when switching to new file

This commit is contained in:
2025-10-14 15:49:06 +02:00
parent 322c00ca54
commit 14ea89e243
4 changed files with 6 additions and 6 deletions

View File

@@ -41,7 +41,7 @@ class AmorHeader:
def __init__(self, fileName:Union[str, h5py.File, BinaryIO]):
if type(fileName) is str:
logging.debug(f' opening file {fileName}')
logging.info(f' opening file {fileName}')
self.hdf = h5py.File(fileName, 'r', swmr=True)
elif type(fileName) is h5py.File:
self.hdf = fileName

View File

@@ -230,7 +230,6 @@ class ESSSerializer:
def send(self, proj: Union[YZProjection, TofZProjection]):
if isinstance(proj, YZProjection):
if self._active_histogram_yz is None:
proj.clear()
return
suffix = 'YZ'
message = HistogramMessage(
@@ -263,7 +262,6 @@ class ESSSerializer:
self._last_message_yz = message
elif isinstance(proj, TofZProjection):
if self._active_histogram_tofz is None:
proj.clear()
return
suffix = 'TofZ'
message = HistogramMessage(

View File

@@ -18,7 +18,7 @@ def main():
# read command line arguments and generate classes holding configuration parameters
clas = commandLineArgs([ReaderConfig, ExperimentConfig, E2HReductionConfig],
'events2histogram')
'amor-nicos')
update_loglevel(clas.verbose)
reader_config = ReaderConfig.from_args(clas)
@@ -26,7 +26,7 @@ def main():
reduction_config = E2HReductionConfig.from_args(clas)
config = E2HConfig(reader_config, experiment_config, reduction_config)
logging.warning('######## events2histogram - data vizualization for Amor ########')
logging.warning('######## amor-nicos - Nicos histogram for Amor ########')
from eos.reduction_kafka import KafkaReduction
# only import heavy module if sufficient command line parameters were provided
@@ -36,7 +36,7 @@ def main():
# Perform actual reduction
reducer.reduce()
logging.info('######## events2histogram - finished ########')
logging.info('######## amor-nicos - finished ########')
if __name__ == '__main__':
main()

View File

@@ -82,6 +82,8 @@ class KafkaReduction:
logging.warning(f"Preceding to next file {latest}")
self.current_file = new_file
self.proj_yz.clear()
self.proj_tofz.clear()
self.read_data()
self.add_data()