8.3.2. Scanner module and classes

Summary of the classes in the scanner module

ScanType(*values)

ScanInfo([Nsteps, positions, axes_indexes, ...])

Container class for a given scan details

Scanner([parent_widget, actuators, ...])

Main Object to define a PyMoDAQ scan and create a UI to set it

The scanner module contains all functionalities to defines a particular scan see Scanner.

pymodaq.utils.scanner.utils.ScanType = <enum 'ScanType'>
class pymodaq.utils.scanner.utils.ScanInfo(Nsteps=0, positions=None, axes_indexes=None, axes_unique=None, selected_actuators=[], **kwargs)[source]

Container class for a given scan details

It includes the number of steps and all the positions for the selected actuators. It also contains these positions as scan axes for easier use.

Parameters:
  • Nsteps (int) – Number of steps of the scan

  • positions (ndarray) – multidimensional array. the first dimension has a length of Nsteps and each element is an actuator position

  • positions_indexes (ndarray) – multidimensional array of Nsteps 0th dimension length where each element is the index of the corresponding positions within the axis_unique

  • axes_unique (list of ndarray) – list of sorted (and with unique values) 1D arrays of unique positions of each defined axes

  • selected_actuators (List[str]) – The actuators to be used for this scan

  • kwargs (dict of other named parameters to be saved as attributes)

Variables:
  • Nsteps (int) – Number of steps of the scan

  • positions (ndarray) – multidimensional array. the first dimension has a length of Nsteps and each element is an actuator position

  • positions_indexes (ndarray) – multidimensional array of Nsteps 0th dimension length where each element is the index of the corresponding positions within the axis_unique

  • axes_unique (list of ndarray) – list of sorted (and with unique values) 1D arrays of unique positions of each defined axes

  • kwargs (dict of other named attributes)

class pymodaq.utils.scanner.scanner.Scanner(parent_widget=None, actuators=None, selected_actuators=None, orientation=Orientation.VERTICAl)[source]

Main Object to define a PyMoDAQ scan and create a UI to set it

Parameters:
  • parent_widget (QWidget)

  • scanner_items (list of GraphicItems) – used by ScanSelector for chosing scan area or linear traces

  • actuators (List[DAQ_Move]) – list actuators names

See also

ScanSelector, ScannerBase, TableModelSequential, TableModelTabular, pymodaq_types.TableViewCustom

Attributes:
actuators

list of DAQ_Move: Returns as a list the name of the selected actuators to describe the actual scan

actuators_all

list of DAQ_Move: Returns as a list the name of the selected actuators to describe the actual scan

axes_indexes
axes_unique
distribution
n_axes
n_steps
positions
scan_sub_type
scan_type
scanner

Methods

get_indexes_from_scan_index(scan_index)

To be reimplemented.

get_scan_info()

Get a summary of the configured scan as a ScanInfo object

get_scanner_sub_settings()

Get the current ScannerBase implementation's settings

positions_at(index)

Extract the actuators positions at a given index in the scan as a DataToExport of DataActuators

set_scan()

Process the settings options to calculate the scan positions

set_scan_type_and_subtypes(scan_type[, ...])

Convenience function to set the main scan type

to_dict([use_real_actuators])

Dictionary representation of the scanner object

value_changed(param)

connect_things

from_dict

get_nav_axes

get_scan_shape

save_scanner_settings

scanner_changed_signal

scanner_updated_signal

set_actuators

set_scan_from_settings

set_scanner

setup_ui

update_from_scan_selector

get_indexes_from_scan_index(scan_index)[source]

To be reimplemented. Calculations of indexes within the scan

Return type:

Tuple[int]

get_scan_info()[source]

Get a summary of the configured scan as a ScanInfo object

Return type:

ScanInfo

get_scanner_sub_settings()[source]

Get the current ScannerBase implementation’s settings

positions_at(index)[source]

Extract the actuators positions at a given index in the scan as a DataToExport of DataActuators

Return type:

DataToExport

set_scan()[source]

Process the settings options to calculate the scan positions

Returns:

bool

Return type:

True if the processed number of steps if **higher** than the configured number of steps

set_scan_type_and_subtypes(scan_type, scan_subtype=None)[source]

Convenience function to set the main scan type

Parameters:
  • scan_type (str) – one of registered Scanner main identifier

  • scan_subtype (str) – one of registered Scanner second identifier for a given main identifier

See also

ScannerFactory

to_dict(use_real_actuators=False)[source]

Dictionary representation of the scanner object

if use_real_actuators is True, populate the dictionary with real actuator objects else their title

This distinction allows to simply serialize Scanner when using strings while serializing DAQ_Move is not that simple

Return type:

dict[str, Any]

property actuators: list[DAQ_Move]

Returns as a list the name of the selected actuators to describe the actual scan

Type:

list of DAQ_Move

property actuators_all: list[DAQ_Move]

Returns as a list the name of the selected actuators to describe the actual scan

Type:

list of DAQ_Move