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

Add missing computation of cell transmissions #6

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/ess/polarization/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class He3Polarization(sl.Scope[Cell, sc.DataArray], sc.DataArray):
"""Time-dependent polarization for a given cell."""


class He3Transmission(sl.Scope[Cell, sc.DataArray], sc.DataArray):
"""Wavelength- and time-dependent transmission for a given cell."""


class He3CellPressure(sl.Scope[Cell, sc.Variable], sc.Variable):
"""Pressure for a given cell."""

Expand Down Expand Up @@ -230,10 +234,23 @@ def direct_beam_data_by_cell_and_polarization(
""" """


def he3_transmission(
opacity: He3Opacity[Cell],
polarization: He3Polarization[Cell],
transmission_empty_glass: He3TransmissionEmptyGlass[Cell],
) -> He3Transmission[Cell]:
"""
Transmission for a given cell.

This is computed from the opacity and polarization.
"""
return He3Transmission[Cell]()


def correct_sample_data_for_polarization(
sample_data: SampleData,
transmission_polarizer: He3Polarization[Polarizer],
transmission_analyzer: He3Polarization[Analyzer],
transmission_polarizer: He3Transmission[Polarizer],
transmission_analyzer: He3Transmission[Analyzer],
) -> PolarizationCorrectedSampleData:
"""
Apply polarization correction for the case of He3 polarizers and analyzers.
Expand All @@ -249,6 +266,7 @@ def correct_sample_data_for_polarization(
providers = [
direct_beam,
he3_direct_beam,
he3_transmission,
he3_opacity_from_beam_data,
he3_polarization,
correct_sample_data_for_polarization,
Expand Down