Azimuthal variance accumulation#2776
Merged
Merged
Conversation
t20100
approved these changes
Feb 2, 2026
| # Crossed term: | ||
| delta = (self._sum_signal * other._sum_normalization - other._sum_signal*self._sum_normalization) | ||
| if numpy.nansum(other._sum_normalization2) < numpy.nansum(self._sum_normalization2): | ||
| tmp = other._sum_normalization2 / other._sum_normalization |
Member
There was a problem hiding this comment.
Why deviating from how eq 18 is written in https://journals.iucr.org/j/issues/2025/01/00/jo5109/index.html?
Maybe choose a better name than tmp to help the readers
Member
Author
There was a problem hiding this comment.
The implementation based on the formula is not always the most efficient...
Agreed for tmp
| if self.error_model == ErrorModel.AZIMUTHAL: | ||
| # Crossed term: | ||
| delta = (self._sum_signal * other._sum_normalization - other._sum_signal*self._sum_normalization) | ||
| if numpy.nansum(other._sum_normalization2) < numpy.nansum(self._sum_normalization2): |
Member
There was a problem hiding this comment.
Is this for numerical stability? other reason?
Member
Author
There was a problem hiding this comment.
The formula is not "exact" but closer to when the A is larger than B.
Σnormalization² is positive, this is why we use it to assess the size of the ensemble.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Propagate "properly" also azimuthal variance.
It makes sense to do it with
unionbut I doubt it can be properly calculated withaddorsubtract...Needs to be checked with a demonstrator ... probably an extension to the Spotty tutorial