MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / _energy_to_index

Function _energy_to_index

pyxrf/core/map_processing.py:967–971  ·  view source on GitHub ↗
(energy)

Source from the content-addressed store, hash-verified

965 n_sel_start = data_sel_indices[0]
966
967 def _energy_to_index(energy):
968 # 'y' is truncated array, and energy axis is aligned with the full array
969 n_index = int(round((energy - e_offset) / e_linear)) - n_sel_start
970 n_index = int(np.clip(n_index, a_min=0, a_max=n_pts - 1))
971 return n_index
972
973 roi_data = np.zeros(shape=(ny, nx, len(roi_bands)))
974 for n, band in enumerate(roi_bands):

Callers 1

_compute_roiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected