|
6 | 6 | reduce_from_events_to_q,
|
7 | 7 | reduce_from_lz_to_q,
|
8 | 8 | )
|
| 9 | +from ..reflectometry.types import QBins, WavelengthBins |
| 10 | +from .types import ( |
| 11 | + Intensity, |
| 12 | + MagneticReference, |
| 13 | + MagneticSample, |
| 14 | + NonMagneticReference, |
| 15 | + OffOff, |
| 16 | + OffOn, |
| 17 | + OnOff, |
| 18 | + OnOn, |
| 19 | + PolarizedReflectivityOverQ, |
| 20 | +) |
9 | 21 |
|
10 | 22 |
|
11 | 23 | def solve_for_calibration_parameters(Io, Is):
|
@@ -157,3 +169,30 @@ def compute_reflectivity_calibrate_on_lz(
|
157 | 169 | sample = [reduce_from_lz_to_q(s, qbins) for s in sample]
|
158 | 170 | I0 = reduce_from_lz_to_q(I0, qbins)
|
159 | 171 | return [i / I0 for i in sample]
|
| 172 | + |
| 173 | + |
| 174 | +def reflectivity_provider( |
| 175 | + i000: Intensity[NonMagneticReference, OffOff], |
| 176 | + i001: Intensity[NonMagneticReference, OffOn], |
| 177 | + i010: Intensity[NonMagneticReference, OnOff], |
| 178 | + i011: Intensity[NonMagneticReference, OnOn], |
| 179 | + im00: Intensity[MagneticReference, OffOff], |
| 180 | + im01: Intensity[MagneticReference, OffOn], |
| 181 | + im10: Intensity[MagneticReference, OnOff], |
| 182 | + im11: Intensity[MagneticReference, OnOn], |
| 183 | + is00: Intensity[MagneticSample, OffOff], |
| 184 | + is01: Intensity[MagneticSample, OffOn], |
| 185 | + is10: Intensity[MagneticSample, OnOff], |
| 186 | + is11: Intensity[MagneticSample, OnOn], |
| 187 | + wbins: WavelengthBins, |
| 188 | + qbins: QBins, |
| 189 | +) -> PolarizedReflectivityOverQ: |
| 190 | + return compute_reflectivity_calibrate_on_q( |
| 191 | + [i000, i001, i010, i011], |
| 192 | + [im00, im01, im10, im11], |
| 193 | + [is00, is01, is10, is11], |
| 194 | + qbins, |
| 195 | + ) |
| 196 | + |
| 197 | + |
| 198 | +providers = (reflectivity_provider,) |
0 commit comments