-
Notifications
You must be signed in to change notification settings - Fork 3
Zw figure fix #132
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
Zw figure fix #132
Conversation
| sample, | ||
| reference, | ||
| reference.coords['wavelength'], | ||
| ) |
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.
Can you check that the result is reasonable, not just that the function doesn't raise? If you can't check the values directly, you can at least check the sizes and that the right coords are present.
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.
The intent of the test is to check that the function doesn't raise if we have non-count weights, because that was the bug that prompted this issue.
Adding a bunch of extra checks for no apparent reason doesn't make sense in my opinion.
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.
Well, the reason is that the function can still misbehave without raising. In any case, there should be at least one more test to make sure that it produces a meaningful result.
| Returns reflectivity as a function of ``blade``, ``wire`` and :math:`\\wavelength`. | ||
| """ | ||
| R = sample.bins.concat(('stripe',)).bin(wavelength=wbins) / reference.data | ||
| R.masks["too_few_events"] = reference.data < sc.scalar(1, unit="counts") |
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.
Is the mask not needed anymore?
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.
Yes that's right. It was needed when we normalized on the z-wavelength grid, but we don't do that anymore.
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.
What do you do instead? And why is there still a 'zw' in the function name?
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.
We normalize on the Q-grid. But that's not done in this function.
This function still normalizes on the zw grid, but that is not used for the reduction, only for visualization purposes, and for visualization masking is not necessary.
Fixes #130