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 shotnum numpy array to the specified dataset, dset, to determine which indices contain the desired shot number(s) [for HDFReadControls]. As a results, two numpy arrays are returned which satisfy the rule:

shotnum[sni] = dset[index, shotnumkey]

where shotnum is the original shot number array, sni is a boolean numpy array masking which shot numbers were determined to be in the dataset, and index is 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 dataset

  • shotnumkey (str | None) – Dataset field name containing shot numbers, or None if 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 in config_column. This is typically the name of the device configuration.

  • config_column (Optional[str]) – Name of the dset column containing control configurations. If omitted, then dset columns are searched for a name containing ‘configuration’. (DEFAULT: None)

Returns: