build_sndr_for_simple_dset

bapsflib._hdf.utils.helpers.build_sndr_for_simple_dset(shotnum: ndarray, dset: Dataset, shotnumkey: str) Tuple[ndarray, ndarray]

Compares the shotnum numpy array to the specified “simple” dataset, dset, to determine which indices contain the desired shot number(s). 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).

A “simple” dataset is a dataset in which the data for only ONE configuration is recorded.

Parameters:
  • shotnum – desired HDF5 shot number

  • dset (h5py.Dataset) – dataset containing shot numbers

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

Returns:

index and sni numpy arrays