Skip to content
Snippets Groups Projects
Commit ad1579a3 authored by Martin Teichmann's avatar Martin Teichmann
Browse files

improve readability of integration

parent 11218377
No related branches found
No related tags found
1 merge request!231improve the integation code
...@@ -477,14 +477,14 @@ class hRIXS: ...@@ -477,14 +477,14 @@ class hRIXS:
dark_image = self.dark_image[self.X_RANGE, self.Y_RANGE] dark_image = self.dark_image[self.X_RANGE, self.Y_RANGE]
images = data["hRIXS_det"].values[:, self.X_RANGE, self.Y_RANGE] images = data["hRIXS_det"].values[:, self.X_RANGE, self.Y_RANGE]
x = np.arange(images.shape[1])[:, None] x, y = np.ogrid[:images.shape[1], :images.shape[2]]
y = np.arange(images.shape[2])[None, :] - self.parabola(x) quo, rem = divmod(y - self.parabola(x), 1)
quo, rem = divmod(y, 1) quo = np.array([quo, quo + 1])
quo = np.array([[[0]], [[1]]]) + quo - margin rem = np.array([rem, 1 - rem])
rem = rem * np.array([[[1]], [[-1]]]) + np.array([[[0]], [[1]]]) wrong = (quo < margin) | (quo >= bins - margin)
wrong = (quo < 0) | (quo >= bins - 2 * margin) quo[wrong] = margin
quo[wrong] = rem[wrong] = 0 rem[wrong] = 0
quo = quo.astype(int).ravel() quo = (quo - margin).astype(int).ravel()
for image, r in zip(images, ret): for image, r in zip(images, ret):
if self.USE_DARK: if self.USE_DARK:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment