7
7
from scippneutron .io import cif
8
8
9
9
from ess .powder .calibration import OutputCalibrationData
10
- from ess .powder .types import CIFAuthors , IofTof , ReducedTofCIF
10
+ from ess .powder .types import (
11
+ Beamline ,
12
+ CIFAuthors ,
13
+ IofTof ,
14
+ ReducedTofCIF ,
15
+ ReducerSoftwares ,
16
+ Source ,
17
+ )
11
18
12
19
13
20
def prepare_reduced_tof_cif (
14
- da : IofTof , * , authors : CIFAuthors , calibration : OutputCalibrationData
21
+ da : IofTof ,
22
+ * ,
23
+ authors : CIFAuthors ,
24
+ beamline : Beamline ,
25
+ source : Source ,
26
+ reducers : ReducerSoftwares ,
27
+ calibration : OutputCalibrationData ,
15
28
) -> ReducedTofCIF :
16
29
"""Construct a CIF builder with reduced data in d-spacing.
17
30
@@ -24,6 +37,12 @@ def prepare_reduced_tof_cif(
24
37
Reduced 1d data with a ``'tof'`` dimension and coordinate.
25
38
authors:
26
39
List of authors to write to the file.
40
+ beamline:
41
+ Information about the beamline that the data was produced at.
42
+ source:
43
+ Information about the neutron source.
44
+ reducers:
45
+ List of software pieces used to reduce the data.
27
46
calibration:
28
47
Coefficients for conversion between d-spacing and final ToF.
29
48
See :meth:`scippneutron.io.cif.CIF.with_powder_calibration`.
@@ -34,14 +53,12 @@ def prepare_reduced_tof_cif(
34
53
An object that contains the reduced data and metadata.
35
54
Us its ``save`` method to write the CIF file.
36
55
"""
37
- from .. import __version__
38
-
39
56
to_save = _prepare_data (da )
40
57
return ReducedTofCIF (
41
58
cif .CIF ('reduced_tof' )
42
- .with_reducers (f'ess.dream v { __version__ } ' )
59
+ .with_reducers (* ( reducer . compact_repr for reducer in reducers ) )
43
60
.with_authors (* authors )
44
- .with_beamline (beamline = 'DREAM' , facility = 'ESS' )
61
+ .with_beamline (beamline , source )
45
62
.with_powder_calibration (calibration .to_cif_format ())
46
63
.with_reduced_powder_data (to_save )
47
64
)
0 commit comments