photon_mosaic.core.imaging_tools#
Utilities for extracting and validating imaging attributes.
Functions
|
Validate that an imaging object matches stored attributes. |
|
Extract key attributes from a BaseImaging object for serialization. |
- photon_mosaic.core.imaging_tools.get_imaging_attributes(imaging)[source]#
Extract key attributes from a BaseImaging object for serialization.
- Parameters:
imaging (
BaseImaging) – The imaging object to extract attributes from.- Returns:
Dictionary with keys: sampling_frequency, shape, num_epochs, num_samples, dtype.
- Return type:
dict
- photon_mosaic.core.imaging_tools.do_imaging_attributes_match(imaging, attributes, check_dtype=True)[source]#
Validate that an imaging object matches stored attributes.
- Parameters:
imaging (
BaseImaging) – The imaging object to validate.attributes (
dict) – The stored attributes to compare against.check_dtype (
bool) – Whether to also check that the dtype matches.
- Returns:
A tuple of (matches, error_message). If matches is True, error_message is empty.
- Return type:
tuple[bool,str]