5.4. PhantomsΒΆ
This module contains simple artificial data generation methods. These data can be isotropic or based on provided magnetics data. Method for creation of artificial magnetic data similar to circular or elliptic plasma is included.
Contains functions that can create emissivity phantoms.
Both isotropic one or based on the shape of flux surfaces.
-
tomotok.core.phantoms.
gauss
(x, w=0.1, lim=1, amp=1, cen=0.0) Creates anisotropic gaussian artificial emissivity by 1D transform of x
\[f = amp \left( \mathrm{e}^{-(x-cen)^2 / w } - \mathrm{e}^{-(lim-cen)^2 / w)} \right)\]Can be used on np.ndarray. Lim should be greater than cen.
Parameters: x : float, array, np.ndarray
Contains values to be transformed, usually psi
w : float, optional
width of gaussian profile
lim : float, optional
minimal value of x where transform gives zero if x > lim emissivity is set to zero
amp : float, optional
amplitude of gaussian profile,
cen : float, optional
center of gaussian profile allows hollow profile generation when mapped on psi
Returns: numpy.ndarray
Transformed values of x with same dimensions
-
tomotok.core.phantoms.
gauss_iso
(nx, ny, span=1.2, w=0.1, lim=1, amp=1, cen=0) Creates isotropic gaussian distribution. See references for iso_psi and gauss
-
tomotok.core.phantoms.
islands
(psi, w=0.01, lim=1, amp=1, cen=0.4, num=3, shift=0) Creates island like phantom from given psi profile. See references for gauss and polar_phase.
-
tomotok.core.phantoms.
iso_psi
(nx, ny, span=1.5) Creates matrix of artificial isotropic psi profile with border values for each axis equal to span.
Parameters: nx : int
Number of pixels on x axis
ny : int
Number of pixels on y axis
span : float, optional
Value of result on the center of border
Returns: numpy.ndarray
Matrix with generated profile
-
tomotok.core.phantoms.
polar_phase
(x, num=3, shift=0) Applies sine phase in radial angle direction to given profile x.
Parameters: x : numpy.ndarray
Profile for application of polar phase.
num : int, optional
number of periods per one rotation
shift : float, optional
initial phase shift
Returns: numpy.ndarray
Matrix with applied polar phase