|
5 | 5 | import plopp as pp
|
6 | 6 | import scipp as sc
|
7 | 7 |
|
8 |
| -from ess.reflectometry.types import ( |
| 8 | +from .types import ( |
9 | 9 | QBins,
|
| 10 | + QThetaFigure, |
| 11 | + ReducibleData, |
| 12 | + Reference, |
| 13 | + ReflectivityDiagnosticsView, |
10 | 14 | ReflectivityOverQ,
|
11 | 15 | ReflectivityOverZW,
|
12 | 16 | SampleRun,
|
13 |
| -) |
14 |
| - |
15 |
| -from .types import ( |
16 |
| - QThetaFigure, |
17 |
| - ReflectivityDiagnosticsView, |
18 | 17 | ThetaBins,
|
| 18 | + WavelengthBins, |
19 | 19 | WavelengthThetaFigure,
|
20 | 20 | WavelengthZIndexFigure,
|
21 | 21 | )
|
@@ -268,18 +268,25 @@ def wavelength_z_figure(
|
268 | 268 |
|
269 | 269 |
|
270 | 270 | def wavelength_theta_diagnostic_figure(
|
271 |
| - da: ReflectivityOverZW, |
| 271 | + da: ReducibleData[SampleRun], |
| 272 | + ref: Reference, |
| 273 | + wbins: WavelengthBins, |
272 | 274 | thbins: ThetaBins[SampleRun],
|
273 | 275 | ) -> WavelengthThetaFigure:
|
274 |
| - return wavelength_theta_figure(da, theta_bins=thbins) |
| 276 | + s = da.hist(wavelength=wbins, theta=thbins) |
| 277 | + r = ref.hist(theta=s.coords['theta'], wavelength=s.coords['wavelength']).data |
| 278 | + return wavelength_theta_figure(s / r) |
275 | 279 |
|
276 | 280 |
|
277 | 281 | def q_theta_diagnostic_figure(
|
278 |
| - da: ReflectivityOverZW, |
| 282 | + da: ReducibleData[SampleRun], |
| 283 | + ref: Reference, |
279 | 284 | thbins: ThetaBins[SampleRun],
|
280 | 285 | qbins: QBins,
|
281 | 286 | ) -> QThetaFigure:
|
282 |
| - return q_theta_figure(da, q_bins=qbins, theta_bins=thbins) |
| 287 | + s = da.hist(theta=thbins, Q=qbins) |
| 288 | + r = ref.hist(theta=s.coords['theta'], Q=s.coords['Q']).data |
| 289 | + return q_theta_figure(s / r) |
283 | 290 |
|
284 | 291 |
|
285 | 292 | def wavelength_z_diagnostic_figure(
|
|
0 commit comments