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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
%global _empty_manifest_terminate_build 0
Name: python-tofu
Version: 1.7.0
Release: 1
Summary: A python library for Tomography for Fusion
License: MIT
URL: https://github.com/ToFuProject/tofu
Source0: https://mirrors.aliyun.com/pypi/web/packages/47/fb/82b1be64a7651d9fde4d408149ff4fb32d4dd2bfea641ee67d209e8c8e22/tofu-1.7.0.tar.gz
BuildArch: noarch
%description
**tofu** stands for **To**mography for **Fu**sion, it is an IMAS-compatible open-source machine-independent python library.
tofu tries to take an active part in the plasma community open-source python environment, like [PlasmaPy](https://github.com/PlasmaPy/PlasmaPy), with which some degree of interoperability is being implemented.
It aims at providing the **fusion** and **plasma** community with an object-oriented, transparent and documented tool for designing **tomography diagnostics**, computing **synthetic signal** (direct problem) as well as **tomographic inversions** (inverse problem). It gives access to a full 3D description of the diagnostic geometry, thus reducing the impact of geometrical approximations on the direct and, most importantly, on the inverse problem.
**tofu** is relevant for all diagnostics integrating, in a finitie field of view or along a set of lines of sight, a quantity (scalar or vector) for which the plasma can be considered transparent (e.g.: light in the visible, UV, soft and hard X-ray ranges, or electron density for interferometers).
**tofu** is **command-line oriented**, for maximum flexibility and scriptability.
The absence of a GUI is compensated by built-in one-liners for interactive plots.
It has a sphinx-generated [documentation](https://tofuproject.github.io/tofu/index.html), and the code itself is hosted on [GitHub](https://github.com/ToFuProject/tofu).
## Examples Gallery
Here are some examples of what **tofu** can do
#### Built-in one-liners for interactive camera geometry visualization
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/CamLOS1D_touch.png" width="600" alt="Built-in one-liners for interactive camera geometry visualization"/>
</p>
#### ...both for 1D and 2D cameras, including the basics for multiple reflections handling
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/CamLOS2D_touch_refelect.png" width="600" alt="...both for 1D and 2D cameras, including the basics for multiple reflections handling"/>
</p>
#### Built-in plotting of sinograms
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/CamLOS1D_sino.png" width="600" alt="Built-in plotting of sinograms"/>
</p>
#### Basic magnetic field line tracing
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/MagfieldLines.png" width="600" alt="Basic magnetic field line tracing"/>
</p>
#### Multiple 1d profiles interactive plotting
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/Plasma2D_1dneTe.png" width="600" alt="Multiple 1d profiles interactive plotting"/>
</p>
#### Built-in basic data treatment and interactive plotting: svd and spectrograms
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/Plasma2D_1dneTe.png" width="600" alt="Built-in basic data treatment and interactive plotting: svd and spectrograms"/>
</p>
**tofu** provides the user with a series of python classes for creating, handling and visualizing a diagnostic geometry, meshes and basis functions,
geometry matrices, pre-treating experimental data and computing tomographic inversions.
Each one of these main tasks is accomplished by a dedicated module in the larger tofu package.
The geometry module is sufficient for diagnostic designing and for a synthetic diagnostic approach (i.e.: computing the integrated signal from a simulated 2D or 3D emissivity).
This geometry module allows in particular:
* To handle linear and toroidal vaccum vessels
* To define apertures and detectors as planar polygons of arbitrary shapes
* To automatically compute the full Volume of Sight (VOS) in 3D of each {detector+aperture(s)} set
* To discretise the VOS for a numerical 3D integration of a simulated emissivity in order to compute the associated signal
It is in this geometrical sense that tofu enables a synthetic diagnostic approach, it does not provide the tools for simulating the emissivity itself (that should be an input, provided by another code).
## IMAS-compatibility
IMAS is a standardized data structure, it comes as an extra layer on the database of any Tokamak to provide a machine-independent way of accessing scientific data.
tofu has built-in advanced classes for handling the interface with IMAS, hold in the imas2tofu sub-package.
It pre-supposes, of course, that IMAS is installed and operational next to your python install, but tofu does not require IMAS to run in general.
If IMAS is not available, tofu will simply display a warning stating that the imas2tofu sub-package is not usable.
tofu can thus easily load and handle multiple IDSs (IMAS data structure units) and provide command-line tools for exporting IMAS data to other general tofu classes (e.g.: Cameras, Plasma2D...) and for interactive plotting.
All tofu objects have methods to facailitate in-python-console introspection, the ``__repr__`` method is overloaded to display relevant information, an dthis is widely used to explore the data loaded from IMAS.
Do you want to use **tofu** on IMAS and don't know where to start?
%package -n python3-tofu
Summary: A python library for Tomography for Fusion
Provides: python-tofu
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-tofu
**tofu** stands for **To**mography for **Fu**sion, it is an IMAS-compatible open-source machine-independent python library.
tofu tries to take an active part in the plasma community open-source python environment, like [PlasmaPy](https://github.com/PlasmaPy/PlasmaPy), with which some degree of interoperability is being implemented.
It aims at providing the **fusion** and **plasma** community with an object-oriented, transparent and documented tool for designing **tomography diagnostics**, computing **synthetic signal** (direct problem) as well as **tomographic inversions** (inverse problem). It gives access to a full 3D description of the diagnostic geometry, thus reducing the impact of geometrical approximations on the direct and, most importantly, on the inverse problem.
**tofu** is relevant for all diagnostics integrating, in a finitie field of view or along a set of lines of sight, a quantity (scalar or vector) for which the plasma can be considered transparent (e.g.: light in the visible, UV, soft and hard X-ray ranges, or electron density for interferometers).
**tofu** is **command-line oriented**, for maximum flexibility and scriptability.
The absence of a GUI is compensated by built-in one-liners for interactive plots.
It has a sphinx-generated [documentation](https://tofuproject.github.io/tofu/index.html), and the code itself is hosted on [GitHub](https://github.com/ToFuProject/tofu).
## Examples Gallery
Here are some examples of what **tofu** can do
#### Built-in one-liners for interactive camera geometry visualization
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/CamLOS1D_touch.png" width="600" alt="Built-in one-liners for interactive camera geometry visualization"/>
</p>
#### ...both for 1D and 2D cameras, including the basics for multiple reflections handling
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/CamLOS2D_touch_refelect.png" width="600" alt="...both for 1D and 2D cameras, including the basics for multiple reflections handling"/>
</p>
#### Built-in plotting of sinograms
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/CamLOS1D_sino.png" width="600" alt="Built-in plotting of sinograms"/>
</p>
#### Basic magnetic field line tracing
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/MagfieldLines.png" width="600" alt="Basic magnetic field line tracing"/>
</p>
#### Multiple 1d profiles interactive plotting
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/Plasma2D_1dneTe.png" width="600" alt="Multiple 1d profiles interactive plotting"/>
</p>
#### Built-in basic data treatment and interactive plotting: svd and spectrograms
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/Plasma2D_1dneTe.png" width="600" alt="Built-in basic data treatment and interactive plotting: svd and spectrograms"/>
</p>
**tofu** provides the user with a series of python classes for creating, handling and visualizing a diagnostic geometry, meshes and basis functions,
geometry matrices, pre-treating experimental data and computing tomographic inversions.
Each one of these main tasks is accomplished by a dedicated module in the larger tofu package.
The geometry module is sufficient for diagnostic designing and for a synthetic diagnostic approach (i.e.: computing the integrated signal from a simulated 2D or 3D emissivity).
This geometry module allows in particular:
* To handle linear and toroidal vaccum vessels
* To define apertures and detectors as planar polygons of arbitrary shapes
* To automatically compute the full Volume of Sight (VOS) in 3D of each {detector+aperture(s)} set
* To discretise the VOS for a numerical 3D integration of a simulated emissivity in order to compute the associated signal
It is in this geometrical sense that tofu enables a synthetic diagnostic approach, it does not provide the tools for simulating the emissivity itself (that should be an input, provided by another code).
## IMAS-compatibility
IMAS is a standardized data structure, it comes as an extra layer on the database of any Tokamak to provide a machine-independent way of accessing scientific data.
tofu has built-in advanced classes for handling the interface with IMAS, hold in the imas2tofu sub-package.
It pre-supposes, of course, that IMAS is installed and operational next to your python install, but tofu does not require IMAS to run in general.
If IMAS is not available, tofu will simply display a warning stating that the imas2tofu sub-package is not usable.
tofu can thus easily load and handle multiple IDSs (IMAS data structure units) and provide command-line tools for exporting IMAS data to other general tofu classes (e.g.: Cameras, Plasma2D...) and for interactive plotting.
All tofu objects have methods to facailitate in-python-console introspection, the ``__repr__`` method is overloaded to display relevant information, an dthis is widely used to explore the data loaded from IMAS.
Do you want to use **tofu** on IMAS and don't know where to start?
%package help
Summary: Development documents and examples for tofu
Provides: python3-tofu-doc
%description help
**tofu** stands for **To**mography for **Fu**sion, it is an IMAS-compatible open-source machine-independent python library.
tofu tries to take an active part in the plasma community open-source python environment, like [PlasmaPy](https://github.com/PlasmaPy/PlasmaPy), with which some degree of interoperability is being implemented.
It aims at providing the **fusion** and **plasma** community with an object-oriented, transparent and documented tool for designing **tomography diagnostics**, computing **synthetic signal** (direct problem) as well as **tomographic inversions** (inverse problem). It gives access to a full 3D description of the diagnostic geometry, thus reducing the impact of geometrical approximations on the direct and, most importantly, on the inverse problem.
**tofu** is relevant for all diagnostics integrating, in a finitie field of view or along a set of lines of sight, a quantity (scalar or vector) for which the plasma can be considered transparent (e.g.: light in the visible, UV, soft and hard X-ray ranges, or electron density for interferometers).
**tofu** is **command-line oriented**, for maximum flexibility and scriptability.
The absence of a GUI is compensated by built-in one-liners for interactive plots.
It has a sphinx-generated [documentation](https://tofuproject.github.io/tofu/index.html), and the code itself is hosted on [GitHub](https://github.com/ToFuProject/tofu).
## Examples Gallery
Here are some examples of what **tofu** can do
#### Built-in one-liners for interactive camera geometry visualization
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/CamLOS1D_touch.png" width="600" alt="Built-in one-liners for interactive camera geometry visualization"/>
</p>
#### ...both for 1D and 2D cameras, including the basics for multiple reflections handling
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/CamLOS2D_touch_refelect.png" width="600" alt="...both for 1D and 2D cameras, including the basics for multiple reflections handling"/>
</p>
#### Built-in plotting of sinograms
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/CamLOS1D_sino.png" width="600" alt="Built-in plotting of sinograms"/>
</p>
#### Basic magnetic field line tracing
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/MagfieldLines.png" width="600" alt="Basic magnetic field line tracing"/>
</p>
#### Multiple 1d profiles interactive plotting
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/Plasma2D_1dneTe.png" width="600" alt="Multiple 1d profiles interactive plotting"/>
</p>
#### Built-in basic data treatment and interactive plotting: svd and spectrograms
<p align="center">
<img align="middle" src="https://github.com/ToFuProject/tofu/blob/master/README_figures/Plasma2D_1dneTe.png" width="600" alt="Built-in basic data treatment and interactive plotting: svd and spectrograms"/>
</p>
**tofu** provides the user with a series of python classes for creating, handling and visualizing a diagnostic geometry, meshes and basis functions,
geometry matrices, pre-treating experimental data and computing tomographic inversions.
Each one of these main tasks is accomplished by a dedicated module in the larger tofu package.
The geometry module is sufficient for diagnostic designing and for a synthetic diagnostic approach (i.e.: computing the integrated signal from a simulated 2D or 3D emissivity).
This geometry module allows in particular:
* To handle linear and toroidal vaccum vessels
* To define apertures and detectors as planar polygons of arbitrary shapes
* To automatically compute the full Volume of Sight (VOS) in 3D of each {detector+aperture(s)} set
* To discretise the VOS for a numerical 3D integration of a simulated emissivity in order to compute the associated signal
It is in this geometrical sense that tofu enables a synthetic diagnostic approach, it does not provide the tools for simulating the emissivity itself (that should be an input, provided by another code).
## IMAS-compatibility
IMAS is a standardized data structure, it comes as an extra layer on the database of any Tokamak to provide a machine-independent way of accessing scientific data.
tofu has built-in advanced classes for handling the interface with IMAS, hold in the imas2tofu sub-package.
It pre-supposes, of course, that IMAS is installed and operational next to your python install, but tofu does not require IMAS to run in general.
If IMAS is not available, tofu will simply display a warning stating that the imas2tofu sub-package is not usable.
tofu can thus easily load and handle multiple IDSs (IMAS data structure units) and provide command-line tools for exporting IMAS data to other general tofu classes (e.g.: Cameras, Plasma2D...) and for interactive plotting.
All tofu objects have methods to facailitate in-python-console introspection, the ``__repr__`` method is overloaded to display relevant information, an dthis is widely used to explore the data loaded from IMAS.
Do you want to use **tofu** on IMAS and don't know where to start?
%prep
%autosetup -n tofu-1.7.0
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-tofu -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Thu Jun 08 2023 Python_Bot <Python_Bot@openeuler.org> - 1.7.0-1
- Package Spec generated
|