condition_controls¶
- bapsflib._hdf.utils.helpers.condition_controls(hdf_file: File, controls: Any) List[Tuple[str, Any]] ¶
Conditions the controls argument for
HDFReadControls
andHDFReadData
.- Parameters:
hdf_file – HDF5 object instance
controls –
controls
argument to be conditioned
- Returns:
list containing tuple pairs of control device name and desired configuration name
- Example:
>>> 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 controls should be
Union[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).