Skip to content
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

Merged
merged 35 commits into from
Feb 19, 2025
Merged

Diffmap #2419

merged 35 commits into from
Feb 19, 2025

Conversation

kif
Copy link
Member

@kif kif commented Jan 31, 2025

minor bug-fix

@kif kif added the work in progress Don't review label Jan 31, 2025
@kif kif requested a review from loichuder February 18, 2025 10:48
@kif kif added ready to merge Please review and removed work in progress Don't review labels Feb 18, 2025
@kif
Copy link
Member Author

kif commented Feb 18, 2025

This became a huge PR ... and not even sure it addresses everything.
Well all test passes, could you give me your point of view ?

@loichuder
Copy link
Member

Well all test passes, could you give me your point of view ?

Sure. Could you give some context ? Like what bug are you trying to fix ? And how did you fix it ?

@kif
Copy link
Member Author

kif commented Feb 18, 2025 via email

@loichuder
Copy link
Member

The big issue is to be able to process data which were acquired binned (issue on ID27).

That is still not enough information, I'm afraid. What changes if the data is acquired binned ? Is it related to the WorkerConfig ? Or is the PR fixing two issues at the same time ?

@kif
Copy link
Member Author

kif commented Feb 18, 2025

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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the cast?

Copy link
Member Author

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.

@kif kif merged commit a5f1c50 into silx-kit:main Feb 19, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Please review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants