-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diffmap #2419
Diffmap #2419
Conversation
for more information, see https://pre-commit.ci
This became a huge PR ... and not even sure it addresses everything. |
Sure. Could you give some context ? Like what bug are you trying to fix ? And how did you fix it ? |
Sure. Could you give some context ? Like what bug are you trying to fix ? And how did you fix it ?
The big issue is to be able to process data which were acquired binned (issue on ID27).
But this is strongly linked with the introduction of the dataclass
"WorkerConfig" for the configuration.
|
That is still not enough information, I'm afraid. What changes if the data is acquired binned ? Is it related to the |
Here is the difference: images arrive with the shape 1500x1600 while the azimuthal integrator is setup for images of shape (3000x3200). Of course, this can be "guessed" but checking this every time an array could be of different size creates a lot of modifications a bit everywhere. |
"""Initialize the worker with the proper input shape | ||
|
||
:param shape: enforce the shape to initialize to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel that telling that it "enforces" the shape is misleading: shape
will not always be the final shape, since new_shape
below can take precedence,.
@@ -128,7 +128,7 @@ def integrate1d(self, data, npt, filename=None, | |||
method = self._normalize_method(method, dim=1, default=self.DEFAULT_METHOD_1D) | |||
assert method.dimension == 1 | |||
unit = units.to_unit(unit) | |||
empty = dummy if dummy is not None else self._empty | |||
empty = numpy.float32(dummy) if dummy is not None else self._empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the cast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found out that 4294967295 (i.e. 2^32-1, the dummy value for the Eiger detector) was actually rounded to 4294967300.0 in float32
. Types are strict in cython, and the empty value is stored in float32, same type as the data used in input and output (calculation are performed in float64
).
I should also check the case empty=nan
since nam!=nan. Good point.
minor bug-fix