devctrl.data.spectrum.util.get_matching_or_in_range_energy_slice#
- get_matching_or_in_range_energy_slice(has_Es: list | ndarray, Es=None, wavelengths=None, warn_discard=False)[source]#
Return slice object or list of indices from has_Es list, accordingt Es or wavelengths. Only one of Es or wavelengths may be given. :param has_Es: List of available Es. The returned wavlengths are a subset of these. :param Es: List of Es, range of wavelenthgs (as tuple, with at least (min, max)), or None to use all Es. Conflicts with wavelengths. :param wavelengths: List of energies (eV), range of energies (as tuple, with at least (min, max)), or None to use all Es. Conflicts with Es