5.2. Database access (IO)#
5.2.1. Diagnostic system#
Basic interface with detectors.
- class tomotok.tools.io.Diagnostic
Bases:
objectBase class for diagnostics. Should be subclassed for specific diagnostics.
Methods
load_data(shot[, tvec])Loads diagnostic data from database specified by source.
- load_data(shot: int, tvec: ArrayLike | None = None) Signals
Loads diagnostic data from database specified by source.
- Parameters:
- shotint
Shot number for which the diagnostic data is loaded.
- tvecArrayLike, optional
specifies timeslices to be loaded, if not provided, all available timeslices are loaded
- sourcestr, optional
specifies source for loading diagnostic data
- Returns:
- Signals
Loaded diagnostics signal stored in Signals container
5.2.2. Tokamak#
Adds methods for handling magnetics data in format typical for tokamak equilibrium.
- class tomotok.tools.io.Tokamak(divertor_area_r: ArrayLike | None = None, divertor_area_z: ArrayLike | None = None)
Bases:
objectA Template class that should be subclassed for specific tokamaks.
Currently only defines a template method for loading magnetic field data for subclasses and stores divertor area.
- Attributes:
- divertor_area_rarray-like, optional
radial coordinates of divertor area boundary polygon
- divertor_area_zarray-like, optional
vertical coordinates of divertor area boundary polygon
Methods
load_magnetic_field(shot[, tvec])Loads magnetic field data from database for given shot and time slices.
- load_magnetic_field(shot: int, tvec: ArrayLike = None) Magnetics
Loads magnetic field data from database for given shot and time slices.
Specific implementation should be provided in subclass.
- Parameters:
- shotint
Shot number for which the magnetic field is loaded.
- tvecarray-like, optional
specifies vector of time slices to be loaded, if not provided, all available time slices are loaded
- Returns:
- Magnetics
Psi normalized stored in Magnetics dataclass container