Skip to content

Conversation

@jokasimr
Copy link
Contributor

@jokasimr jokasimr commented Feb 27, 2025

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

Copy link
Member

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?

Copy link
Contributor Author

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.

Comment on lines 24 to 29
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)
]
Copy link
Member

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?

Copy link
Contributor Author

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.

'''Corrects the intensities for imperfections of polarizing components'''
return _linsolve(self.polarization_matrix, Is)

def correct_intensities_and_normalize_by_reference(self, Is):
Copy link
Member

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.

@jokasimr
Copy link
Contributor Author

jokasimr commented Jun 3, 2025

Requires scipp/esspolarization#91

@jokasimr jokasimr requested a review from SimonHeybrock August 28, 2025 08:04
@jokasimr
Copy link
Contributor Author

The notebook might need some clean up - I'll take a look at that later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants