build_shotnum_dset_relation

bapsflib._hdf.utils.helpers.build_shotnum_dset_relation(shotnum: ndarray, dset: Dataset, shotnumkey: str, cmap: HDFMapControlTemplate | HDFMapControlCLTemplate, cconfn: Any) 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 – desired HDF5 shot number(s)

  • dset (h5py.Dataset) – control device dataset

  • shotnumkey (str) – field name in the control device dataset that contains shot numbers

  • cmap – mapping object for control device

  • cconfn – configuration name for the control device

Returns:

index and sni numpy arrays

Note

This function leverages the functions build_sndr_for_simple_dset() and build_sndr_for_complex_dset()