-
Notifications
You must be signed in to change notification settings - Fork 3
Polarization correction #122
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
base: main
Are you sure you want to change the base?
Conversation
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 we use esspolarization
to perform the correction?
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.
Right now we can't because of scipp/esspolarization#84
When that is fixed we should be able to use esspolarization
to do the correction.
src/ess/estia/calibration.py
Outdated
def _kronecker_product(A, B): | ||
return [ | ||
[A[ia][ja] * B[ib][jb] for ja in range(2) for jb in range(2)] | ||
for ia in range(2) | ||
for ib in range(2) | ||
] |
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 clarify why we cannot use np.kron
?
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 2D arrays containing DataArray
are treated by np.kron
as 3D arrays, and that makes the result different from what we want.
src/ess/estia/calibration.py
Outdated
'''Corrects the intensities for imperfections of polarizing components''' | ||
return _linsolve(self.polarization_matrix, Is) | ||
|
||
def correct_intensities_and_normalize_by_reference(self, Is): |
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.
Still missing type hints in many places.
Co-authored-by: Simon Heybrock <[email protected]>
Requires scipp/esspolarization#91 |
Polarization correction for ESTIA
Only important differences from #108 are in
src/ess/estia/calibration.py
: https://github.com/scipp/essreflectometry/pull/122/files#diff-df676f2a67f8251976ea2fcc161ea759d49deef6ef66c5adbf01d10665230077