mantidimaging.core.io.instrument_log module#

class mantidimaging.core.io.instrument_log.InstrumentLog(lines: list[str], source_file: Path)[source]#

Bases: object

Multiformat instrument log reader

New parsers can be implemented by subclassing InstrumentLogParser

counts() Counts[source]#
data: dict[LogColumn, list[float | int]]#
get_column(key: LogColumn) list[float][source]#
has_projection_angles() bool[source]#
length: int#
parse() None[source]#
parser: type[InstrumentLogParser]#
parsers: ClassVar[list[type[InstrumentLogParser]]] = [<class 'mantidimaging.core.io.instrument_log_implmentations.LegacySpectraLogParser'>, <class 'mantidimaging.core.io.instrument_log_implmentations.LegacyIMATLogFile'>]#
projection_angles() ProjectionAngles[source]#
projection_numbers() ndarray[source]#
raise_if_angle_missing(image_filenames: list[str]) None[source]#
classmethod register_parser(parser: type[InstrumentLogParser]) None[source]#
class mantidimaging.core.io.instrument_log.InstrumentLogParser(lines: list[str])[source]#

Bases: ABC

Base class for parsers

cleaned_lines() list[str][source]#
abstract classmethod match(lines: list[str], filename: str) bool[source]#

Check if the name and content of the file is likely to be readable by this parser.

abstract parse() dict[LogColumn, list[float | int]][source]#

Parse the log file

exception mantidimaging.core.io.instrument_log.InvalidLog[source]#

Bases: RuntimeError

class mantidimaging.core.io.instrument_log.LogColumn(value)[source]#

Bases: Enum

An enumeration.

COUNTS_AFTER = 6#
COUNTS_BEFORE = 5#
IMAGE_TYPE_IMAGE_COUNTER = 2#
PROJECTION_ANGLE = 4#
PROJECTION_NUMBER = 3#
SPECTRUM_COUNTS = 8#
TIMESTAMP = 1#
TIME_OF_FLIGHT = 7#
exception mantidimaging.core.io.instrument_log.NoParserFound[source]#

Bases: RuntimeError