Skip to content

ketek

borealis.detector.ketek

Created on Sat Jan 8 12:54:49 2022.

@author: A. Vancraeyenest

KetekAXASM(ini_filepath, alias='Ketek-AXAS M')

Bases: Detector

Class to operate KETEK detector AXAS-M.

Initialise the detector.

Source code in borealis/detector/ketek.py
29
30
31
32
33
34
35
36
37
38
39
40
41
def __init__(self, ini_filepath: str, alias: str = "Ketek-AXAS M"):
    """Initialise the detector."""
    super().__init__(alias)
    self._ini_file = self._validate_ini(ini_filepath)
    self._chan_no = 0
    self._initialise(self._ini_file)
    self._start_system()
    self.serial_number = self._get_serial_number()

    # TODO get from detector
    self.mca_size = 4096

    LOGGER.info("Detector %s successfully initialised", self)

acquisition(acquisition_time)

Start an acquisition and return corresponding Spectrum object.

Source code in borealis/detector/ketek.py
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def acquisition(self, acquisition_time: float) -> MCA:
    """Start an acquisition and return corresponding Spectrum object."""
    self._start_run()
    sleep(acquisition_time)
    self._stop_run()

    data = MCA(self.mca_size)
    data.mca = self._get_spectrum()

    run_stat = self._get_all_run_stats()
    data.runtime = run_stat['runtime']
    data.icr = run_stat['ICR']
    data.ocr = run_stat['OCR']

    return data

stop()

Close the connection to the detector and free resources.

Wrap xiaExit. Disconnect from the hardware and clean up Handel’s internals.

Source code in borealis/detector/ketek.py
64
65
66
67
68
69
70
71
72
73
def stop(self):
    """
    Close the connection to the detector and free resources.

    Wrap xiaExit.
    Disconnect from the hardware and clean up Handel’s internals.

    """
    ret_code = self.HANDEL.xiaExit()
    check_error(ret_code)