File tree Expand file tree Collapse file tree 4 files changed +93
-4
lines changed Expand file tree Collapse file tree 4 files changed +93
-4
lines changed Original file line number Diff line number Diff line change 1
1
.. _mantid.utils :
2
2
3
+
3
4
====================
4
5
:mod: `mantid.utils `
5
6
====================
@@ -10,10 +11,10 @@ can be used as a library to pull internal functions from an algorithm
10
11
so that the code can be shared with external software needing the
11
12
same functionality without the need to duplicate code.
12
13
13
- Unit tests for functions in this module should be placed in the
14
- `` Framework/PythonInterface/test/python/mantid/utils/ `` directory and
15
- added to its `` CMakeLists.txt `` to make sure the testing code gets
16
- registered with Mantid.
14
+ .. toctree ::
15
+ :maxdepth: 1
16
+
17
+ reflectometry
17
18
18
19
19
20
Calling functions from ``utils ``
@@ -69,3 +70,12 @@ can be called from different algorithms.
69
70
element_size = 2 , # integration element cube in mm
70
71
cache_dir = " /tmp" , # cache diretory for speeding up repeated calculation
71
72
)
73
+
74
+
75
+ Testing ``utils ``
76
+ =================
77
+
78
+ Unit tests for functions in this module should be placed in the
79
+ ``Framework/PythonInterface/test/python/mantid/utils/ `` directory and
80
+ added to its ``CMakeLists.txt `` to make sure the testing code gets
81
+ registered with Mantid.
Original file line number Diff line number Diff line change
1
+ .. _mantid.utils.reflectometry :
2
+
3
+ Reflectometry Utilities
4
+ =======================
5
+
6
+
7
+ ORSO format IO
8
+ --------------
9
+
10
+ The ``mantid.utils.reflectometry.orso_helper `` module provides functionality for reading and saving
11
+ reflectivity data in the ORSO standard [#ORSO ]_ format.
12
+ The orsopy library [#orsopy ]_ is used to collect numerical data as well as metadata into meaningful data structures
13
+ which are later assembled and written out to file.
14
+ The file's format can be ASCII (``.ort ``) or binary Nexus (``.orb ``).
15
+
16
+ The ``orso_helper `` module defines classes such as ``MantidORSOSaver ``, ``MantidORSODataset ``,
17
+ and ``MantidORSODataColumns `` to facilitate the creation, manipulation, and saving of ORSO datasets.
18
+ The ``MantidORSOSaver `` class manages the saving of datasets in ASCII or Nexus formats,
19
+ while the ``MantidORSODataset `` class constructs the dataset with necessary metadata and data columns.
20
+ Finally, the ``MantidORSODataColumns `` class handles the addition and management of data columns and their
21
+ associated metadata.
22
+
23
+
24
+ .. image :: /images/orso_helper.png
25
+ :alt: Class diagram showing the main classes and their relationships
26
+ :width: 50%
27
+
28
+ This module integrates with the rest of the Mantid framework to ensure that reflectivity is standardized
29
+ and shared in compliance with ORSO specifications.
30
+ For instance, the module provides the backend functionality for the implementation of algorithm
31
+ :ref: `algm-SaveISISReflectometryORSO `.
32
+
33
+
34
+ References
35
+ ----------
36
+
37
+ .. [#ORSO ] ORSO file format specification: `https://www.reflectometry.org/file_format/specification <https://www.reflectometry.org/file_format/specification >`_
38
+ .. [#orsopy ] orsopy Python library: `https://orsopy.readthedocs.io/en/latest/ <https://orsopy.readthedocs.io/en/latest/ >`_
Original file line number Diff line number Diff line change
1
+ @startuml
2
+
3
+ class orsopy . Column {}
4
+
5
+ class orsopy . ErrorColumn {}
6
+
7
+ class orsopy . OrsoDataset {}
8
+
9
+ class orsopy . Orso {}
10
+
11
+ class orsopy . Header {}
12
+
13
+ class MantidORSOSaver {
14
+ - _datasets: List[MantidORSODataset]
15
+ + add_dataset(dataset: MantidORSODataset)
16
+ + save_orso_ascii ()
17
+ + save_orso_nexus ()
18
+ }
19
+
20
+ class MantidORSODataset {
21
+ - _data_columns : MantidORSODataColumns
22
+ - _header: orsopy.Orso(_data_columns.header_info,...)
23
+ + dataset() : OrsoDataset(_header, _data_columns.data)
24
+ }
25
+
26
+ class MantidORSODataColumns {
27
+ + data: np.ndarray
28
+ + header_info: List[Union[Column, ErrorColumn]]
29
+ }
30
+
31
+ orsopy . Orso <-- orsopy . Header
32
+
33
+ MantidORSOSaver "1" *-- "0..* " MantidORSODataset
34
+ MantidORSODataset *-- MantidORSODataColumns
35
+ MantidORSODataset *-- orsopy . Orso
36
+ MantidORSODataset ..> orsopy . OrsoDataset : returns
37
+
38
+ MantidORSODataColumns "1" *-- "0..* " orsopy . Column
39
+ MantidORSODataColumns "1" *-- "0..* " orsopy . ErrorColumn
40
+
41
+ @enduml
You can’t perform that action at this time.
0 commit comments