FSRSutils¶
This module provides some utility functions that are used internally in pyFSRS.
-
core.FSRSutils.
appendStageParameters
(prop, fr=-500, to=2500, st=20)[source]¶ Create and append the necessary controls for a delay stage to a FSRSmodule property dictionary.
This function creates the following controls:
- From (fs) (textbox): Set the starting position. When value changes, onAxisRangeChange is called (has to be implemented by user).
- Till (fs) (textbox): Set the ending position. When value changes, onAxisRangeChange is called (has to be implemented by user).
- Step Size (fs) / # of Steps (textbox): Set the desired step size (linear stepping) or number of steps (logarithmic stepping). When value changes, onAxisRangeChange is called (has to be implemented by user).
- Mode (choice): Set type of stepping (‘linear’, ‘logarithmic’, ‘from file’). When value changes, onAxisRangeChange is called (has to be implemented by user).
- Random (checkbox): If True, the target positions are approached in random order, otherwise sequential. Works for all modes.
- Use File (fie picker): Select a text file containing the desired stage positions. If there are several columns in the file, only the first one is used.
Parameters: - prop (dict) – Property dictionary to which the controls are appended.
- fr (float) – Initial start position in fs (default=-500).
- to (float) – Initial stop position in fs (default=2500).
- st (float) – Initial step size in fs (default=20).
Returns: Appended property dictionary.
-
core.FSRSutils.
formatFSRSFilename
(type, basename, step, set=0, shutter=0)[source]¶ Use the historical formatting convention for FSRS and TA data filenames.
The generated filenames are compatible with the formerly used LabView code in the Mathies lab. This function is called by the FSRS-modules.
Parameters: - type (int) – Type of spectrum (0 = FSRS, 1 = TA).
- basename (str) – Basename of the generated files.
- step (float) – Position of axis = time.
- set (int) – Number of measurement set or run (default = 0).
- shutter (int) – State of actinic shutter (0 = closed = ground state, 1 = open = excited state).
Returns: Formatted filename: basename_(p/m)|step|(gr/exc/_)set.
-
core.FSRSutils.
onAxisRangeChange
(self, event)[source]¶ Handles changes in one of the axis parameters.
Call this event handler from within an event handler of the same name in the module using the stage.
-
core.FSRSutils.
prepareScanPoints
(self)[source]¶ Returns a list of stage positions according to the current stage settings.
Call from within the module using the stage as this function directly reads the stage settings from the module properties.