Dummy Detector

class lys_instr.dummy.MultiDetector.MultiDetectorDummy(data=None, indexShape=(), frameShape=(100, 100), exposure=0.1, **kwargs)[source]

Bases: MultiDetectorInterface

Dummy implementation of MultiDetectorInterface.

This class simulates a detector that Produces indexed frames from a supplied data source or by generating random frames. Acquisition runs in a background loop (started by start() in __init__) and populates an internal buffer. Signals updated, dataAcquired, and aliveStateChanged, defined in MultiDetectorInterface, are emitted as appropriate.

property axes

Axis coordinates for the full data.

Returns:

Coordinate arrays corresponding to each axis of the index grid.

Return type:

List[numpy.ndarray]

property frameShape

Shape of a single acquired data frame.

Returns:

Frame dimensions (height, width, …) as provided by the data source.

Return type:

tuple[int, …]

property indexShape

Shape of the index grid.

Returns:

Dimensions of the index grid used to iterate over frames.

Return type:

tuple[int, …]

setData(data=None, indexShape=None, frameShape=None)[source]

Configure the dummy data source.

Parameters:
  • data (Optional[DummyDataInterface]) – Data source. If None, a random-data generator (RandomData) is created.

  • indexShape (Optional[Tuple[int, ...]]) – Index-grid shape used by the random-data generator.

  • frameShape (Optional[Tuple[int, ...]]) – Frame shape used by the random-data generator.

settingsWidget()[source]

Create and return an optional settings QWidget.

Returns:

The settings panel widget.

Return type:

QtWidgets.QWidget

class lys_instr.dummy.detectorData.interface.DummyDataInterface[source]

Bases: object

Abstract interface for dummy detector data providers.

Subclasses should provide an iterable sequence of frames and metadata describing frame shape, index grid shape, and coordinate axes.

property axes

Axis coordinates for the full data.

Returns:

Coordinate arrays corresponding to each axis of the index grid.

Return type:

list[numpy.ndarray]

property frameShape

Shape of each data frame.

Returns:

Shape of each data frame.

Return type:

tuple[int, …]

property indexShape

Shape of the index grid for data frames.

Returns:

Shape of the index grid.

Return type:

tuple[int, …]

classmethod name()[source]

Return the name of the dummy data set.

Returns:

Name of the dummy data set.

Return type:

str

property nframes

Number of sub-frames per yielded frame.

Values > 1 indicate multi-slice frames (e.g., when an index row is treated as a leading frame dimension).

Returns:

Number of sub-frames per yielded frame.

Return type:

int

class lys_instr.dummy.detectorData.raman.RamanData(scanLevel=0)[source]

Bases: DummyDataInterface

Dummy Raman data provider backed by NumPy sample data.

The class loads resources/sampleRamanData.npy from the package and exposes frames, index shape and coordinate axes. It supports two scanLevel modes (0 or 1).

property axes

Axis coordinates for the full data.

Returns:

Coordinate arrays corresponding to each axis of the index grid.

Return type:

list[numpy.ndarray]

property frameShape

Shape of each data frame.

Returns:

Shape of each data frame.

Return type:

tuple[int, …]

property indexShape

Shape of the index grid to be filled by data frames.

Returns:

Shape of the index grid (empty tuple when no index).

Return type:

tuple[int, …]

classmethod name()[source]

Return the name of the data provider.

Returns:

Name of the data provider (“Raman”).

Return type:

str

property nframes

Number of sub-frames per yielded frame.

Returns:

Number of sub-frames per yielded frame (always 1 for this provider).

Return type:

int

class lys_instr.dummy.detectorData.random.RandomData(indexShape, frameShape)[source]

Bases: DummyDataInterface

Dummy random data provider for given index and frame shapes.

property axes

Axis coordinates for the full data.

Returns:

Coordinate arrays corresponding to each axis of the index grid (evenly spaced integers).

Return type:

list[numpy.ndarray]

property frameShape

Shape of each generated data frame.

Returns:

Shape of each generated data frame.

Return type:

tuple[int, …]

property indexShape

Shape of the index grid to be filled by generated data frames.

Returns:

Shape of the index grid.

Return type:

tuple[int, …]

classmethod name()[source]

Return the name of the data provider.

Returns:

Name of the data provider (“Random”).

Return type:

str

property nframes

Number of sub-frames per yielded frame.

  • If len(indexShape) + len(frameShape) <= 3 -> 1

  • If both are 2-D -> indexShape[1] (inner/column count)

Examples

  • indexShape=() and frameShape=(100, 100) -> 1

  • indexShape=(10,) and frameShape=(100, 100) -> 1

  • indexShape=(5, 3) and frameShape=(100, 100) -> 3

Returns:

Number of sub-frames per yielded frame.

Return type:

int

Raises:

NotImplementedError – If the combination of shapes is unsupported.

class lys_instr.dummy.detectorData.random.RandomData2D[source]

Bases: RandomData

Convenience 2-D random-data provider.

classmethod name()[source]

Return the name of the data provider.

Returns:

Name of the data provider (“Random 2D”).

Return type:

str