build_shotnum_dset_relation
- bapsflib._hdf.utils.helpers.build_shotnum_dset_relation(shotnum: ndarray, dset: Dataset, shotnumkey: str | None, n_configs: int, config_column_value: Any, config_column: str | None = None) Tuple[ndarray, ndarray]
Compares the
shotnumnumpyarray to the specified dataset,dset, to determine which indices contain the desired shot number(s) [forHDFReadControls]. As a results, two numpy arrays are returned which satisfy the rule:shotnum[sni] = dset[index, shotnumkey]
where
shotnumis the original shot number array,sniis a booleannumpyarray masking which shot numbers were determined to be in the dataset, andindexis an array of indices corresponding to the desired shot number(s).- Parameters:
shotnum (array_like) – Array like object of desired shot numbers.
dset (
h5py.Dataset) – Control device datasetshotnumkey (
str| None) – Dataset field name containing shot numbers, orNoneif the dataset has NO shot number column.n_configs (int) – The number of unique configurations contained in
dset.config_column_value (
Any) – The configuration value to searched for inconfig_column. This is typically the name of the device configuration.config_column (Optional[
str]) – Name of thedsetcolumn containing control configurations. If omitted, thendsetcolumns are searched for a name containing ‘configuration’. (DEFAULT:None)
- Returns:
index (
numpy.ndarray) – array of indices to indexdsetsni (
numpy.ndarray) – boolean array that masks theshotnumarray