Skip to content

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

Merged
merged 14 commits into from
May 16, 2024

Conversation

SimonHeybrock
Copy link
Member

@SimonHeybrock SimonHeybrock commented May 13, 2024

Fixes #44.

@SimonHeybrock SimonHeybrock changed the title Implement He3 polarization function Implement He3 polarization function and He3 transmission function May 14, 2024
This was referenced May 14, 2024
Copy link
Contributor

@jokasimr jokasimr left a 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
Copy link
Contributor

@jokasimr jokasimr May 14, 2024

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.

Copy link
Collaborator

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

Copy link
Member Author

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.

polarization -= 1.0
else:
polarization += 1.0
return self.transmission_empty_glass * sc.exp(opacity * polarization)
Copy link
Contributor

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 $-O \lambda (1 + P)$ but in this function I think we get $O (P - 1)$.

Seems to be two things different:

  1. $\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? Yes
  2. The sign of $P$ seems to be wrong.

Copy link
Collaborator

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.

Copy link
Collaborator

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

Copy link
Member Author

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.

) -> He3Transmission[Cell]:
"""
Transmission for a given cell.
def direct_beam_ratio(
Copy link
Contributor

@jokasimr jokasimr May 14, 2024

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.

@SimonHeybrock SimonHeybrock merged commit f2b92a4 into main May 16, 2024
@SimonHeybrock SimonHeybrock deleted the he3_polarization branch May 16, 2024 09:03
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.

Next steps
3 participants