mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-02-19 11:48:39 +01:00
changed RoMode to be consistent with slsdet
This commit is contained in:
@@ -5,7 +5,7 @@ from . import _aare
|
||||
|
||||
from ._aare import File, RawMasterFile, RawSubFile, JungfrauDataFile
|
||||
from ._aare import Pedestal_d, Pedestal_f, ClusterFinder_Cluster3x3i, VarClusterFinder
|
||||
from ._aare import DetectorType, ReadingMode
|
||||
from ._aare import DetectorType, ReadoutMode
|
||||
from ._aare import hitmap
|
||||
from ._aare import ROI
|
||||
from ._aare import corner
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
import numpy as np
|
||||
from . import _aare
|
||||
from aare import ReadingMode
|
||||
from aare import ReadoutMode
|
||||
|
||||
class AdcSar04Transform64to16:
|
||||
def __call__(self, data):
|
||||
@@ -71,15 +71,15 @@ class Matterhorn10Transform:
|
||||
self.dynamic_range = dynamic_range
|
||||
self.num_counters = num_counters
|
||||
|
||||
def compatibility(self, readingmode : ReadingMode):
|
||||
def compatibility(self, readingmode : ReadoutMode):
|
||||
"""
|
||||
checks if Matterhorn10Transform is compatible with given parameters
|
||||
|
||||
:param readingmode: Reading mode set
|
||||
:type readingmode: ReadingMode
|
||||
:type readingmode: ReadoutMode
|
||||
:raises ValueError: if not compatible
|
||||
"""
|
||||
if(readingmode != ReadingMode.Transceiver):
|
||||
if(readingmode != ReadoutMode.TRANSCEIVER_ONLY):
|
||||
raise ValueError(f"Incompatible Transformation. Matterhorn10Transform only requires transceiver samples. However reading mode is {readingmode}.")
|
||||
|
||||
pass
|
||||
|
||||
@@ -24,13 +24,13 @@ using namespace ::aare;
|
||||
|
||||
void define_raw_master_file_bindings(py::module &m) {
|
||||
|
||||
py::enum_<ReadingMode>(m, "ReadingMode")
|
||||
.value("Analog", ReadingMode::Analog)
|
||||
.value("Digital", ReadingMode::Digital)
|
||||
.value("AnalogAndDigital", ReadingMode::AnalogAndDigital)
|
||||
.value("Transceiver", ReadingMode::Transceiver)
|
||||
.value("DigitalAndTransceiver", ReadingMode::DigitalAndTransceiver)
|
||||
.value("Unknown", ReadingMode::Unknown)
|
||||
py::enum_<ReadoutMode>(m, "ReadoutMode")
|
||||
.value("ANALOG_ONLY", ReadoutMode::ANALOG_ONLY)
|
||||
.value("DIGITAL_ONLY", ReadoutMode::DIGITAL_ONLY)
|
||||
.value("ANALOG_AND_DIGITAL", ReadoutMode::ANALOG_AND_DIGITAL)
|
||||
.value("TRANSCEIVER_ONLY", ReadoutMode::TRANSCEIVER_ONLY)
|
||||
.value("DIGITAL_AND_TRANSCEIVER", ReadoutMode::DIGITAL_AND_TRANSCEIVER)
|
||||
.value("UNKNOWN", ReadoutMode::UNKNOWN)
|
||||
.export_values();
|
||||
|
||||
py::class_<RawMasterFile>(m, "RawMasterFile")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
import pytest
|
||||
from aare import RawMasterFile, ReadingMode, DetectorType
|
||||
from aare import RawMasterFile, ReadoutMode, DetectorType
|
||||
|
||||
|
||||
@pytest.mark.withdata
|
||||
@@ -10,5 +10,5 @@ def test_read_rawfile_quad_eiger_and_compare_to_numpy(test_data_path):
|
||||
file_name = test_data_path/'raw/jungfrau/jungfrau_single_master_0.json'
|
||||
|
||||
f = RawMasterFile(file_name)
|
||||
assert(f.reading_mode == ReadingMode.Unknown)
|
||||
assert(f.reading_mode == ReadoutMode.UNKNOWN)
|
||||
assert(f.detector_type == DetectorType.Jungfrau)
|
||||
Reference in New Issue
Block a user