Skip to content
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

Implement and test updated opacity definition #27

Merged
merged 6 commits into from
Feb 6, 2024

Conversation

SimonHeybrock
Copy link
Member

@SimonHeybrock SimonHeybrock commented Jan 22, 2024

This should replace #20 and #21. This is based on my understanding looking at the docs added in #26.

@astellhorn Please check if this is correct. Can you answer the TODO about the units?

) -> bool:
return (data.variances is None) or all(
data.sizes.get(dim) == size for dim, size in sizes.items()
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel i cannot give feedback to this part without getting explained what exactly its doing. Maybe you could explain it in our next meeting?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this file was actually just copier from esssans, so it is has been reviewed by someone previously.

Copy link
Collaborator

@astellhorn astellhorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it all makes sense and fits to the equation of opacity!

Copy link
Member

@nvaytet nvaytet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review, I thought this was all good and finalized.


def intensity(wavelength: sc.Variable, opacity0: sc.Variable) -> sc.Variable:
opacity = OpacityFunction(opacity0)
return transmission_empty_glass * sc.exp(-opacity(wavelength))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems here that transmission_empty_glass is assumed to be a constant? (unless I misread).
However, in the documentation notebook it says that it could be wavelength dependent. Do we need to factor that in now, or are we leaving it for a later stage?
If the latter, should we include a TODO?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I remember, it was said "it is in principle not constant, but no one ever measured that". As it would complicate #24, I would like to keep this as it is, until we have clear evidence that this is not sufficient.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that was exactly the status, so I agree on keeping it as it is!

return He3Opacity[Cell](0.07733 * pressure * cell_length * wavelength)
from scipp.constants import Boltzmann as k_B

he3_neutron_absorption_cross_section_at_1_angstrom = 2966.0e-24 * sc.Unit(
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 add a reference to an article or database where the 2966.0e-24 came from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are already tracking this in #28. In particular, I think this should have error bars.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@SimonHeybrock SimonHeybrock merged commit e7191c0 into main Feb 6, 2024
3 checks passed
@SimonHeybrock SimonHeybrock deleted the opacity-function branch February 6, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants