condition_controls
- bapsflib._hdf.utils.helpers.condition_controls(hdf_file: File, controls: Any) List[Tuple[str, Any]]
Conditions the
controlsargument forHDFReadControlsandHDFReadData.- Parameters:
hdf_file (
File) – HDF5 object instancecontrols –
controlsargument to be conditioned
- Returns:
A
listcontaining tuple pairs of control device name and desired configuration name- Return type:
Examples
>>> from bapsflib import lapd >>> f = lapd.File('sample.hdf5') >>> controls = ['Wavefrom', ('6K Compumotor', 3)] >>> conditioned_controls = condition_controls(f, controls) >>> conditioned_controls [('Waveform', 'config01'), ('6K Compumotor', 3)]
Condition Criteria
Input
controlsshould beUnion[str, Iterable[Union[str, Tuple[str, Any]]]]There can only be one control for each
ConType.If a control has multiple configurations, then one must be specified.
If a control has ONLY ONE configuration, then that will be assumed (and checked against the specified configuration).