77from scippneutron .io import cif
88
99from 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+ )
1118
1219
1320def 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 ,
1528) -> ReducedTofCIF :
1629 """Construct a CIF builder with reduced data in d-spacing.
1730
@@ -24,6 +37,12 @@ def prepare_reduced_tof_cif(
2437 Reduced 1d data with a ``'tof'`` dimension and coordinate.
2538 authors:
2639 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.
2746 calibration:
2847 Coefficients for conversion between d-spacing and final ToF.
2948 See :meth:`scippneutron.io.cif.CIF.with_powder_calibration`.
@@ -34,14 +53,12 @@ def prepare_reduced_tof_cif(
3453 An object that contains the reduced data and metadata.
3554 Us its ``save`` method to write the CIF file.
3655 """
37- from .. import __version__
38-
3956 to_save = _prepare_data (da )
4057 return ReducedTofCIF (
4158 cif .CIF ('reduced_tof' )
42- .with_reducers (f'ess.dream v { __version__ } ' )
59+ .with_reducers (* ( reducer . compact_repr for reducer in reducers ) )
4360 .with_authors (* authors )
44- .with_beamline (beamline = 'DREAM' , facility = 'ESS' )
61+ .with_beamline (beamline , source )
4562 .with_powder_calibration (calibration .to_cif_format ())
4663 .with_reduced_powder_data (to_save )
4764 )
0 commit comments