Repository navigation
Expand file tree
/
Copy pathDosimetryTable.python.cpp
More file actions
136 lines (112 loc) · 2.91 KB
/
Copy pathDosimetryTable.python.cpp
File metadata and controls
136 lines (112 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ACEtk/Table.hpp"
#include "ACEtk/DosimetryTable.hpp"
#include "ACEtk/fromFile.hpp"
#include "definitions.hpp"
// namespace aliases
namespace python = pybind11;
void wrapDosimetryTable( python::module& module, python::module& ) {
// type aliases
using HeaderVariant = njoy::ACEtk::Table::HeaderVariant;
using Table = njoy::ACEtk::DosimetryTable;
using MTR = njoy::ACEtk::continuous::MTR;
using SIGD = njoy::ACEtk::dosimetry::SIGD;
// wrap views created by this table
// create the table
python::class_< Table > table(
module,
"DosimetryTable",
"A dosimetry ACE table\n\n"
"The DosimetryTable class represents the ACE table for dosimetry data."
);
// wrap the table
table
.def(
python::init< unsigned int, unsigned int, HeaderVariant, MTR, SIGD >(),
python::arg( "z" ), python::arg( "a" ),
python::arg( "header" ), python::arg( "mtr" ), python::arg( "sigd" ),
"Initialise the table\n\n"
"Arguments:\n"
" self the table\n"
" z the Z number of the target\n"
" a the A number of the target\n"
" header the header for the table\n"
" mtr the reaction number block\n"
" sigd the cross section data block"
)
.def_property_readonly(
"zaid",
&Table::ZAID,
"The full ZAID or SZAID of the table"
)
.def_property_readonly(
"AWR",
&Table::AWR,
"The atomic weight ratio (with respect to the neutron mass)"
)
.def_property_readonly(
"atomic_weight_ratio",
&Table::atomicWeightRatio,
"The atomic weight ratio (with respect to the neutron mass)"
)
.def_property_readonly(
"TEMP",
&Table::TEMP,
"The temperature of the table"
)
.def_property_readonly(
"temperature",
&Table::temperature,
"The temperature of the table"
)
.def_property_readonly(
"date",
&Table::date,
"The date"
)
.def_property_readonly(
"length",
&Table::length,
"The total length of the XSS array"
)
.def_property_readonly(
"za",
&Table::ZA,
"The ZA of the target"
)
.def_property_readonly(
"NTR",
&Table::NTR,
"The number of available reactions (excluding elastic)"
)
.def_property_readonly(
"number_reactions",
&Table::numberReactions,
"The number of available reactions (excluding elastic)"
)
.def_property_readonly(
"MTR",
&Table::MTR,
"The reaction number block"
)
.def_property_readonly(
"reaction_number_block",
&Table::reactionNumberBlock,
"The reaction number block"
)
.def_property_readonly(
"SIGD",
&Table::SIGD,
"The cross section block"
)
.def_property_readonly(
"cross_section_block",
&Table::crossSectionBlock,
"The cross section block"
);
// add standard block definitions
addStandardTableDefinitions< Table >( table );
}