spas package
Submodules
spas.acquisition module
spas.generate module
spas.metadata module
- class spas.metadata.AcquisitionParameters(pattern_compression: float, pattern_dimension_x: int, pattern_dimension_y: int, pattern_amount: int | None = None, acquired_spectra: int | None = None, mean_callback_acquisition_time_ms: float | None = None, total_callback_acquisition_time_s: float | None = None, mean_spectrometer_acquisition_time_ms: float | None = None, total_spectrometer_acquisition_time_s: float | None = None, saturation_detected: bool | None = None, patterns: List[int] | str | None = None, patterns_wp: List[int] | str | None = None, wavelengths: numpy.ndarray | str | None = None, timestamps: List[float] | str | None = None, measurement_time: List[float] | str | None = None, class_description: str = 'Acquisition parameters')[source]
Bases:
objectClass containing acquisition specifications and timing results.
This class is adapted to be reconstructed from a JSON file.
- Attributes:
- pattern_compression (float):
Percentage of total available patterns to be present in an acquisition sequence.
- pattern_dimension_x (int):
Length of reconstructed image that defines pattern length.
- pattern_dimension_y (int):
Width of reconstructed image that defines pattern width.
- pattern_amount (int, optional):
Quantity of patterns sent to DMD for an acquisition. This value is calculated by an external function. Default in None.
- acquired_spectra (int, optional):
Amount of spectra actually read from the spectrometer. This value is calculated by an external function. Default in None.
- mean_callback_acquisition_time_ms (float, optional):
Mean time between 2 callback executions during an acquisition. This value is calculated by an external function. Default in None.
- total_callback_acquisition_time_s (float, optional):
Total time of callback executions during an acquisition. This value is calculated by an external function. Default in None.
- mean_spectrometer_acquisition_time_ms (float, optional):
Mean time between 2 spectrometer measurements during an acquisition based on its own internal clock. This value is calculated by an external function. Default in None.
- total_spectrometer_acquisition_time_s (float, optional):
Total time of spectrometer measurements during an acquisition based on its own internal clock. This value is calculated by an external function. Default in None.
- saturation_detected (bool, optional):
Boolean incating if saturation was detected during acquisition. Default is None.
- patterns (Union[List[int],str], optional) = None
List int or str containing all patterns sent to the DMD for an acquisition sequence. This value is set by an external function and its type can be modified by multiple functions during object creation, manipulation, when dumping to a JSON file or when reconstructing an AcquisitionParameters object from a JSON file. It is intended to be of type List[int] most of the execution List[int]time. Default is None.
- wavelengths (Union[np.ndarray, str], optional):
Array of float type corresponding to the wavelengths associated with spectrometer’s start and stop pixels.
- timestamps (Union[List[float], str], optional):
List of float type elapsed time between each measurement made by the spectrometer based on its internal clock. Units in milliseconds. Default is None.
- measurement_time (Union[List[float], str], optional):
List of float type elapsed times between each callback. Units in milliseconds. Default is None.
- class_description (str):
Class description used to improve redability when dumped to JSON file. Default is ‘Acquisition parameters’.
- acquired_spectra: int | None = None
- class_description: str = 'Acquisition parameters'
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
- mean_callback_acquisition_time_ms: float | None = None
- mean_spectrometer_acquisition_time_ms: float | None = None
- measurement_time: List[float] | str | None = None
- pattern_amount: int | None = None
- pattern_compression: float
- pattern_dimension_x: int
- pattern_dimension_y: int
- patterns: List[int] | str | None = None
- patterns_wp: List[int] | str | None = None
- static readable_pattern_order(acquisition_params_dict: dict) dict[source]
Turns list of patterns into a string.
Turns the list of pattern attributes from an AcquisitionParameters object (turned into a dictionary) into a string that will improve readability once all metadata is dumped into a JSON file. This function must be called before dumping.
- Args:
acquisition_params_dict (dict): Dictionary obtained from converting an AcquisitionParameters object.
- Returns:
[dict]: Modified dictionary with acquisition parameters metadata.
- saturation_detected: bool | None = None
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
- timestamps: List[float] | str | None = None
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
- total_callback_acquisition_time_s: float | None = None
- total_spectrometer_acquisition_time_s: float | None = None
- undo_readable_pattern_order() None[source]
Changes the patterns attribute from str to List of int.
When reconstructing an AcquisitionParameters object from a JSON file, this method turns the patterns, wavelengths, timestamps and measurement_time attributes from a string to a list of integers containing the pattern indices used in that acquisition.
- update_timings(timestamps: numpy.ndarray, measurement_time: numpy.ndarray)[source]
Updates acquisition timings.
- Args:
- timestamps (ndarray):
Array of float type elapsed time between each measurement made by the spectrometer based on its internal clock. Units in milliseconds.
- measurement_time (ndarray):
Array of float type elapsed times between each callback. Units in milliseconds.
- wavelengths: numpy.ndarray | str | None = None
- class spas.metadata.CAM(**kwargs)[source]
Bases:
objectClass containing IDS camera configurations.
Further information: https://en.ids-imaging.com/manuals/ids-software-suite/ueye-manual/4.95/en/c_programmierung.html.
- Attributes:
- hCam (ueye.c_uint):
Handle of the camera.
- sInfo (ueye.SENSORINFO):
- sensor information[SensorID [c_ushort] = 566;
strSensorName [c_char_Array_32] = b’UI388xCP-M’; nColorMode [c_char] = b’’; nMaxWidth [c_uint] = 3088; nMaxHeight [c_uint] = 2076; bMasterGain [c_int] = 1; bRGain [c_int] = 0; bGGain [c_int] = 0; bBGain [c_int] = 0; bGlobShutter [c_int] = 0; wPixelSize [c_ushort] = 240; nUpperLeftBayerPixel [c_char] = b’'; Reserved].
- cInfo (ueye.BOARDINFO):
- Camera information: [SerNo [c_char_Array_12] = b’4103219888’;
ID [c_char_Array_20] = b’IDS GmbH’; Version [c_char_Array_10] = b’’; Date [c_char_Array_12] = b’30.11.2017’; Select [c_ubyte] = 1; Type [c_ubyte] = 100; Reserved [c_char_Array_8] = b’’;]
- nBitsPerPixel (ueye.c_int):
number of bits per pixel (8 for monochrome, 24 for color).
- m_nColorMode (ueye.c_int):
color mode : Y8/RGB16/RGB24/REG32.
- bytes_per_pixel (int):
bytes_per_pixel = int(nBitsPerPixel / 8).
- rectAOI (ueye.IS_RECT()):
- rectangle of the Area Of Interest (AOI): s32X [c_int] = 0;
s32Y [c_int] = 0; s32Width [c_int] = 3088; s32Height [c_int] = 2076;
- pcImageMemory (ueye.c_mem_p()):
memory allocation.
- MemID (ueye.int()):
memory identifier.
- pitch (ueye.INT()):
???.
- fps (float):
set frame per second.
- gain (int):
Set gain between [0 - 100].
- gainBoost (str):
Activate gain boosting (“ON”) or deactivate (“OFF”).
- gamma (float):
Set Gamma between [1 - 2.5] to change the image contrast
- exposureTime (float):
Set the exposure time between [0.032 - 56.221]
- blackLevel (int):
Set the black level between [0 - 255] to set an offset in the image.
- class_description: str = 'IDS camera configuration'
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
- class spas.metadata.DMDParameters(add_illumination_time_us: int, initial_memory: int, dark_phase_time_us: int | None = None, illumination_time_us: int | None = None, picture_time_us: int | None = None, synch_pulse_width_us: int | None = None, synch_pulse_delay: int | None = None, device_number: int | None = None, ALP_version: int | None = None, id: int | None = None, synch_polarity: str | None = None, trigger_edge: str | None = None, type: str | None = None, usb_connection: bool | None = None, ddc_fpga_temperature: float | None = None, apps_fpga_temperature: float | None = None, pcb_temperature: float | None = None, display_height: int | None = None, display_width: int | None = None, patterns: int | None = None, patterns_wp: int | None = None, unused_memory: int | None = None, bitplanes: int | None = None, DMD: dataclasses.InitVar[ALP4] = None, class_description: str = 'DMD parameters')[source]
Bases:
objectClass containing DMD configurations and status.
Further information: ALP-4.2 API Description (14/04/2020).
- Attributes:
- add_illumination_time_us (int):
Extra time in microseconds to account for the spectrometer’s “dead time”.
- initial_memory (int):
Initial memory available before sending patterns to DMD.
- dark_phase_time_us (int, optional):
Time in microseconds taken by the DMD mirrors to completely tilt. Minimum time for XGA type DMD is 44 us.
- illumination_time_us (int, optional):
Duration of the display of one pattern in a DMD sequence. Units in microseconds.
- picture_time_us (int, optional):
Time between the start of two consecutive pictures (i.e. this parameter defines the image display rate). Units in microseconds.
- synch_pulse_width_us (int, optional):
Duration of DMD’s frame synch output pulse. Units in microseconds.
- synch_pulse_delay (int, optional):
Time in microseconds between start of the frame synch output pulse and the start of the pattern display (in master mode).
- device_number (int, optional):
Serial number of the ALP device.
- ALP_version (int, optional):
Version number of the ALP device.
- id (int, optional):
ALP device identifier for a DMD provided by the API.
- synch_polarity (str, optional):
Frame synch output signal polarity: ‘High’ or ‘Low.’
- trigger_edge (str, optional):
Trigger input signal slope. Can be a ‘Falling’ or ‘Rising’ edge.
- type (str, optional):
Digital light processing (DLP) chip present in DMD.
- usb_connection (bool, optional):
True if USB connection is ok.
- ddc_fpga_temperature (float, optional):
Temperature of the DDC FPGA (IC4) at DMD connection. Units in °C.
- apps_fpga_temperature (float, optional):
Temperature of the Applications FPGA (IC3) at DMD connection. Units in °C.
- pcb_temperature (float, optional):
Internal temperature of the temperature sensor IC (IC2) at DMD connection. Units in °C.
- display_height (int, optional):
DMD display height in pixels.
- display_width (int, optional):
DMD display width in pixels.
- patterns (int, optional):
Number of patterns uploaded to DMD.
- unused_memory (int, optional):
Memory available after sending patterns to DMD.
- bitplanes (int, optional):
Bit depth of the patterns to be displayed. Values supported from 1 to 8.
- DMD (InitVar[ALP4.ALP4], optional):
Initialization DMD object. Can be used to automatically fill most of the DMDParameters’ attributes. Unnecessary if reconstructing object from JSON file. Defaut is None.
- class_description (str):
Class description used to improve redability when dumped to JSON file. Default is ‘DMD parameters’.
- ALP_version: int | None = None
- DMD: dataclasses.InitVar[ALP4] = None
- add_illumination_time_us: int
- apps_fpga_temperature: float | None = None
- bitplanes: int | None = None
- class_description: str = 'DMD parameters'
- dark_phase_time_us: int | None = None
- ddc_fpga_temperature: float | None = None
- device_number: int | None = None
- display_height: int | None = None
- display_width: int | None = None
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
- id: int | None = None
- illumination_time_us: int | None = None
- initial_memory: int
- patterns: int | None = None
- patterns_wp: int | None = None
- pcb_temperature: float | None = None
- picture_time_us: int | None = None
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
- synch_polarity: str | None = None
- synch_pulse_delay: int | None = None
- synch_pulse_width_us: int | None = None
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
- trigger_edge: str | None = None
- type: str | None = None
- unused_memory: int | None = None
- usb_connection: bool | None = None
- class spas.metadata.DMDTypes(value)[source]
Bases:
IntEnumEnumeration of DMD types and respective codes.
- ALP_DMDTYPE_1080P_095A = 3
- ALP_DMDTYPE_DISCONNECT = 255
- ALP_DMDTYPE_SXGA_PLUS = 2
- ALP_DMDTYPE_WQXGA_400MHZ_090A = 8
- ALP_DMDTYPE_WQXGA_480MHZ_090A = 9
- ALP_DMDTYPE_WUXGA_096A = 7
- ALP_DMDTYPE_WXGA_S450 = 12
- ALP_DMDTYPE_XGA = 1
- ALP_DMDTYPE_XGA_055A = 5
- ALP_DMDTYPE_XGA_055X = 6
- ALP_DMDTYPE_XGA_07A = 4
- class spas.metadata.MetaData(pattern_prefix: str, experiment_name: str, light_source: str, object: str, filter: str, description: str, output_directory: str | Path, pattern_order_source: str | Path, pattern_source: str | Path, date: str | None = None, time: str | None = None, class_description: str = 'Metadata')[source]
Bases:
objectClass containing overall acquisition parameters and description.
Metadata concerning the experiment, paths, file inputs and file outputs. This class is adapted to be reconstructed from a JSON file.
- Attributes:
- output_directory (Union[str, Path], optional):
Directory where multiple related acquisitions will be stored.
- pattern_order_source (Union[str, Path], optional):
File where the order of patterns to be sent to DMD is specified. It can be a text file containing a list of pattern indeces or a numpy file containing a covariance matrix from which the pattern order is calculated.
- pattern_source (Union[str, Path], optional):
Pattern source folder.
- pattern_prefix (str):
Prefix used in pattern naming.
- experiment_name (str):
Prefix of all files related to a single acquisition. Files will appear with the following string pattern: experiment_name + ‘_’ + filename.
- light_source (str):
Light source used to illuminate an object during acquisition.
- object (str):
Object imaged during acquisition.
- filter (str):
Light filter used.
- description (str):
Acqusition experiment description.
- date (str, optional):
Acquisition date. Automatically set when object is created. Default is None.
- time (str, optional):
Time when metadata object is created. Set automatically by __post_init__(). Default is None.
- class_description (str):
Class description used to improve redability when dumped to JSON file. Default is ‘Metadata’.
- class_description: str = 'Metadata'
- date: str | None = None
- description: str
- experiment_name: str
- filter: str
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
- light_source: str
- object: str
- output_directory: str | Path
- pattern_order_source: str | Path
- pattern_prefix: str
- pattern_source: str | Path
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
- time: str | None = None
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
- class spas.metadata.SpectrometerParameters(high_resolution: bool, initial_available_pixels: int, detector: str, firmware_version: str | None = None, dll_version: str | None = None, fpga_version: str | None = None, integration_delay_ns: int | None = None, integration_time_ms: float | None = None, start_pixel: int | None = None, stop_pixel: int | None = None, averages: int | None = None, dark_correction_enable: bool | None = None, dark_correction_forget_percentage: int | None = None, smooth_pixels: int | None = None, smooth_model: int | None = None, saturation_detection: bool | None = None, trigger_mode: int | None = None, trigger_source: int | None = None, trigger_source_type: int | None = None, store_to_ram: int | None = None, configs: dataclasses.InitVar[MeasConfigType] = None, version_info: dataclasses.InitVar[Tuple[str]] = None, class_description: str = 'Spectrometer parameters')[source]
Bases:
objectClass containing spectrometer configurations.
Further information: AvaSpec Library Manual (Version 9.10.2.0).
- Attributes:
- high_resolution (bool):
True if 16-bit AD Converter is used. False if 14-bit ADC is used.
- initial_available_pixels (int):
Number of pixels available in spectrometer.
- detector (str):
Name of the light detector.
- firmware_version (str, optional):
Spectrometer firmware version.
- dll_version (str, optional):
Spectrometer dll version.
- fpga_version (str, optional):
Internal FPGA version.
- integration_delay_ns (int, optional):
Parameter used to start the integration time not immediately after the measurement request (or on an external hardware trigger), but after a specified delay. Unit is based on internal FPGA clock cycle.
- integration_time_ms (float, optional):
Spectrometer exposure time during one scan in miliseconds.
- start_pixel (int, optional):
Initial pixel data received from spectrometer.
- stop_pixel (int, optional):
Last pixel data received from spectrometer.
- averages (int, optional):
Number of averages in a single measurement.
- dark_correction_enable (bool, optional):
Enable dynamic dark current correction.
- dark_correction_forget_percentage (int, optional):
Percentage of the new dark value pixels that has to be used. e.g., a percentage of 100 means only new dark values are used. A percentage of 10 means that 10 percent of the new dark values is used and 90 percent of the old values is used for drift correction.
- smooth_pixels (int, optional):
Number of neighbor pixels used for smoothing, max. has to be smaller than half the selected pixel range because both the pixels on the left and on the right are used.
- smooth_model (int, optional):
Smoothing model. Currently a single model is supported in which the spectral data is averaged over a number of pixels on the detector array. For example, if the smoothpix parameter is set to 2, the spectral data for all pixels x(n) on the detector array will be averaged with their neighbor pixels x(n-2), x(n-1), x(n+1) and x(n+2).
- saturation_detection (bool, optional):
Enable detection of saturation/overexposition in pixels.
- trigger_mode (int, optional):
Trigger mode (0 = Software, 1 = Hardware, 2 = Single Scan).
- trigger_source (int, optional):
Trigger source (0 = external trigger, 1 = sync input).
- trigger_source_type (int, optional):
Trigger source type (0 = edge trigger, 1 = level trigger).
- store_to_ram (int, optional):
Define how many scans can be stored in RAM. In DynamicRAM mode, can be set to 0 to indicate infinite measurements.
- configs: InitVar[MeasConfigType]:
Initialization object containing data to create SpectrometerData object. Unnecessary if reconstructing object from JSON file Defaut is None.
- version_info: InitVar[Tuple[str]]:
Initialization variable used for receiving firmware, dll and FPGA version data. Unnecessary if reconstructing object from JSON file.
- class_description (str):
Class description used to improve redability when dumped to JSON file. Default is ‘Spectrometer parameters’.
- averages: int | None = None
- class_description: str = 'Spectrometer parameters'
- configs: dataclasses.InitVar[MeasConfigType] = None
- dark_correction_enable: bool | None = None
- dark_correction_forget_percentage: int | None = None
- detector: str
- dll_version: str | None = None
- firmware_version: str | None = None
- fpga_version: str | None = None
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
- high_resolution: bool
- initial_available_pixels: int
- integration_delay_ns: int | None = None
- integration_time_ms: float | None = None
- saturation_detection: bool | None = None
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
- smooth_model: int | None = None
- smooth_pixels: int | None = None
- start_pixel: int | None = None
- stop_pixel: int | None = None
- store_to_ram: int | None = None
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
- trigger_mode: int | None = None
- trigger_source: int | None = None
- trigger_source_type: int | None = None
- version_info: dataclasses.InitVar[Tuple[str]] = None
- class spas.metadata.func_path(data_folder_name, data_name)[source]
Bases:
object- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
- spas.metadata.read_metadata(file_path: str) Tuple[MetaData, AcquisitionParameters, SpectrometerParameters, DMDParameters][source]
Reads metadata of a previous acquisition from JSON file.
- Args:
- file_path (str):
Name of JSON file containing all metadata.
- Returns:
Tuple[MetaData, AcquisitionParameters, SpectrometerParameters, DMDParameters]:
- saved_metadata (MetaData):
Metadata object read from JSON.
- saved_acquisition_params(AcquisitionParameters):
AcquisitionParameters object read from JSON.
- saved_spectrometer_params(SpectrometerParameters):
SpectrometerParameters object read from JSON.
- saved_dmd_params(DMDParameters):
DMDParameters object read from JSON.
- spas.metadata.read_metadata_2arms(file_path: str) Tuple[MetaData, AcquisitionParameters, SpectrometerParameters, DMDParameters][source]
Reads metadata of a previous acquisition from JSON file.
- Args:
- file_path (str):
Name of JSON file containing all metadata.
- Returns:
Tuple[MetaData, AcquisitionParameters, SpectrometerParameters, DMDParameters]:
- saved_metadata (MetaData):
Metadata object read from JSON.
- saved_acquisition_params(AcquisitionParameters):
AcquisitionParameters object read from JSON.
- saved_spectrometer_params(SpectrometerParameters):
SpectrometerParameters object read from JSON.
- saved_dmd_params(DMDParameters):
DMDParameters object read from JSON.
- spas.metadata.save_metadata(metadata: MetaData, DMD_params: DMDParameters, spectrometer_params: SpectrometerParameters, acquisition_parameters: AcquisitionParameters) None[source]
Saves metadata to JSON file.
- Args:
- metadata (MetaData):
Metadata concerning the experiment, paths, file inputs and file outputs.
- DMD_params (DMDParameters):
Class containing DMD configurations and status.
- spectrometer_params (SpectrometerParameters):
Object containing spectrometer configurations.
- acquisition_parameters (AcquisitionParameters):
Object containing acquisition specifications and timing results.
- spas.metadata.save_metadata_2arms(metadata: MetaData, DMD_params: DMDParameters, spectrometer_params: SpectrometerParameters, camPar, acquisition_parameters: AcquisitionParameters) None[source]
Saves metadata to JSON file.
- Args:
- metadata (MetaData):
Metadata concerning the experiment, paths, file inputs and file outputs.
- DMD_params (DMDParameters):
Class containing DMD configurations and status.
- spectrometer_params (SpectrometerParameters):
Object containing spectrometer configurations.
- acquisition_parameters (AcquisitionParameters):
Object containing acquisition specifications and timing results.
spas.noise module
spas.reconstruction module
- spas.reconstruction.reconstruction_hadamard(patterns: numpy.ndarray, mode: str, Q: numpy.ndarray, M: numpy.ndarray, N: int = 64) numpy.ndarray[source]
Reconstruct an image acquired with Hadamard patterns.
- Args:
- patterns (np.ndarray):
Array containing an ordered list of the patterns used for acquisition.
- mode (str):
Select if reconstruction is based on MATLAB, fht or Walsh generated patterns.
- Q (np.ndarray):
Acquisition matrix used to generate Hadamard patterns.
- M (np.ndarray):
Spectral data matrix containing acquired spectra.
- N (int, optional):
Reconstructed image dimension. Defaults to 64.
- Returns:
- [np.ndarray]:
Reconstructed matrix of size NxN pixels.
- spas.reconstruction.reconstruction_raster(M: numpy.ndarray, N: int = 64) numpy.ndarray[source]
Reconstruct an image obtained via Raster scan.
- Args:
- M (np.ndarray):
Spectral data matrix containing acquired spectra.
- N (int, optional):
Reconstructed image dimension. Defaults to 64.
- Returns:
- np.ndarray:
Reconstructed matrix of size NxN pixels.