-
Notifications
You must be signed in to change notification settings - Fork 1
Implement He3 polarization function and He3 transmission function #48
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
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.
Looks good to me! Left a few comments.
He3Transmission | ||
He3OpacityFunction | ||
He3PolarizationFunction | ||
He3TransmissionFunction |
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.
(minor) I think it's better to not add the type of the quantity to the name. In this case ...Function
. Just like we don't add ...Variable
or ...DataArray
to the names of domain types that are variables or data arrays. He3Opacity
seems less noisy to me.
But this is maybe more of a personal preference.
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.
Especially for the functions where a fit has to be performed, I actually like the naming ...Function
--> it is more clear (to me) what is the function and what is the result itself
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.
I also think having "function" here is important, since we initially thought we would return the evaluated function. The comparison to Variable
and DataArray
is not equivalent, I think.
src/ess/polarization/base.py
Outdated
polarization -= 1.0 | ||
else: | ||
polarization += 1.0 | ||
return self.transmission_empty_glass * sc.exp(opacity * polarization) |
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.
In the description (section "Spin-dependent transmission values") it looks like plus_minus = 'plus'
implies that the expression in exp()
should be
Seems to be two things different:
-
Yes$\lambda$ does not occur in the final expression, is that because the notation in the description is different, and the wavelength is actually an argument to the opacity like it is in this function? - The sign of
$P$ seems to be wrong.
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.
Hm, we want for 'plus' : -OP-1, and for 'minus': +OP-O.
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.
But I have another question: is this used only for the TransmissionFunction for a polarized incoming beam? It is a bit unclear to me. It should NOT be used for transmission_incoming_unpolarized
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.
Good catch, should be fixed now, please have another look.
@astellhorn No, this is not used during the fit.
src/ess/polarization/base.py
Outdated
) -> He3Transmission[Cell]: | ||
""" | ||
Transmission for a given cell. | ||
def direct_beam_ratio( |
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.
(minor) I still prefer the name transmission
here, or maybe expected_transmission
. The "ratio" here is (imo) the observed transmission.
Fixes #44.