5.5. Tools¶
Utilities complementing the core functionalities. Includes post-processing and visualizations.
5.5.1. HDF interface¶
Handles saving and loading of sparse matrices to/from HDF files.
- Currently supported formats:
- scipy.sparse.csc_matrix
- scipy.sparse.csr_matrix
- scipy.sparse.dia_matrix
-
tomotok.core.tools.hdf.
cs_to_hdf
(matrix: typing.Union[scipy.sparse.csc.csc_matrix, scipy.sparse.csr.csr_matrix], group: h5py._hl.group.Group) Saves compressed sparse matrix to hdf group.
-
tomotok.core.tools.hdf.
dia_to_hdf
(matrix: scipy.sparse.dia.dia_matrix, group: h5py._hl.group.Group) Saves dia matrix to hdf group.
-
tomotok.core.tools.hdf.
hdf_to_cs
(group: h5py._hl.group.Group) → typing.Union[scipy.sparse.csc.csc_matrix, scipy.sparse.csr.csr_matrix] Loads compressed sparse matrix from hdf group.
-
tomotok.core.tools.hdf.
hdf_to_dia
(group: h5py._hl.group.Group) → scipy.sparse.dia.dia_matrix Loads dia matrix from hdf group.
-
tomotok.core.tools.hdf.
hdf_to_sparse
(group: h5py._hl.group.Group) → scipy.sparse.base.spmatrix Loads scipy.sparse matrix of formats (csc, csr, dia) from hdf file group.
-
tomotok.core.tools.hdf.
sparse_to_hdf
(matrix: typing.Union[scipy.sparse.dia.dia_matrix, scipy.sparse.csc.csc_matrix, scipy.sparse.csr.csr_matrix], group: h5py._hl.group.Group) Saves scipy.sparse matrix of formats (csc, csr, dia) into hdf file group.
5.5.2. Post Processing¶
Processing of tomography results. Planned to be expanded. Currently only power computation implemented.
-
tomotok.core.tools.postproc.
compute_power
(recs, grid) Computes total radiated power from whole reconstruction area.
Parameters: grid : RegularGrid
Returns: numpy.ndarray
Contains values of total radiated power for all time slices
5.5.3. Projection space¶
Transforms lines of sights into projections space parametrization.
-
tomotok.core.tools.projection.
projection_space
(chords, centre=(0, 0), magnetics=None, maglvl=1) Parameters: chords : tuple
centre : tuple of float
magnetics : dict
maglvl : float, list of float
Returns: fig : matplotlib.figure