Skip to content

Types

dexter.types

Type Aliases used throughout the package.

ArrayShape: TypeAlias = tuple[int, ...] module-attribute

Shape of a numpy array.

Array: TypeAlias = np.ndarray[ArrayShape, np.dtype[np.float64]] module-attribute

ND numpy array.

Array1: TypeAlias = np.ndarray[tuple[int], np.dtype[np.float64]] module-attribute

1D numpy array.

Array2: TypeAlias = np.ndarray[tuple[int, int], np.dtype[np.float64]] module-attribute

2D numpy array.

ArrayLike: TypeAlias = np.typing.ArrayLike module-attribute

Objects that can be converted to arrays, i.e. float, np.ndarray, sequences, ...

Re-export of np.typing.ArrayLike.

ParticleSpecies: TypeAlias = Literal['Electron', 'Proton', 'Deuterium', 'Tritium', 'Alpha', 'He3'] module-attribute

The particle species under study. This only affects unit conversions to SI.

Unit: TypeAlias = Literal['NormMeter', 'NormTesla', 'NormSecond', 'NormHertz', 'NormJoule', 'NormVolt'] | str module-attribute

Strings parsed by pint as units, with the normalized units added.

Locator: TypeAlias = Literal['Log', 'MaxN'] module-attribute

Tick locator for contour plots.

  • Log: Uses matplotlib.ticker.LogLocator.
  • MaxN: Uses matplotlib.ticker.MaxNLocator.

When the contour levels span is large, a LogLocator helps in better displaying the levels.

MachineType: TypeAlias = Literal['Analytical', 'Numerical'] module-attribute

Describes the type of machine the object represents.

Numerical

Configuration reconstructed from numerical data. Evaluations are calculated by interpolation.

Analytical

Machine described by analytical formulas. Evaluations are calculated by simply evaluating the formulas.

NetCDFVersion: TypeAlias = Version module-attribute

The netCDF convention version (SemVer).

MagneticFluxKind: TypeAlias = Literal['Toroidal', 'Poloidal'] module-attribute

Magnetic flux coordinates $\psi_t$ and $\psi_p$.

FluxCoordinateState: TypeAlias = Literal['Good', 'Bad', 'None'] module-attribute

Flux coordinate state.

Good

Values exist and are increasing. Can be used as an x coordinate for evaluations.

Bad

Values exist but are not monotonic. Can only be used as y-data.

None

Variable does not exist or is empty.

Interpolation1dType: TypeAlias = Literal['Linear', 'Cubic', 'CubicPeriodic', 'Akima', 'AkimaPeriodic', 'Steffen'] module-attribute

Available 1D Interpolation types

Linear

Simple linear interpolation

Cubic

Cubic spline with natural boundary conditions. The resulting curve is piecewise cubic on each interval, with matching first and second derivatives at the supplied data-points. The second derivative is chosen to be zero at the first point and last point.

CubicPeriodic

Cubic spline with periodic boundary conditions. The resulting curve is piecewise cubic on each interval, with matching first and second derivatives at the supplied data-points. The derivatives at the first and last points are also matched. Note that the last point in the data must have the same y-value as the first point, otherwise the resulting periodic interpolation will have a discontinuity at the boundary.

Akima

Non-rounded Akima spline with natural boundary conditions. This method uses the non-rounded corner algorithm of Wodicka.

AkimaPeriodic

Non-rounded Akima spline with periodic boundary conditions. This method uses the non-rounded corner algorithm of Wodicka.

Steffen

Steffen interpolation. Steffen’s method guarantees the monotonicity of the interpolating function between the given data points. Therefore, minima and maxima can only occur exactly at the data points, and there can never be spurious oscillations between data points. The interpolated function is piecewise cubic in each interval. The resulting curve and its first derivative are guaranteed to be continuous, but the second derivative may be discontinuous.

Interpolation2dType: TypeAlias = Literal['Bilinear', 'Bicubic'] module-attribute

Available 2D Interpolation Types.

Bilinear

Simple bilinear interpolation.

Bicubic

Bicubic Interpolation.

PhaseMethod: TypeAlias = Literal['Zero', 'Average', 'Interpolation'] | tuple[Literal['Custom'], float] module-attribute

Defines the calculation method of the phase $\phi$ in a Numerical Harmonic.

Zero

Corresponds to $\phi = 0$.

Average

Corresponds to $\phi = const =$ the average of all the values of the phase_array.

Interpolation

Interpolation over the phase_array.

Custom(float)

Use a custom value for $\phi = const$.

EnergyPzetaPosition = Literal['Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta', 'Iota', 'Kappa', 'Lambda', 'Mu', 'Unclassified', 'Forbidden'] module-attribute

The position of an $(E, P_\zeta)$ point on the $(E, P_\zeta)$ plane, relative to the orbit classification curves.

Hint

See the "$E-P_\zeta$ Positions" section on the Diagrams tab for explanation.

OrbitType: TypeAlias = Literal['Unclassified', 'TrappedLost', 'TrappedConfined', 'CoPassingLost', 'CoPassingConfined', 'CuPassingLost', 'CuPassingConfined', 'Potato', 'Stagnated', 'Undefined'] module-attribute

A particle's orbit type, calculated through the [dexter.Particle.close()] routine.

  • Unclassified: Particle has not been classified.
  • TrappedLost: A Trapped-Lost particle. A particle is called trapped if there exists a mirror point where $\rho=0$.
  • TrappedConfined: A Trapped-Confined particle. A particle is called trapped if there exists a mirror point where $\rho=0$.
  • CoPassingLost: A CoPassing-Lost particle. A particle is called co-passing if it is not trapped and it holds that $\dot\theta>0$.
  • CoPassingConfined: A CoPassing-Confined particle. A particle is called co-passing if it is not trapped and it holds that $\dot\theta>0$.
  • CuPassingLost: A CounterPassing-Lost particle. A particle is called counter-passing if it is not trapped and it holds that $\dot\theta<0$.
  • CuPassingConfined: A CounterPassing-Confined particle. A particle is called counter-passing if it is not trapped and it holds that $\dot\theta<0$.
  • Potato: A Potato particle. A particle’s orbit is called a potato orbit if it is trapped but still circles the magnetic axis due to its drift. In the $(E, P_\zeta)$ plane, those lie inside the intersection of the trapped-passing boundary and the magnetic axis parabola.
  • Stagnated: A Stagnated particle. A particle is called stagnated if it always has positive parallel velocity but does not circle the magnetic axis. In the $(E, P_\zeta)$ plane, those lie to the right of the trapped-passing boundary and above the magnetic axis parabola.
  • Undefined: Not falling under any of the other categories.

Hint

See the "$E-P_\zeta$ Positions" section on the Diagrams tab for explanation.

CriticalPointKind: TypeAlias = Literal['Unknown', 'OpointMin', 'OpointMax', 'Xpoint'] module-attribute

The kind of a CriticalPoint

  • Unknown: Unknown kind.
  • OpointMin: O-point and local minimum of the Hamiltonian.
  • OpointMax: O-point and local maximum of the Hamiltonian.
  • Xpoint: X-point of the Hamiltonian.

BoundaryExtremumKind: TypeAlias = Literal['Unknown', 'Minimum', 'Maximum'] module-attribute

The kind of a BoundaryExtremum

  • Unknown: Unknown kind.
  • Minimum: Extremum point of minimum energy.
  • Maximum: Extremum point of maximum energy.

CoordinateSet: TypeAlias = Literal['BoozerToroidal', 'BoozerPoloidal', 'MixedToroidal', 'MixedPoloidal'] module-attribute

The kind of InitialConditions set.

  • BoozerToroidal: Initial conditions set in the $(t, \psi_t, \theta, \zeta, \rho, \mu)$ space.
  • BoozerPoloidal: Initial conditions set in the $(t, \psi_p, \theta, \zeta, \rho, \mu)$ space.
  • MixedToroidal: Initial conditions set in the $(t, P_\zeta, \psi_t, \theta, \zeta, \mu)$ space.
  • MixedPoloidal: Initial conditions set in the $(t, P_\zeta, \psi_p, \theta, \zeta, \mu)$ space.

Intersection: TypeAlias = Literal['ConstZeta', 'ConstTheta'] module-attribute

Defines the surface of the Poincare section.

  • ConstTheta: Defines a surface of $\theta = const$.
  • ConstZeta: Defines a surface of $\zeta = const$.

Directionality: TypeAlias = Literal['Initial', 'Both', 'DotPositive', 'DotNegative'] module-attribute

Defines the method with which Poincare intersections are recorded by taking into consideration the direction of the corresponding angle.

  • Initial: Only intersections with a direction equal to the direction of the initial point are recorded ($\dot\theta=\dot\theta_0$ or $\dot\zeta=\dot\zeta_0$).
  • Both: All intersections are recorded, regardless of the direction.
  • DotPositive: Only intersections with $\dot\theta>0$ or $\dot\zeta>0$ are recorded.
  • DotNegative: Only intersections with $\dot\theta<0$ or $\dot\zeta<0$ are recorded.

IntegrationStatus: TypeAlias = Literal['Initialized', 'PartiallyInitialized', 'NanInitialConditions', 'BadMagneticFlux', 'OutOfBoundsInitialization', 'Integrated', 'Intersected', 'ClosedPeriods(..)', 'Escaped', 'ModStateEscaped', 'IntersectedTimedOut', 'InvalidIntersections', 'TimedOut(...)', 'Failed(...)'] module-attribute

The integration status of a Particle.

  • Initialized: Initialized by InitialConditions, not integrated.
  • PartiallyInitialized: InitialConditions have not been fully calculated yet.
  • NanInitialConditions: Encountered NaN when finalizing the initial conditions.
  • BadMagneticFlux: Particle initialized with a 'bad' initial magnetic flux.
  • OutOfBoundsInitialization: InitialConditions where out of bounds.
  • Integrated: Reached the end of the integration successfully.
  • Intersected: Intersections calculation successful.
  • ClosedPeriods(..): Integrated for a certain amount of θ-ψ periods.
  • Escaped: Escaped the last closed flux surface (LCFS).
  • ModStateEscaped: Escaped when performing a step on the modified system. This indicates that something is wrong in Hénon’s trick implementation.
  • IntersectedTimedOut: Calculated some intersections correctly but also timed out.
  • InvalidIntersections: Calculated invalid intersections.
  • TimedOut(...): Timed out after a maximum number of steps.
  • Failed(...): Simulation failed for unknown reasons.

Routine: TypeAlias = Literal['Integrate', 'Intersect', 'Close', 'Classify'] module-attribute

Available Queue routines.