API: vaft.data
Generated from each module's __all__ by python -m vaft._api_catalog:
278 published objects in 29 modules.
Signatures and summaries are read from the source; nothing here is written by hand.
All API pages
No object matches.
vaft.data
File-format and data-structure compatibility helpers.
ANALYTIC_STATE_UNITS
data
ANALYTIC_STATE_UNITS = <builtins.mappingproxy>
CLOSURE_MODES
data
CLOSURE_MODES = ('equilibrium_pressure', 'kinetic_pressure')
CURRENT_NORMALIZATIONS
data
CURRENT_NORMALIZATIONS = <builtins.mappingproxy>
CURRENT_POLICIES
data
CURRENT_POLICIES = ('preserve_ffprime_shape', 'analytic_ffprime_shape')
ION_SPECIES
data
ION_SPECIES = <builtins.mappingproxy>
ITERATION_STATUSES
data
ITERATION_STATUSES = ('converged', 'max_iterations', 'diverged', 'oscillating', 'stagnated', 'drifting', 'kinetic_generation_failed', 'inv...
KIN_COLUMNS
data
KIN_COLUMNS = ('psi_norm', 'n_i', 'n_e', 'T_i', 'T_e', 'omega_exb')
KIN_HEADER
data
KIN_HEADER = ' psi ni(m^-3) ne(m^-3) ti(eV) te(eV) wexb(rad/s)'
KINETIC_UNITS
data
KINETIC_UNITS = <builtins.dict>
MARS_FIELD_FILES
data
MARS_FIELD_FILES = <builtins.dict>
MARS_PROFILE_FILES
data
MARS_PROFILE_FILES = <builtins.dict>
MARS_PROFILE_LABELS
data
MARS_PROFILE_LABELS = <builtins.dict>
MARS_RADIAL_VARIABLES
data
MARS_RADIAL_VARIABLES = <builtins.dict>
PFILE_LABELS
data
PFILE_LABELS = <builtins.dict>
PFILE_SECTION_ORDER
data
PFILE_SECTION_ORDER = ('ne', 'ni', 'nz1', 'nb', 'te', 'ti', 'ptot', 'pb', 'omeg', 'omegp', 'omgvb', 'omgpp', 'omgeb', 'er', 'ommvb', 'ommpp...
PFILE_TO_CONTAINER
data
PFILE_TO_CONTAINER = <builtins.dict>
PFILE_UNIT_LADDER
data
PFILE_UNIT_LADDER = <builtins.dict>
PFILE_UNITS
data
PFILE_UNITS = <builtins.dict>
PRESSURE_CLOSURES
data
PRESSURE_CLOSURES = <builtins.dict>
PRESSURE_CONSTRAINTS
data
PRESSURE_CONSTRAINTS = ('equilibrium', 'thermal_energy', 'kinetic')
PROFILE_FIELDS
data
PROFILE_FIELDS = ('n_e', 'n_i', 'n_z', 'n_fast', 'T_e', 'T_i', 'T_z', 'omega_tor', 'omega_exb', 'omega_pol', 'p_total', 'p_fast', 'e_r...
SCALAR_TARGET_KINDS
data
SCALAR_TARGET_KINDS = ('axis', 'separatrix', 'line_average', 'volume_average', 'greenwald_fraction')
STATE_STATUSES
data
STATE_STATUSES = ('initial', 'accepted', 'kinetic_generation_failed', 'invalid_pressure_source', 'chease_failed', 'validation_failed')
SYNTHETIC_PROFILE_STATUSES
data
SYNTHETIC_PROFILE_STATUSES = ('success', 'invalid_equilibrium', 'invalid_profile_model', 'invalid_gradient_model', 'invalid_normalization', 'inval...
SYNTHETIC_PROFILE_UNITS
data
SYNTHETIC_PROFILE_UNITS = <builtins.mappingproxy>
unified_diagnostics_fixture
function
source
unified_diagnostics_fixture()
Load the offline VEST cross-shot fixture as an OMAS ODS.
unified_diagnostics_manifest
function
source
unified_diagnostics_manifest() -> dict
Validate and return the provenance contract for the VEST cross-shot fixture.
VAFT_INTERNAL_COCOS
data
VAFT_INTERNAL_COCOS = 11
vaft.data.aeqdsk
Parser for EFIT a-files, mapped from EFIT/efit/write_a.f90.
AEQDSK
class
source
AEQDSK(shot: int, time_ms: float, jflag: int, lflag: int, limloc: str, nco2v: int, nco2r: int, qmflag: str, nlold: int, nlnew: int, scalars: Mapping[str, float], arrays: Mapping[str, np.ndarray], counts: Mapping[str, int], fit_type: str = '', source: Path | None = None) -> None
One EFIT a-file, named per write_a.f90.
15 fields · 5 members
shot: inttime_ms: floatjflag: intlflag: intlimloc: strnco2v: intnco2r: intqmflag: strnlold: intnlnew: intscalars: Mapping[str, float]arrays: Mapping[str, np.ndarray]counts: Mapping[str, int]fit_type: strsource: Path | Nonechisqproperty — EFIT’s own total chi-square for the slice. sourceterrorproperty — Final normalized Grad-Shafranov iteration error. sourceacceptedproperty — EFIT’s acceptance verdict. sourcetime_secondsproperty sourceto_omasmethod — Store the a-file as equilibrium code parameters for one slice. source
AEQDSKError
class
source
Raised when an a-file cannot be read as one.
COUNT_NAMES
data
COUNT_NAMES = ('nsilop', 'magpri', 'nfsum', 'nesum')
HEAD_SCALARS
data
HEAD_SCALARS = ('chisq', 'rcencm', 'bcentr', 'ipmeas', 'ipmhd', 'rcntr', 'zcntr', 'aminor', 'elong', 'utri', 'ltri', 'volume', 'rcur...
read_aeqdsk
function
source
read_aeqdsk(path: str | Path) -> AEQDSK
Read a formatted EFIT a-file into the fields write_a.f90 writes.
Also exported as vaft.data.read_aeqdsk.
SENTINELS
data
SENTINELS = (100000000000.0, -999.0)
SIGNAL_ARRAYS
data
SIGNAL_ARRAYS = ('csilop', 'cmpr2', 'ccbrsp', 'eccurt')
TAIL_SCALARS
data
TAIL_SCALARS = ('shear', 'bpolav', 's1', 's2', 's3', 'qout', 'sepin', 'sepout', 'septop', 'sibdry', 'area', 'wmhd', 'terror', 'elong...
TRAILING_SCALARS
data
TRAILING_SCALARS = ('pbinj', 'rvsin', 'zvsin', 'rvsout', 'zvsout', 'unused_1', 'unused_2', 'unused_3', 'unused_4', 'unused_5', 'zuperts'...
vaft.data.analytic_plasma_state
Records for analytic confinement-regime plasma states (#1045).
ANALYTIC_STATE_UNITS
data
ANALYTIC_STATE_UNITS = <builtins.mappingproxy>
AnalyticPlasmaState
class
source
AnalyticPlasmaState(label: str, psi_norm: np.ndarray, n_e: np.ndarray, n_i: np.ndarray, n_impurity: np.ndarray, T_e: np.ndarray, T_i: np.ndarray, p_e: np.ndarray, p_i: np.ndarray, p_total: np.ndarray, dp_e_dpsi_norm: np.ndarray, dp_i_dpsi_norm: np.ndarray, dp_total_dpsi_norm: np.ndarray, profiles: Mapping[str, AnalyticProfile], z_eff: float = 1.0, impurity_charge: float = 6.0, coordinate: str = 'psi_norm', metadata: Mapping[str, Any] = <factory>) -> None
Prescribed kinetic profiles and the pressures derived from them, on psi_norm.
Also exported as vaft.data.AnalyticPlasmaState.
18 fields · 4 members
label: strpsi_norm: np.ndarrayn_e: np.ndarrayn_i: np.ndarrayn_impurity: np.ndarrayT_e: np.ndarrayT_i: np.ndarrayp_e: np.ndarrayp_i: np.ndarrayp_total: np.ndarraydp_e_dpsi_norm: np.ndarraydp_i_dpsi_norm: np.ndarraydp_total_dpsi_norm: np.ndarrayprofiles: Mapping[str, AnalyticProfile]z_eff: floatimpurity_charge: floatcoordinate: strmetadata: Mapping[str, Any]rho_pol_normproperty —sqrt(psi_norm), the poloidal-flux radius [-]. sourcedp_total_drho_pol_normproperty —dp_total/d rho_pol_norm = 2 rho_pol_norm dp_total/dpsi_norm[Pa]. sourceunitmethod — The unit of one of the state’s arrays. sourceto_kinetic_profilesmethod — The state as the package’s kinetic-profile container, same units, same grid. source
AnalyticProfile
class
source
AnalyticProfile(quantity: str, unit: str, axis_value: float, separatrix_value: float, core_alpha: float, core_beta: float, core_amplitude: float, pedestal: BarrierStep | None = None, pedestal_top_value: float | None = None, itb: BarrierStep | None = None, coordinate: str = 'psi_norm') -> None
One analytic kinetic profile: a smooth core plus up to two barrier steps.
Also exported as vaft.data.AnalyticProfile.
11 fields · 1 members
quantity: strunit: straxis_value: floatseparatrix_value: floatcore_alpha: floatcore_beta: floatcore_amplitude: floatpedestal: BarrierStep | Nonepedestal_top_value: float | Noneitb: BarrierStep | Nonecoordinate: strbarriersproperty — The barrier steps present, pedestal first [-]. source
BarrierStep
class
source
BarrierStep(position: float, width: float, height: float) -> None
One localized tanh step of a profile, in normalized poloidal flux.
Also exported as vaft.data.BarrierStep.
vaft.data.atomic
Atomic identity: elements, isotopes, charge states and how species are written.
ATOMIC_NUMBERS
data
ATOMIC_NUMBERS = <builtins.dict>
Also exported as vaft.spectroscopy.ATOMIC_NUMBERS (deprecated).
AtomicSpecies
class
source
AtomicSpecies(element: str, mass_number: int | None = None, ionization_stage: int | None = None) -> None
An element, optionally narrowed to one isotope and one charge.
Also exported as vaft.spectroscopy.Species (deprecated).
3 fields · 3 members
element: strmass_number: int | Noneionization_stage: int | Nonecharge_stateproperty — The ionic charge, orNonewhen the stage is unspecified. sourceatomic_numberproperty — Nuclear charge, orNonefor an element outside the table. sourcefrom_charge_stateclassmethod — Build from theC2+spelling rather than theC IIIone. source
charge_state_of
function
source
charge_state_of(ionization_stage: int) -> int
The ionic charge of a spectroscopic stage: C III -> C2+.
Also exported as vaft.spectroscopy.charge_state_of (deprecated).
ELEMENT_NAMES
data
ELEMENT_NAMES = <builtins.dict>
Also exported as vaft.spectroscopy.ELEMENT_NAMES (deprecated).
format_species
function
source
format_species(species: AtomicSpecies) -> str
Spell a species the way spectroscopy does: C III, D, He.
Also exported as vaft.spectroscopy.format_species (deprecated).
ionization_stage_of
function
source
ionization_stage_of(charge_state: int) -> int
The spectroscopic stage of an ionic charge: C2+ -> C III.
Also exported as vaft.spectroscopy.ionization_stage_of (deprecated).
ISOTOPE_NAMES
data
ISOTOPE_NAMES = <builtins.dict>
Also exported as vaft.spectroscopy.ISOTOPE_NAMES (deprecated).
parse_species
function
source
parse_species(text: Any) -> AtomicSpecies | None
Resolve a species term to an identity, or None if it is not one.
STANDARD_ATOMIC_WEIGHTS
data
STANDARD_ATOMIC_WEIGHTS = <builtins.mappingproxy>
vaft.data.cocos
Explicit COCOS coordinate-convention management.
COCOS_INDICES
data
COCOS_INDICES = (1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18)
cocos_spec
function
source
cocos_spec(index: int) -> CocosSpec
Return the CocosSpec for index.
Also exported as vaft.data.cocos_spec.
CocosSpec
class
source
CocosSpec(index: int, sigma_bp: int, sigma_rpz: int, sigma_rhotp: int, exp_bp: int, sign_q_pos: int, sign_pprime_pos: int) -> None
The sign and exponent parameters of one COCOS index.
Also exported as vaft.data.CocosSpec.
7 fields · 3 members
index: intsigma_bp: intsigma_rpz: intsigma_rhotp: intexp_bp: intsign_q_pos: intsign_pprime_pos: intpsi_per_radianproperty — True when psi is in weber/radian (COCOS 1-8). sourcebp_factorproperty — The Sauter Eq. 20 coefficientsigma_RphiZ * sigma_Bp / (2*pi)**e_Bp. sourceexpected_signmethod — Sign a quantity must carry under this convention, from Sauter Eq. 23. source
CodeConvention
class
source
CodeConvention(name: str, cocos: int | None, psi_unit: str, reference: str, notes: str = '', confirmed: bool = True) -> None
The COCOS convention one external code or file format works in.
Also exported as vaft.data.CodeConvention.
6 fields · 1 members
name: strcocos: int | Nonepsi_unit: strreference: strnotes: strconfirmed: boolidentifies_per_fileproperty source
convention_for
function
source
convention_for(code: str) -> CodeConvention
Return the declared convention for code.
Also exported as vaft.data.convention_for.
known_codes
function
source
known_codes() -> tuple[str, ...]
Every code with a declared convention, in sorted order.
Also exported as vaft.data.known_codes.
register_convention
function
source
register_convention(convention: CodeConvention) -> CodeConvention
Add convention to the registry, refusing to silently replace an entry.
Also exported as vaft.data.register_convention.
VAFT_INTERNAL_COCOS
data
VAFT_INTERNAL_COCOS = 11
vaft.data.eqdsk
EFIT EQDSK/GEQDSK compatibility helpers implemented inside VAFT.
BCENTR_FPOL_RTOL
data
BCENTR_FPOL_RTOL = 0.001
flux_exponent_tier
function
source
flux_exponent_tier(readers: Sequence[SliceReader]) -> tuple[str | None, dict[int, Literal[0, 1]]]
The strongest probe tier that decides anything, and what each slice said.
FLUX_EXPONENT_TIERS
data
FLUX_EXPONENT_TIERS = ('slope', 'ampere', 'contour_q')
from_equilibrium
function
source
from_equilibrium(equilibrium: Any) -> GEQDSK
Create a GEQDSK from a complete lightweight equilibrium model.
Also exported as vaft.data.from_equilibrium.
from_imas
function
source
from_imas(source: Any, *, paths: Optional[list] = None, time: Optional[float] = None, occurrence: Optional[dict] = None, imas_version: Optional[str] = None) -> GEQDSK
Load equilibrium data from IMAS through OMAS and return GEQDSK.
Also exported as vaft.data.from_imas.
from_omas
function
source
from_omas(ods: Any, time_index: int = 0, profile_index: int = 0, allow_derived_data: bool = True) -> GEQDSK
Build a GEQDSK wrapper from an OMAS ODS equilibrium time slice.
Also exported as vaft.data.from_omas.
GEQDSK
class
source
GEQDSK(mapping: MutableMapping[str, Any], source: Optional[Path] = None, metadata: dict[str, Any] = <factory>, namelists: dict[str, dict[str, Any]] = <factory>) -> None
Neutral VAFT representation of an EFIT GEQDSK/g-file.
Also exported as vaft.data.GEQDSK.
4 fields · 7 members
mapping: MutableMapping[str, Any]source: Optional[Path]metadata: dict[str, Any]namelists: dict[str, dict[str, Any]]getmethod sourcekeysmethod sourceto_omasmethod — Convert this GEQDSK into an OMAS ODS equilibrium subtree. sourceto_imasmethod — Convert this GEQDSK through OMAS and save it to an IMAS target. sourcewritemethod — Write this GEQDSK to disk. sourceto_equilibriummethod — Adapt this file object to VAFT’s lightweight scientific model. sourcefrom_equilibriumclassmethod — Create a GEQDSK object from a complete lightweight model. source
geqdsk_filenames
function
source
geqdsk_filenames(shot: int, times: Sequence[float]) -> list[str]
Return one EFIT-style g<shot>.<time_ms> name per slice, in order.
GFILE_HEADER_PATTERN
data
GFILE_HEADER_PATTERN = <re.Pattern>
GFILE_NAME_PATTERN
data
GFILE_NAME_PATTERN = <re.Pattern>
infer_source_shot_time
function
source
infer_source_shot_time(source: Optional[Path]) -> tuple[int, Optional[float]]
Infer (shot, time_in_seconds) from an EFIT g-file name.
ods_flux_exponent
function
source
ods_flux_exponent(ods: Any, time_index: int = 0) -> Literal[0, 1] | None
e_Bp for a whole ODS, by tier across every slice, or None.
ods_psi_to_wb_per_radian_factor
function
source
ods_psi_to_wb_per_radian_factor(ods: Any, time_index: int = 0) -> float
Factor converting an ODS equilibrium’s stored psi to Wb/rad.
read_geqdsk
function
source
read_geqdsk(path: str | Path) -> GEQDSK
Read an EFIT GEQDSK/g-file using VAFT’s standalone parser.
Also exported as vaft.data.read_geqdsk.
slice_flux_exponent
function
source
slice_flux_exponent(time_slice: Any) -> Literal[0, 1] | None
The flux exponent one equilibrium time slice’s own data supports.
to_imas
function
source
to_imas(geqdsk: GEQDSK | Mapping[str, Any], target: Any, *, occurrence: Optional[dict] = None, imas_version: Optional[str] = None) -> Any
Convert GEQDSK through OMAS and write to an IMAS target.
Also exported as vaft.data.to_imas.
to_omas
function
source
to_omas(geqdsk: GEQDSK | Mapping[str, Any], ods: Any = None, time_index: int = 0, profile_index: int = 0, allow_derived_data: bool = True) -> Any
Convert GEQDSK data to an OMAS ODS without OMFIT.
Also exported as vaft.data.to_omas.
vacuum_b0_magnitude
function
source
vacuum_b0_magnitude(data: Mapping[str, Any]) -> float
|B0| at RCENTR, from FPOL in preference to BCENTR.
write_geqdsk
function
source
write_geqdsk(geqdsk: GEQDSK | Mapping[str, Any], path: str | Path) -> Path
Write GEQDSK data to disk using standard EFIT g-file ordering.
Also exported as vaft.data.write_geqdsk.
vaft.data.equilibrium
Portable, format-independent representations of axisymmetric equilibria.
BoundaryRepresentation
class
source
BoundaryRepresentation(lcfs: Contour | None, limiter: Contour | None, x_points: tuple[XPoint, ...], topology: Topology, d_r_sep: DerivedValue, gaps: tuple[Gap, ...], strike_points: tuple[StrikePoint, ...], fourier_coefficients: Mapping[str, np.ndarray], fourier_reconstruction_error: DerivedValue, provenance: DerivationProvenance, reason: str | None = None, stationary_points: tuple[StationaryPoint, ...] = (), wall_contact_distance: DerivedValue | None = None) -> None
Also exported as vaft.data.BoundaryRepresentation.
13 fields
lcfs: Contour | Nonelimiter: Contour | Nonex_points: tuple[XPoint, ...]topology: Topologyd_r_sep: DerivedValuegaps: tuple[Gap, ...]strike_points: tuple[StrikePoint, ...]fourier_coefficients: Mapping[str, np.ndarray]fourier_reconstruction_error: DerivedValueprovenance: DerivationProvenancereason: str | Nonestationary_points: tuple[StationaryPoint, ...]wall_contact_distance: DerivedValue | None
Contour
class
source
Contour(r: np.ndarray, z: np.ndarray, closed: bool = True) -> None
Also exported as vaft.data.Contour.
3 fields · 1 members
r: np.ndarrayz: np.ndarrayclosed: boolpointsproperty source
CurrentMomentRepresentation
class
source
CurrentMomentRepresentation(total_current: float, centroid_r: float, centroid_z: float, central_moments: Mapping[tuple[int, int], float], max_order: int, current_density_source: str, provenance: DerivationProvenance) -> None
Toroidal current density reduced to its total, centroid and central moments (#943).
Also exported as vaft.data.CurrentMomentRepresentation.
7 fields · 1 members
total_current: floatcentroid_r: floatcentroid_z: floatcentral_moments: Mapping[tuple[int, int], float]max_order: intcurrent_density_source: strprovenance: DerivationProvenancecovarianceproperty — The second-order tensor[[mu_20, mu_11], [mu_11, mu_02]][m^2]. source
DerivationProvenance
class
source
DerivationProvenance(method: str, source_type: str = 'native', source_fields: tuple[str, ...] = (), source_time: float | None = None, radial_coordinate: str | None = None, interpolation: str | None = None, fit_range: tuple[float, float] | None = None, tolerances: Mapping[str, float] = <factory>, convention: EquilibriumConvention | None = None, notes: tuple[str, ...] = ()) -> None
Also exported as vaft.data.DerivationProvenance.
10 fields
method: strsource_type: strsource_fields: tuple[str, ...]source_time: float | Noneradial_coordinate: str | Noneinterpolation: str | Nonefit_range: tuple[float, float] | Nonetolerances: Mapping[str, float]convention: EquilibriumConvention | Nonenotes: tuple[str, ...]
DerivedValue
class
source
DerivedValue(value: Any | None, unit: str, definition: str, provenance: DerivationProvenance, quality: Mapping[str, Any] = <factory>, reason: str | None = None) -> None
A value together with its definition, provenance, and availability.
Also exported as vaft.data.DerivedValue.
6 fields · 1 members
value: Any | Noneunit: strdefinition: strprovenance: DerivationProvenancequality: Mapping[str, Any]reason: str | Noneavailableproperty source
EquilibriumConvention
class
source
EquilibriumConvention(cocos: int | None = None, candidates: tuple[int, ...] = (), psi_per_radian: bool | None = None, clockwise_phi: bool | None = None, ip_sign: int | None = None, bt_sign: int | None = None, q_sign: int | None = None, source: str = 'unknown', identified: tuple[int, ...] = ()) -> None
Coordinate and sign convention, and the evidence used to identify it.
Also exported as vaft.data.EquilibriumConvention.
9 fields · 2 members
cocos: int | Nonecandidates: tuple[int, ...]psi_per_radian: bool | Noneclockwise_phi: bool | Noneip_sign: int | Nonebt_sign: int | Noneq_sign: int | Nonesource: stridentified: tuple[int, ...]ambiguousproperty sourcecontradictedproperty — True when a declared index is not among the ones the data supports. source
EquilibriumData
class
source
EquilibriumData(r: np.ndarray | None = None, z: np.ndarray | None = None, psi: np.ndarray | None = None, psi_axis: float | None = None, psi_boundary: float | None = None, magnetic_axis: tuple[float, float] | None = None, lcfs: Contour | None = None, limiter: Contour | None = None, psi_1d: np.ndarray | None = None, pressure: np.ndarray | None = None, f: np.ndarray | None = None, q: np.ndarray | None = None, pprime: np.ndarray | None = None, ffprime: np.ndarray | None = None, ip: float | None = None, bt0: float | None = None, r0: float | None = None, time: float | None = None, convention: EquilibriumConvention = <factory>, metadata: Mapping[str, Any] = <factory>) -> None
One axisymmetric equilibrium, shape-normalized for numerical algorithms.
Also exported as vaft.data.EquilibriumData.
20 fields
r: np.ndarray | Nonez: np.ndarray | Nonepsi: np.ndarray | Nonepsi_axis: float | Nonepsi_boundary: float | Nonemagnetic_axis: tuple[float, float] | Nonelcfs: Contour | Nonelimiter: Contour | Nonepsi_1d: np.ndarray | Nonepressure: np.ndarray | Nonef: np.ndarray | Noneq: np.ndarray | Nonepprime: np.ndarray | Noneffprime: np.ndarray | Noneip: float | Nonebt0: float | Noner0: float | Nonetime: float | Noneconvention: EquilibriumConventionmetadata: Mapping[str, Any]
FourierFitResult
class
source
FourierFitResult(surface: FourierSurface, contour: Contour, reconstructed: Contour, rms_error: float, normalized_rms_error: float, max_error: float, hausdorff_distance: float, accepted: bool, reason: str | None, provenance: DerivationProvenance) -> None
Also exported as vaft.data.FourierFitResult.
10 fields
surface: FourierSurfacecontour: Contourreconstructed: Contourrms_error: floatnormalized_rms_error: floatmax_error: floathausdorff_distance: floataccepted: boolreason: str | Noneprovenance: DerivationProvenance
FourierSequenceResult
class
source
FourierSequenceResult(fits: tuple[FourierFitResult, ...], skipped: tuple[float, ...] = (), provenance: DerivationProvenance | None = None) -> None
Also exported as vaft.data.FourierSequenceResult.
3 fields · 1 members
fits: tuple[FourierFitResult, ...]skipped: tuple[float, ...]provenance: DerivationProvenance | Nonecoefficientmethod —(radial values, coefficient)of one family and harmonic across the sequence. source
FourierSurface
class
source
FourierSurface(r_cos: np.ndarray, r_sin: np.ndarray, z_cos: np.ndarray, z_sin: np.ndarray, radial_value: float | None = None, radial_coordinate: str = 'psi_n', angle_convention: str = 'arc_length') -> None
A closed contour as a truncated Fourier series in a uniform arc-length angle (#945).
Also exported as vaft.data.FourierSurface.
7 fields · 3 members
r_cos: np.ndarrayr_sin: np.ndarrayz_cos: np.ndarrayz_sin: np.ndarrayradial_value: float | Noneradial_coordinate: strangle_convention: strmodesproperty — Highest poloidal harmonic kept. sourcereference_rproperty — Them = 0radial term: the perimeter centroid’s major radius. sourcereference_zproperty — Them = 0vertical term: the perimeter centroid’s height. source
Gap
class
source
Gap(name: str, angle: float, distance: DerivedValue, plasma_point: tuple[float, float] | None = None, wall_point: tuple[float, float] | None = None) -> None
Also exported as vaft.data.Gap.
5 fields
name: strangle: floatdistance: DerivedValueplasma_point: tuple[float, float] | Nonewall_point: tuple[float, float] | None
GlobalEquilibriumDescriptors
class
source
GlobalEquilibriumDescriptors(values: Mapping[str, DerivedValue], radial_coordinates: Mapping[str, DerivedValue] = <factory>, rational_surfaces: Mapping[float, tuple[DerivedValue, ...]] = <factory>, validation: ValidationReport = <factory>) -> None
Also exported as vaft.data.GlobalEquilibriumDescriptors.
4 fields
values: Mapping[str, DerivedValue]radial_coordinates: Mapping[str, DerivedValue]rational_surfaces: Mapping[float, tuple[DerivedValue, ...]]validation: ValidationReport
GradShafranovResidualModes
class
source
GradShafranovResidualModes(radial_values: np.ndarray, cos: np.ndarray, sin: np.ndarray, rms: np.ndarray, scale: float, radial_coordinate: str = 'psi_n', angle_convention: str = 'arc_length', skipped: tuple[float, ...] = (), provenance: DerivationProvenance | None = None) -> None
The Grad-Shafranov residual projected onto poloidal harmonics, surface by surface (#948).
9 fields · 1 members
radial_values: np.ndarraycos: np.ndarraysin: np.ndarrayrms: np.ndarrayscale: floatradial_coordinate: strangle_convention: strskipped: tuple[float, ...]provenance: DerivationProvenance | Noneamplitudemethod —sqrt(cos**2 + sin**2)of harmonic m on every surface [T/m]. source
GuazzottoFreidbergEquilibrium
class
source
GuazzottoFreidbergEquilibrium(topology: str, inverse_aspect_ratio: float, nu: float, alpha: float, coefficients: np.ndarray, separation_h: np.ndarray, separation_k: np.ndarray, magnetic_axis: tuple[float, float], elongation: float | None = None, triangularity: float | None = None, x_point_elongation: float | None = None, x_point_triangularity: float | None = None, eigen_residual: float = 0.0, condition_number: float = nan, series_terms: int = 250, status: str = 'converged', metadata: Mapping[str, Any] = <factory>, current_pedestal: float = 0.0, pressure_pedestal: float = 0.0, bootstrap_fraction: float = 0.0, mach_number: float = 0.0, adiabatic_index: float | None = None) -> None
An analytic Guazzotto-Freidberg (2021, Part 1) equilibrium in normalized form (#1148).
Also exported as vaft.data.GuazzottoFreidbergEquilibrium.
22 fields
topology: strinverse_aspect_ratio: floatnu: floatalpha: floatcoefficients: np.ndarrayseparation_h: np.ndarrayseparation_k: np.ndarraymagnetic_axis: tuple[float, float]elongation: float | Nonetriangularity: float | Nonex_point_elongation: float | Nonex_point_triangularity: float | Noneeigen_residual: floatcondition_number: floatseries_terms: intstatus: strmetadata: Mapping[str, Any]current_pedestal: floatpressure_pedestal: floatbootstrap_fraction: floatmach_number: floatadiabatic_index: float | None
MillerFitResult
class
source
MillerFitResult(surface: MillerSurface, contour: Contour, reconstructed: Contour, rms_error: float, normalized_rms_error: float, max_error: float, hausdorff_distance: float, converged: bool, accepted: bool, reason: str | None, provenance: DerivationProvenance) -> None
Also exported as vaft.data.MillerFitResult.
11 fields
surface: MillerSurfacecontour: Contourreconstructed: Contourrms_error: floatnormalized_rms_error: floatmax_error: floathausdorff_distance: floatconverged: boolaccepted: boolreason: str | Noneprovenance: DerivationProvenance
MillerSequenceResult
class
source
MillerSequenceResult(fits: tuple[MillerFitResult, ...], derivative_reason: str | None = None, provenance: DerivationProvenance | None = None) -> None
Also exported as vaft.data.MillerSequenceResult.
3 fields
fits: tuple[MillerFitResult, ...]derivative_reason: str | Noneprovenance: DerivationProvenance | None
MillerSurface
class
source
MillerSurface(r: float, r0: float, z0: float, kappa: float, delta: float, zeta: float = 0.0, radial_value: float | None = None, radial_coordinate: str = 'psi_n', d_r0_dr: float | None = None, d_kappa_dr: float | None = None, d_delta_dr: float | None = None, q: float | None = None, magnetic_shear: float | None = None, alpha: float | None = None, indentation: float = 0.0) -> None
Also exported as vaft.data.MillerSurface.
15 fields
r: floatr0: floatz0: floatkappa: floatdelta: floatzeta: floatradial_value: float | Noneradial_coordinate: strd_r0_dr: float | Noned_kappa_dr: float | Noned_delta_dr: float | Noneq: float | Nonemagnetic_shear: float | Nonealpha: float | Noneindentation: float
MXHChebyshevRepresentation
class
source
MXHChebyshevRepresentation(r0: float, z0: float, harmonics: int, radial_order: int, profiles: Mapping[str, tuple[float, tuple[float, ...]]], parameter_count: int, metrics: Mapping[str, float], status: str, reason: str | None, provenance: DerivationProvenance) -> None
Flux surfaces as MXH shapes with shifted-Chebyshev radial profiles (Xie & Li 2026; #1166).
Also exported as vaft.data.MXHChebyshevRepresentation.
10 fields
r0: floatz0: floatharmonics: intradial_order: intprofiles: Mapping[str, tuple[float, tuple[float, ...]]]parameter_count: intmetrics: Mapping[str, float]status: strreason: str | Noneprovenance: DerivationProvenance
SOLOVEV_BASIS_SIZES
data
SOLOVEV_BASIS_SIZES = <builtins.dict>
SOLOVEV_CONSTRAINT_KINDS
data
SOLOVEV_CONSTRAINT_KINDS = ('psi', 'dpsi_dr', 'dpsi_dz', 'd2psi_dr2', 'd2psi_dz2', 'd2psi_drdz')
SolovevConstraint
class
source
SolovevConstraint(r: float, z: float, kind: str, value: float, combination: tuple[tuple[str, float], ...] = ()) -> None
One linear condition on psi at a point: kind of psi equals value.
Also exported as vaft.data.SolovevConstraint.
5 fields
r: floatz: floatkind: strvalue: floatcombination: tuple[tuple[str, float], ...]
SolovevEquilibrium
class
source
SolovevEquilibrium(coefficients: np.ndarray, pprime: float, ffprime: float, rref: float, psi_boundary: float = 0.0, pressure_boundary: float = 0.0, f_boundary: float = 1.0, f_sign: int | None = None, rank: int | None = None, residual_norm: float | None = None, metadata: Mapping[str, Any] = <factory>, basis: str = 'classic') -> None
Also exported as vaft.data.SolovevEquilibrium.
12 fields
coefficients: np.ndarraypprime: floatffprime: floatrref: floatpsi_boundary: floatpressure_boundary: floatf_boundary: floatf_sign: int | Nonerank: int | Noneresidual_norm: float | Nonemetadata: Mapping[str, Any]basis: str
SolovevFit
class
source
SolovevFit(model: 'SolovevEquilibrium | None', metrics: Mapping[str, Any], status: str, reason: str | None, provenance: DerivationProvenance) -> None
A Solov’ev model fitted to an existing equilibrium, with its fidelity (#1166).
Also exported as vaft.data.SolovevFit.
5 fields
model: 'SolovevEquilibrium | None'metrics: Mapping[str, Any]status: strreason: str | Noneprovenance: DerivationProvenance
StationaryPoint
class
source
StationaryPoint(r: float, z: float, psi: float, psi_n: float, kind: str, hessian_determinant: float, curvature: float = 0.0) -> None
A point where grad(psi) vanishes, classified by its Hessian.
Also exported as vaft.data.StationaryPoint.
7 fields
r: floatz: floatpsi: floatpsi_n: floatkind: strhessian_determinant: floatcurvature: float
StrikePoint
class
source
StrikePoint(r: float, z: float, branch: str, flux_expansion: DerivedValue, incidence_angle: DerivedValue) -> None
Also exported as vaft.data.StrikePoint.
5 fields
r: floatz: floatbranch: strflux_expansion: DerivedValueincidence_angle: DerivedValue
Topology
class
source
How the last closed flux surface is bounded.
Also exported as vaft.data.Topology.
6 fields · 3 members
LIMITED: 'limited'LOWER_SINGLE_NULL: 'lower_single_null'UPPER_SINGLE_NULL: 'upper_single_null'DOUBLE_NULL: 'double_null'DIVERTED: 'diverted'AMBIGUOUS: 'ambiguous'is_divertedproperty — True when a boundary-relevant X-point was identified. sourceis_limitedproperty sourceis_determinateproperty source
XPoint
class
source
XPoint(r: float, z: float, psi: float, psi_n: float, active: bool, hessian_determinant: float) -> None
Also exported as vaft.data.XPoint.
6 fields
r: floatz: floatpsi: floatpsi_n: floatactive: boolhessian_determinant: float
vaft.data.equilibrium_kinetic_iteration
Records for the self-consistent equilibrium / kinetic-profile iteration (#123).
CLOSURE_MODES
data
CLOSURE_MODES = ('equilibrium_pressure', 'kinetic_pressure')
ConvergenceCriteria
class
source
ConvergenceCriteria(pressure_rtol: float | None = 0.001, profile_rtol: float | None = 0.001, q_rtol: float | None = 0.001, coordinate_atol: float | None = 0.001, scalar_rtol: float | None = 0.001, axis_atol: float | None = 0.0001, normalization_rtol: float = 0.001, boundary_rtol: float = 0.01, max_iterations: int = 10, relaxation: float = 1.0, divergence_window: int = 2, oscillation_window: int = 4, oscillation_ratio: float = 0.9, stagnation_window: int = 3, stagnation_ratio: float = 0.95, monotone_rtol: float = 1e-06) -> None
Tolerances, the iteration cap and the failure detectors.
Also exported as vaft.data.ConvergenceCriteria.
16 fields · 1 members
pressure_rtol: float | Noneprofile_rtol: float | Noneq_rtol: float | Nonecoordinate_atol: float | Nonescalar_rtol: float | Noneaxis_atol: float | Nonenormalization_rtol: floatboundary_rtol: floatmax_iterations: intrelaxation: floatdivergence_window: intoscillation_window: intoscillation_ratio: floatstagnation_window: intstagnation_ratio: floatmonotone_rtol: floatenabledmethod — The enabled tolerances by name [-, m for axis_atol]. source
CURRENT_NORMALIZATIONS
data
CURRENT_NORMALIZATIONS = <builtins.mappingproxy>
CURRENT_POLICIES
data
CURRENT_POLICIES = ('preserve_ffprime_shape', 'analytic_ffprime_shape')
CurrentPolicy
class
source
CurrentPolicy(kind: str = 'preserve_ffprime_shape', normalization: str = 'plasma_current', current_profile: AnalyticProfile | None = None) -> None
The non-pressure source of the next CHEASE solve, and its normalization.
Also exported as vaft.data.CurrentPolicy.
CurrentSource
class
source
CurrentSource(psi_norm: np.ndarray, shape: np.ndarray, amplitude: float, ffprime: np.ndarray, method: str) -> None
The FF' handed to CHEASE for one update, and how it was built.
Also exported as vaft.data.CurrentSource.
5 fields
psi_norm: np.ndarrayshape: np.ndarrayamplitude: floatffprime: np.ndarraymethod: str
EquilibriumKineticSpec
class
source
EquilibriumKineticSpec(kinetic: SyntheticKineticSpec, closure: str = 'kinetic_pressure', current_policy: CurrentPolicy = <factory>, convergence: ConvergenceCriteria = <factory>, label: str = 'self-consistent') -> None
What the self-consistent iteration is told, separate from the equilibrium.
Also exported as vaft.data.EquilibriumKineticSpec.
5 fields
kinetic: SyntheticKineticSpecclosure: strcurrent_policy: CurrentPolicyconvergence: ConvergenceCriterialabel: str
ITERATION_STATUSES
data
ITERATION_STATUSES = ('converged', 'max_iterations', 'diverged', 'oscillating', 'stagnated', 'drifting', 'kinetic_generation_failed', 'inv...
IterationState
class
source
IterationState(index: int, status: str, message: str, equilibrium: Any = None, geqdsk_path: Path | None = None, kinetic: SyntheticKineticProfiles | None = None, psi_norm: np.ndarray | None = None, p_eq: np.ndarray | None = None, p_kin: np.ndarray | None = None, q: np.ndarray | None = None, rho_tor_norm: np.ndarray | None = None, scalars: Mapping[str, float] = <factory>, metrics: Mapping[str, float] = <factory>, validation: Mapping[str, Any] = <factory>, pressure_source: PressureSource | None = None, current_source: CurrentSource | None = None, chease_workdir: Path | None = None, chease_inputs: Mapping[str, Any] = <factory>, rational_surfaces: Mapping[str, float] = <factory>) -> None
One immutable state of the iteration.
Also exported as vaft.data.IterationState.
19 fields · 1 members
index: intstatus: strmessage: strequilibrium: Anygeqdsk_path: Path | Nonekinetic: SyntheticKineticProfiles | Nonepsi_norm: np.ndarray | Nonep_eq: np.ndarray | Nonep_kin: np.ndarray | Noneq: np.ndarray | Nonerho_tor_norm: np.ndarray | Nonescalars: Mapping[str, float]metrics: Mapping[str, float]validation: Mapping[str, Any]pressure_source: PressureSource | Nonecurrent_source: CurrentSource | Nonechease_workdir: Path | Nonechease_inputs: Mapping[str, Any]rational_surfaces: Mapping[str, float]acceptedproperty — Whether this state is a usable equilibrium / kinetic pair [-]. source
PressureSource
class
source
PressureSource(kinetic_psi_norm: np.ndarray, raw_pressure: np.ndarray, relaxed_pressure: np.ndarray, relaxation: float, psi_norm: np.ndarray, pressure: np.ndarray, dpressure_dpsi_norm: np.ndarray, pprime: np.ndarray, psi_span: float, method: str, rise_max_relative: float = 0.0, rise_points_removed: int = 0) -> None
The pressure handed to CHEASE for one update, and how it was built.
Also exported as vaft.data.PressureSource.
12 fields
kinetic_psi_norm: np.ndarrayraw_pressure: np.ndarrayrelaxed_pressure: np.ndarrayrelaxation: floatpsi_norm: np.ndarraypressure: np.ndarraydpressure_dpsi_norm: np.ndarraypprime: np.ndarraypsi_span: floatmethod: strrise_max_relative: floatrise_points_removed: int
SelfConsistentState
class
source
SelfConsistentState(spec: EquilibriumKineticSpec, status: str, message: str, initial: IterationState, iterations: tuple[IterationState, ...], final: IterationState | None, ods: Any, policy: Mapping[str, Any], provenance: Mapping[str, Any], baseline: IterationState | None = None) -> None
The result of the equilibrium / kinetic iteration: every state, and the final ODS.
Also exported as vaft.data.SelfConsistentState.
10 fields · 12 members
spec: EquilibriumKineticSpecstatus: strmessage: strinitial: IterationStateiterations: tuple[IterationState, ...]final: IterationState | Noneods: Anypolicy: Mapping[str, Any]provenance: Mapping[str, Any]baseline: IterationState | Noneconvergedproperty — Whether every enabled criterion was met [-]. sourcestatesproperty — The initial state followed by every iteration [-]. sourceinitial_equilibriumproperty — The g-file object the iteration started from [-]. sourcefinal_equilibriumproperty — The final accepted state’s g-file object,Nonewhen there is none [-]. sourcefinal_core_profilesproperty — The final accepted state’s kinetic profiles [-]. sourcehistorymethod — One metric or scalar per state,NaNwhere a state lacks it [-]. sourceconvergence_historyproperty — Every metric recorded on any state, one value per state [-]. sourcepressure_residualsproperty — Thep_kin-p_eqresiduals per state [-]. sourceprofile_residualsproperty — The per-channel changes since the previous state [-]. sourcecoordinate_mapping_historyproperty —rho_tor_normon the kinetic grid, per state [-]. sourcevalidationproperty — Each state’s validation record [-]. sourceassumption_tablemethod —(quantity, role)rows: held, recomputed from the kinetic state, by CHEASE, a control or a metric [-]. source
STATE_STATUSES
data
STATE_STATUSES = ('initial', 'accepted', 'kinetic_generation_failed', 'invalid_pressure_source', 'chease_failed', 'validation_failed')
vaft.data.flare_products
Reading FLARE’s ASCII products.
FlareBoundary
class
source
FlareBoundary(contours: tuple[np.ndarray, ...], units: str, source: Path) -> None
The axisymmetric surfaces of a FLARE model boundary, in metres.
3 fields · 1 members
contours: tuple[np.ndarray, ...]units: strsource: Pathpointsproperty — The one contour, when the model has exactly one(N, 2)[m]. source
FlareColumn
class
source
FlareColumn(index: int, name: str, label: str = '', units: str = '') -> None
One column of a FLARE product, as its header described it.
4 fields
index: intname: strlabel: strunits: str
FlareGrid
class
source
FlareGrid(kind: str | None, header: Mapping[str, str], rows: tuple[np.ndarray, ...], source: Path) -> None
One FLARE mesh file.
FlareMesh
class
source
FlareMesh(kind: str, u: np.ndarray, v: np.ndarray, u_label: str, v_label: str, r: np.ndarray, z: np.ndarray, phi_deg: np.ndarray, length_units: str, angle_units: str, source: Path) -> None
A FLARE mesh with every node placed in (R, z, phi).
11 fields · 3 members
kind: stru: np.ndarrayv: np.ndarrayu_label: strv_label: strr: np.ndarrayz: np.ndarrayphi_deg: np.ndarraylength_units: strangle_units: strsource: Pathnode_shapeproperty —(n_v, n_u)– the shape a node-centred dataset reshapes to. sourcecell_shapeproperty —(n_v - 1, n_u - 1)– the shape a cell-centred dataset reshapes to. sourcetoroidally_sweptproperty — Whether the mesh spans a toroidal range rather than one plane. source
FlareProduct
class
source
FlareProduct(kind: str | None, header: Mapping[str, str], columns: tuple[FlareColumn, ...], values: np.ndarray, source: Path, grid: FlareGrid | None = None) -> None
One FLARE data file: what it says it is, and its numbers.
6 fields · 6 members
kind: str | Noneheader: Mapping[str, str]columns: tuple[FlareColumn, ...]values: np.ndarraysource: Pathgrid: FlareGrid | Nonegeometryproperty — The mesh file this references, empty when it stands alone. sourcegrid_shapeproperty — The shape one of this product’s columns takes on the mesh it names. sourcecell_centredproperty — Whether the values sit on cells rather than nodes. sourcemeshproperty — The mesh this product names, with every node placed in(R, z, phi). sourceon_meshmethod — One column laid out on the mesh, asvalues[i_v, i_u]. sourcecolumnmethod — One column by the name its header gave it. source
read_flare_boundary
function
source
read_flare_boundary(path: str | Path) -> FlareBoundary
Read a FLARE model’s axisymmetric boundary, converted to metres.
read_flare_grid
function
source
read_flare_grid(path: str | Path) -> FlareGrid
Read one FLARE mesh file.
read_flare_mesh
function
source
read_flare_mesh(grid: FlareGrid) -> FlareMesh
Interpret one FLARE mesh: its axes, and where its nodes sit.
read_flare_product
function
source
read_flare_product(path: str | Path, *, load_grid: bool = True) -> FlareProduct
Read one FLARE data file, and the mesh it names.
RECTANGULAR_MESHES
data
RECTANGULAR_MESHES = ('rmesh', 'rmesh3d', 'tpzmesh3d')
resolve_geometry
function
source
resolve_geometry(product: FlareProduct) -> Path | None
Where a product’s # GEOMETRY mesh would be, beside the product.
vaft.data.keqdsk
Standalone parser for EFIT k-file Fortran namelists.
KEQDSK
class
source
KEQDSK(namelists: Mapping[str, Mapping[str, Any]], source: Path | None = None) -> None
Parsed EFIT k-file, retaining every submitted namelist value.
Also exported as vaft.data.KEQDSK.
2 fields · 1 members
namelists: Mapping[str, Mapping[str, Any]]source: Path | Noneto_omasmethod — Store the exact submitted namelists as equilibrium code parameters. source
read_keqdsk
function
source
read_keqdsk(path: str | Path) -> KEQDSK
Read all namelists from an EFIT k-file using Fortran semantics.
Also exported as vaft.data.read_keqdsk.
write_namelists_to_ods
function
source
write_namelists_to_ods(ods: Any, namelists: Mapping[str, Mapping[str, Any]], *, time_index: int = 0) -> Any
Write parsed Fortran namelists to equilibrium.code.parameters.
vaft.data.kinetic_profiles
Kinetic profiles as a file-format container, and GPEC .kin I/O.
KIN_COLUMNS
data
KIN_COLUMNS = ('psi_norm', 'n_i', 'n_e', 'T_i', 'T_e', 'omega_exb')
KIN_HEADER
data
KIN_HEADER = ' psi ni(m^-3) ne(m^-3) ti(eV) te(eV) wexb(rad/s)'
KINETIC_UNITS
data
KINETIC_UNITS = <builtins.dict>
KineticProfiles
class
source
KineticProfiles(psi_norm: np.ndarray, n_e: np.ndarray | None = None, n_i: np.ndarray | None = None, n_z: np.ndarray | None = None, n_fast: np.ndarray | None = None, T_e: np.ndarray | None = None, T_i: np.ndarray | None = None, T_z: np.ndarray | None = None, omega_tor: np.ndarray | None = None, omega_exb: np.ndarray | None = None, omega_pol: np.ndarray | None = None, p_total: np.ndarray | None = None, p_fast: np.ndarray | None = None, e_radial: np.ndarray | None = None, normalization: PsiNormalization = <factory>, species: tuple[Species, ...] = (), extras: Mapping[str, np.ndarray] = <factory>, provenance: Mapping[str, str] = <factory>, source: str = '') -> None
Kinetic profiles on one radial coordinate, in the container’s units.
Also exported as vaft.data.KineticProfiles.
19 fields · 3 members
psi_norm: np.ndarrayn_e: np.ndarray | Nonen_i: np.ndarray | Nonen_z: np.ndarray | Nonen_fast: np.ndarray | NoneT_e: np.ndarray | NoneT_i: np.ndarray | NoneT_z: np.ndarray | Noneomega_tor: np.ndarray | Noneomega_exb: np.ndarray | Noneomega_pol: np.ndarray | Nonep_total: np.ndarray | Nonep_fast: np.ndarray | Nonee_radial: np.ndarray | Nonenormalization: PsiNormalizationspecies: tuple[Species, ...]extras: Mapping[str, np.ndarray]provenance: Mapping[str, str]source: stravailablemethod — Names of the profile fields this set actually carries. sourcefieldmethod — One profile by name, from a field or fromextras. sourceunitmethod — The container’s unit forname;""for an extra. source
normalize_psi
function
source
normalize_psi(profiles: KineticProfiles, *, method: str, axis: float | None = None, edge: float | None = None) -> KineticProfiles
Rescale the radial coordinate, explicitly, recording that it happened.
Also exported as vaft.data.normalize_psi.
PROFILE_FIELDS
data
PROFILE_FIELDS = ('n_e', 'n_i', 'n_z', 'n_fast', 'T_e', 'T_i', 'T_z', 'omega_tor', 'omega_exb', 'omega_pol', 'p_total', 'p_fast', 'e_r...
PsiNormalization
class
source
PsiNormalization(method: str = 'as_read', source: str = '', axis_value: float | None = None, edge_value: float | None = None) -> None
How a profile set’s radial coordinate came to be what it is.
Also exported as vaft.data.PsiNormalization.
4 fields
method: strsource: straxis_value: float | Noneedge_value: float | None
read_kin
function
source
read_kin(path: str | Path) -> KineticProfiles
Read a GPEC .kin file.
Also exported as vaft.data.read_kin.
Species
class
source
Species(label: str, n: float, z: float, a: float) -> None
One ion species from a pfile’s N Z A block.
Also exported as vaft.data.Species.
4 fields
label: strn: floatz: floata: float
write_kin
function
source
write_kin(profiles: KineticProfiles, path: str | Path, *, header: bool = True, allow_zero_rotation: bool = False) -> Path
Write a GPEC .kin file.
Also exported as vaft.data.write_kin.
vaft.data.mars_profiles
MARS profile inputs: one quantity per file, in SI, on MARS’s own coordinate.
MARS_FIELD_FILES
data
MARS_FIELD_FILES = <builtins.dict>
MARS_PROFILE_FILES
data
MARS_PROFILE_FILES = <builtins.dict>
MARS_PROFILE_LABELS
data
MARS_PROFILE_LABELS = <builtins.dict>
MARS_RADIAL_VARIABLES
data
MARS_RADIAL_VARIABLES = <builtins.dict>
MarsProfile
class
source
MarsProfile(coordinate: np.ndarray, values: np.ndarray, irad: int = 1, source: str = '') -> None
One PROF*.IN: an abscissa and one quantity, as written.
Also exported as vaft.data.MarsProfile.
MarsProfileFormatError
class
source
The file is not shaped like a MARS profile input.
Also exported as vaft.data.MarsProfileFormatError.
read_mars_profile
function
source
read_mars_profile(path: str | Path) -> MarsProfile
Read one PROF*.IN, in the file’s own coordinate and units.
Also exported as vaft.data.read_mars_profile.
read_mars_profiles
function
source
read_mars_profiles(directory: str | Path) -> KineticProfiles
Read a directory of PROF*.IN into the kinetic-profile container.
Also exported as vaft.data.read_mars_profiles.
write_mars_profile
function
source
write_mars_profile(profile: MarsProfile, path: str | Path) -> Path
Write one PROF*.IN, in the coordinate the profile already carries.
Also exported as vaft.data.write_mars_profile.
write_mars_profiles
function
source
write_mars_profiles(profiles: KineticProfiles, directory: str | Path, *, include_extras: bool = True) -> tuple[Path, ...]
Write the PROF*.IN files a profile set can fill.
Also exported as vaft.data.write_mars_profiles.
vaft.data.meqdsk
Standalone parser and OMAS mapping for current EFIT NetCDF m-files.
EFIT_K_TO_M_TRANSFORMS
data
EFIT_K_TO_M_TRANSFORMS = <builtins.dict>
EFIT_MAPPING_SOURCE_REVISION
data
EFIT_MAPPING_SOURCE_REVISION = '4d10ed592f8c9d295d393d0cf331f2d8f6be3034'
MEQDSK
class
source
MEQDSK(variables: Mapping[str, MVariable], dimensions: Mapping[str, int | None], attributes: Mapping[str, Any], source: Path | None = None) -> None
Parsed EFIT m-file with native variables and NetCDF metadata.
Also exported as vaft.data.MEQDSK.
4 fields · 2 members
variables: Mapping[str, MVariable]dimensions: Mapping[str, int | None]attributes: Mapping[str, Any]source: Path | Nonetime_secondsmethod — Return embedded EFIT time in seconds (write_m.F90stores msec). sourceto_omasmethod — Map current EFIT m-file output to schema-native equilibrium fields. source
MVariable
class
source
MVariable(data: np.ndarray, dimensions: tuple[str, ...] = (), attributes: Mapping[str, Any] | None = None) -> None
3 fields
data: np.ndarraydimensions: tuple[str, ...]attributes: Mapping[str, Any] | None
read_meqdsk
function
source
read_meqdsk(path: str | Path) -> MEQDSK
Read a NetCDF m-file emitted by the current EFIT write_m.F90.
Also exported as vaft.data.read_meqdsk.
vaft.data.open_adas
Small, dependency-free OPEN-ADAS ADF11 client used by VAFT.
ADASDataError
class
source
Base exception for OPEN-ADAS lookup and ADF11 data failures.
ADASDownloadError
class
source
Raised when an ADF11 file cannot be downloaded.
ADF11Data
class
source
ADF11Data(path: Path, file_type: str, log_density_cm3: np.ndarray, log_temperature_eV: np.ndarray, log_coefficients: np.ndarray, z1: np.ndarray, metastables: np.ndarray) -> None
Parsed unresolved ADF11 coefficient table in native log10 units.
7 fields · 1 members
path: Pathfile_type: strlog_density_cm3: np.ndarraylog_temperature_eV: np.ndarraylog_coefficients: np.ndarrayz1: np.ndarraymetastables: np.ndarrayn_charge_statesproperty source
ADF11FormatError
class
source
Raised when an ADF11 file is malformed or inconsistent.
default_adf11_files
function
source
default_adf11_files(species: str) -> dict[str, str]
Return VAFT’s default acd, scd and plt files for species.
get_adf11_path
function
source
get_adf11_path(filename: str, cache_dir: str | os.PathLike[str] | None = None, *, timeout: float = 30.0) -> Path
Locate filename in the VAFT cache, downloading it from OPEN-ADAS if absent.
OPEN_ADAS_DOWNLOAD_URL
data
OPEN_ADAS_DOWNLOAD_URL = 'https://open.adas.ac.uk/download/adf11'
read_adf11
function
source
read_adf11(path: str | os.PathLike[str]) -> ADF11Data
Parse an unresolved ADF11 file and return its native log10 coefficient table.
vaft.data.pfile
The Osborne pfile: a native transcript, and its conversion.
kinetic_profiles_from_pfile
function
source
kinetic_profiles_from_pfile(pfile: PFile) -> KineticProfiles
Convert a pfile into the kinetic-profile container.
Also exported as vaft.data.kinetic_profiles_from_pfile.
PFile
class
source
PFile(psi_norm: np.ndarray, sections: tuple[PFileSection, ...] = (), species: tuple[Species, ...] = (), source: str = '') -> None
One Osborne pfile as it was written: sections in order, units as declared.
Also exported as vaft.data.PFile.
PFILE_LABELS
data
PFILE_LABELS = <builtins.dict>
PFILE_SECTION_ORDER
data
PFILE_SECTION_ORDER = ('ne', 'ni', 'nz1', 'nb', 'te', 'ti', 'ptot', 'pb', 'omeg', 'omegp', 'omgvb', 'omgpp', 'omgeb', 'er', 'ommvb', 'ommpp...
PFILE_TO_CONTAINER
data
PFILE_TO_CONTAINER = <builtins.dict>
PFILE_UNIT_LADDER
data
PFILE_UNIT_LADDER = <builtins.dict>
PFILE_UNITS
data
PFILE_UNITS = <builtins.dict>
PFileFormatError
class
source
The file is not shaped like an Osborne pfile.
Also exported as vaft.data.PFileFormatError.
PFileSection
class
source
PFileSection(key: str, unit: str, psi_norm: np.ndarray, values: np.ndarray, derivative: np.ndarray | None = None) -> None
One block of a pfile, in the file’s own units.
Also exported as vaft.data.PFileSection.
5 fields · 1 members
key: strunit: strpsi_norm: np.ndarrayvalues: np.ndarrayderivative: np.ndarray | Nonelabelproperty — What the quantity is, or""for a section not catalogued here. source
read_pfile
function
source
read_pfile(path: str | Path) -> PFile
Read an Osborne pfile.
Also exported as vaft.data.read_pfile.
write_pfile
function
source
write_pfile(pfile: PFile, path: str | Path, *, recompute_derivatives: bool = False) -> Path
Write an Osborne pfile.
Also exported as vaft.data.write_pfile.
vaft.data.public
Public multi-machine databases mapped into common VAFT semantics (#1205).
ChecksumError
class
source
The file does not match the SHA-256 pinned for its release.
CONFINEMENT_COLUMNS
data
CONFINEMENT_COLUMNS = <builtins.dict>
fetch_source
function
source
fetch_source(key: str, *, cache: str | os.PathLike[str] | None = None, timeout: float = 120.0) -> Path
Fetch a registered public database file by its SOURCES key.
FetchError
class
source
The upstream host could not deliver the file (network or HTTP failure).
MHD_STATE_COLUMNS
data
MHD_STATE_COLUMNS = <builtins.dict>
OPTIONAL_CONFINEMENT_COLUMNS
data
OPTIONAL_CONFINEMENT_COLUMNS = ('w_global_J', 'tau_e_global_s', 'w_global_definition', 'tau_e_global_definition')
PR08_MACHINES
data
PR08_MACHINES = <builtins.dict>
PROVENANCE_KINDS
data
PROVENANCE_KINDS = ('source_direct', 'source_corrected', 'equilibrium_derived', 'deterministic_derived', 'model_imputed', 'source_invali...
SOURCES
data
SOURCES = <builtins.dict>
TRANSITION_COLUMNS
data
TRANSITION_COLUMNS = <builtins.dict>
vaft.data.public.analysis
Scaling predictions and coverage on the canonical confinement table.
confinement_coverage
function
source
confinement_coverage(table: pd.DataFrame, columns: tuple[str, ...] = ('i_p_A', 'b_t_T', 'n_e_line_avg_m3', 'p_loss_W', 'tau_e_th_s', 'r_geo_m', 'epsilon', 'kappa', 'kappa_area', 'delta',..., *, by: str = 'machine') -> pd.DataFrame
Count finite values per column and group.
Also exported as vaft.data.public.confinement_coverage.
h_factor
function
source
h_factor(table: pd.DataFrame, scaling: str = 'H98y2', *, kappa_column: str = 'kappa_area', thermal_as_global=False) -> pd.Series
Confinement enhancement factor tau_observed / tau_scaling per row, on the scaling’s energy basis.
Also exported as vaft.data.public.h_factor.
predict_confinement_time
function
source
predict_confinement_time(table: pd.DataFrame, scaling: str = 'H98y2', *, kappa_column: str = 'kappa_area') -> pd.Series
Scaling-law thermal confinement time for every row of a confinement table.
Also exported as vaft.data.public.predict_confinement_time.
SCALING_INPUTS
data
SCALING_INPUTS = <builtins.dict>
transition_margin
function
source
transition_margin(table: pd.DataFrame) -> pd.Series
Loss power over the record’s scaling threshold, p_loss_W / p_lh_scaling_W.
Also exported as vaft.data.public.transition_margin.
vaft.data.public.itpa_hmode
ITPA global H-mode confinement database (DB5.2.3) reader and normaliser.
DB5_COLUMN_MAP
data
DB5_COLUMN_MAP = <builtins.dict>
DB5_DEFINITIONS
data
DB5_DEFINITIONS = <builtins.dict>
normalize_db5
function
source
normalize_db5(raw: pd.DataFrame, *, release: str = 'DB5.2.3') -> pd.DataFrame
Map a raw DB5.2.3 table into the canonical confinement table.
Also exported as vaft.data.public.normalize_db5.
read_db5
function
source
read_db5(path: str | os.PathLike[str] | None = None, *, cache: str | os.PathLike[str] | None = None) -> pd.DataFrame
Read the raw DB5.2.3 CSV with its original column names.
Also exported as vaft.data.public.read_db5.
vaft.data.public.itpa_profile
ITPA International Multi-Tokamak Confinement Profile Database (PR08) reader and ODS mapping.
fetch_pr08
function
source
fetch_pr08(machine: str, shot, *, cache: str | os.PathLike[str] | None = None, sha256: dict[str, str] | None = None, allow_unpinned: bool = False, timeout: float = 120.0) -> Pr08Discharge
Download one PR08 discharge (checksum-verified) and read it.
Also exported as vaft.data.public.fetch_pr08.
PR08_BASE_URL
data
PR08_BASE_URL = 'https://tokamak-profiledb.ccfe.ac.uk/PR08/itpa_pr08'
pr08_mapping_coverage
function
source
pr08_mapping_coverage(discharge: Pr08Discharge) -> pd.DataFrame
Which PR08 variables reached the ODS, where, and why the others did not.
Also exported as vaft.data.public.pr08_mapping_coverage.
PR08_PINNED
data
PR08_PINNED = <builtins.dict>
PR08_REFERENCE
data
PR08_REFERENCE = "D. Boucher et al., 'The International Multi-Tokamak Profile Database', Nucl. Fusion 40 (2000) 1955, doi:10.1088/0029...
pr08_to_omas
function
source
pr08_to_omas(discharge: Pr08Discharge, ods=None)
Map a PR08 discharge into an ODS, without interpolation or invented data.
Also exported as vaft.data.public.pr08_to_omas.
Pr08Discharge
class
source
Pr08Discharge(machine: str, shot: str, zero_d: pd.DataFrame, one_d: dict[str, UFileSignal], two_d: dict[str, UFileSignal], comments: str = '', files: dict[str, str] = <factory>, verification: dict[str, str] = <factory>) -> None
One PR08 discharge, as released.
8 fields
machine: strshot: strzero_d: pd.DataFrameone_d: dict[str, UFileSignal]two_d: dict[str, UFileSignal]comments: strfiles: dict[str, str]verification: dict[str, str]
read_pr08
function
source
read_pr08(directory: str | os.PathLike[str], machine: str, shot) -> Pr08Discharge
Read one PR08 discharge from a local directory.
Also exported as vaft.data.public.read_pr08.
read_pr08_0d
function
source
read_pr08_0d(path: str | os.PathLike[str]) -> pd.DataFrame
Read a PR08 _0d.dat file, CSV or fixed-width.
read_ufiles
function
source
read_ufiles(path: str | os.PathLike[str]) -> dict[str, UFileSignal]
Read a file of concatenated ASCII UFILEs (PR08 _1d / _2d files).
UFileSignal
class
source
UFileSignal(name: str, unit: str, time: np.ndarray, values: np.ndarray, rho: np.ndarray | None = None, comment: str = '') -> None
One UFILE block, in the file’s own names and units.
6 fields
name: strunit: strtime: np.ndarrayvalues: np.ndarrayrho: np.ndarray | Nonecomment: str
vaft.data.public.itpa_tc26
ITPA TC-26 metal-wall L-H threshold database reader and normaliser.
normalize_tc26
function
source
normalize_tc26(raw: pd.DataFrame, *, release: str | None = None) -> pd.DataFrame
Map a raw TC-26 table into the canonical transition table.
Also exported as vaft.data.public.normalize_tc26.
read_tc26
function
source
read_tc26(path: str | os.PathLike[str]) -> pd.DataFrame
Read the TC-26 CSV with its original column names, missing markers resolved.
Also exported as vaft.data.public.read_tc26.
TC26_DEFINITIONS
data
TC26_DEFINITIONS = <builtins.dict>
TC26_REFERENCE
data
TC26_REFERENCE = "E. Delabie et al., 'Empirical scaling of the L-H threshold power for metal wall tokamaks using a multi-device databa...
TC26_SHA256
data
TC26_SHA256 = 'b900e13fcb7973ae9b85f4df5264e65cc19ed3bef026076739331e3868878582'
vaft.data.public.pr08_mhd_state
PR08 global MHD states as one canonical row-oriented table (#1736).
fetch_pr08_population
function
source
fetch_pr08_population(*, machines: Optional[Sequence[str]] = None, cache=None, timeout: float = 120.0) -> list
Download (checksum-verified) and read every pinned PR08 0D file.
Also exported as vaft.data.public.fetch_pr08_population.
MHD_STATE_COLUMNS
data
MHD_STATE_COLUMNS = <builtins.dict>
mhd_state_coverage
function
source
mhd_state_coverage(table: pd.DataFrame) -> pd.DataFrame
States and finite values per machine and quantity.
Also exported as vaft.data.public.mhd_state_coverage.
pr08_inventory
function
source
pr08_inventory(*, base_url: str = 'https://tokamak-profiledb.ccfe.ac.uk/PR08/itpa_pr08', timeout: float = 60.0) -> pd.DataFrame
Crawl the live PR08 directory index (network).
Also exported as vaft.data.public.pr08_inventory.
PR08_MACHINES
data
PR08_MACHINES = <builtins.dict>
pr08_mhd_state_table
function
source
pr08_mhd_state_table(discharges: Iterable[Pr08ZeroD]) -> pd.DataFrame
The canonical global MHD-state table of PR08 discharges.
Also exported as vaft.data.public.pr08_mhd_state_table.
pr08_release_inventory
function
source
pr08_release_inventory() -> pd.DataFrame
The PR08 release as pinned in this package (offline).
Also exported as vaft.data.public.pr08_release_inventory.
projection_coverage
function
source
projection_coverage(table: pd.DataFrame) -> pd.DataFrame
Which registered operational-space projections each machine’s states can be drawn on.
Also exported as vaft.data.public.projection_coverage.
PROVENANCE_KINDS
data
PROVENANCE_KINDS = ('source_direct', 'source_corrected', 'equilibrium_derived', 'deterministic_derived', 'model_imputed', 'source_invali...
read_pr08_zero_d
function
source
read_pr08_zero_d(path, machine_dir: str, shot: str, *, directory: Optional[str] = None) -> Pr08ZeroD
Read one local PR08 _0d.dat file for pr08_mhd_state_table.
Also exported as vaft.data.public.read_pr08_zero_d.
SOURCE_CORRECTIONS
data
SOURCE_CORRECTIONS = <builtins.dict>
UNIT_SLIP_FACTOR
data
UNIT_SLIP_FACTOR = 100.0
vaft.data.public.schema
Canonical tables shared by every public-database source.
ColumnSpec
class
source
ColumnSpec(unit: str, description: str) -> None
Unit and meaning of one canonical column.
2 fields
unit: strdescription: str
CONFINEMENT_COLUMNS
data
CONFINEMENT_COLUMNS = <builtins.dict>
empty_confinement_table
function
source
empty_confinement_table() -> pd.DataFrame
An empty canonical confinement table with the right columns and dtypes.
Also exported as vaft.data.public.empty_confinement_table.
empty_transition_table
function
source
empty_transition_table() -> pd.DataFrame
An empty canonical transition table with the right columns and dtypes.
Also exported as vaft.data.public.empty_transition_table.
make_record_id
function
source
make_record_id(machine: str, shot, time_s) -> str
Canonical record identifier.
OPTIONAL_CONFINEMENT_COLUMNS
data
OPTIONAL_CONFINEMENT_COLUMNS = ('w_global_J', 'tau_e_global_s', 'w_global_definition', 'tau_e_global_definition')
TRANSITION_COLUMNS
data
TRANSITION_COLUMNS = <builtins.dict>
validate_confinement_table
function
source
validate_confinement_table(table: pd.DataFrame) -> pd.DataFrame
Check a table against the canonical schema and return it column-ordered.
Also exported as vaft.data.public.validate_confinement_table.
validate_transition_table
function
source
validate_transition_table(table: pd.DataFrame) -> pd.DataFrame
Check a table against the canonical transition schema.
Also exported as vaft.data.public.validate_transition_table.
vaft.data.public.tcv_lh
TCV L-H transition database (public limited dataset) reader and normaliser.
normalize_tcv_lh
function
source
normalize_tcv_lh(raw: pd.DataFrame, *, release: str = 'Zenodo 14996664 (2025-03-09)') -> pd.DataFrame
Map a raw TCV L-H table into the canonical transition table.
Also exported as vaft.data.public.normalize_tcv_lh.
read_tcv_lh
function
source
read_tcv_lh(path: str | os.PathLike[str] | None = None, *, cache: str | os.PathLike[str] | None = None) -> pd.DataFrame
Read the TCV lhdatabase.h5 with its original variable names.
Also exported as vaft.data.public.read_tcv_lh.
TCV_LH_DEFINITIONS
data
TCV_LH_DEFINITIONS = <builtins.dict>
vaft.data.public.vest_confinement
VEST side of the canonical confinement table.
load_vest_tier_a_confinement
function
source
load_vest_tier_a_confinement(selection: str | None = 'primary', *, path=None) -> pd.DataFrame
VEST Tier A confinement rows with a measured ohmic power balance (#548).
Also exported as vaft.data.public.load_vest_tier_a_confinement.
vest_ods_to_confinement_rows
function
source
vest_ods_to_confinement_rows(ods, *, effective_mass_amu: float, release: str = '') -> pd.DataFrame
Canonical confinement rows from a VEST ODS, one per equilibrium slice.
Also exported as vaft.data.public.vest_ods_to_confinement_rows.
VEST_REFERENCE_RADIUS_M
data
VEST_REFERENCE_RADIUS_M = 0.4
VEST_SUMMARY_DEFINITIONS
data
VEST_SUMMARY_DEFINITIONS = <builtins.dict>
vest_summary_to_confinement_table
function
source
vest_summary_to_confinement_table(summary: pd.DataFrame, *, effective_mass_amu: float, release: str = '') -> pd.DataFrame
Convert core_profiles summary rows into the canonical confinement table.
Also exported as vaft.data.public.vest_summary_to_confinement_table.
VEST_TIER_A_BLOCK_SPLIT_SHOT
data
VEST_TIER_A_BLOCK_SPLIT_SHOT = 42000
VEST_TIER_A_SELECTIONS
data
VEST_TIER_A_SELECTIONS = <builtins.mappingproxy>
vaft.data.reference_samples
Semantic normalization and verification for paired reference samples.
semantic_sample_view
function
source
semantic_sample_view(data: Any, manifest: Mapping[str, Any]) -> dict[str, Any]
Flatten an ODS and retain representation-independent semantic leaves.
sha256_file
function
source
sha256_file(path: str | Path) -> str
verify_sample_artifacts
function
source
verify_sample_artifacts(sample_root: str | Path, manifest: Mapping[str, Any]) -> dict[str, str]
Verify all representation checksums and return computed digests.
vaft.data.resources
Access packaged VAFT sample and fixture data.
available_samples
function
source
available_samples() -> tuple[int, ...]
Return registered sample shot numbers in ascending order.
Also exported as vaft.data.available_samples.
data_path
function
source
data_path(name: str = '') -> Path
Return an absolute path inside the packaged vaft/data directory.
Also exported as vaft.data.data_path.
require_repository_sample
function
source
require_repository_sample(path: Path) -> Path
Return an archived sample path or explain how to obtain it.
sample
function
source
sample(shot: int, representation: str = 'omas') -> Path
Return an artifact path compatible with the requested data adapter.
Also exported as vaft.data.sample.
sample_camera_visible_frame_paths
function
source
sample_camera_visible_frame_paths(shot: int = 39915) -> list[tuple[float, Path]]
Return (time_s, path) pairs for packaged FAST-camera sample frames.
Also exported as vaft.data.sample_camera_visible_frame_paths.
sample_geqdsk
function
source
sample_geqdsk(name: str = 'efit/g039915.00319')
Load one packaged GEQDSK sample as a vaft.data.eqdsk.GEQDSK.
Also exported as vaft.data.sample_geqdsk.
sample_manifest
function
source
sample_manifest(shot: int) -> dict
Return the validated manifest for one registered reference sample.
Also exported as vaft.data.sample_manifest.
vaft.data.spectroscopy
Spectral-line identity: what a line is, and the IMAS processed_line.label codec.
describe_available
function
source
describe_available(labels: Iterable[str]) -> str
Name the semantic choices a set of stored labels offers.
Also exported as vaft.spectroscopy.describe_available (deprecated).
matches
function
source
matches(term: SpectralLineIdentity, identity: SpectralLineIdentity) -> bool
Whether a parsed selector selects a parsed line.
Also exported as vaft.spectroscopy.matches (deprecated).
parse_emission_term
function
source
parse_emission_term(term: Any) -> SpectralLineIdentity | None
Resolve a user-facing emission= term to a selector identity.
Also exported as vaft.spectroscopy.parse_emission_term (deprecated).
parse_line_label
function
source
parse_line_label(label: Any) -> SpectralLineIdentity | None
Parse a stored processed_line.label into an identity.
Also exported as vaft.spectroscopy.parse_line_label (deprecated).
SERIES_NAMES
data
SERIES_NAMES = ('alpha', 'beta', 'gamma', 'delta', 'epsilon')
Also exported as vaft.spectroscopy.SERIES_NAMES (deprecated).
SpectralLineIdentity
class
source
SpectralLineIdentity(species: AtomicSpecies, series: str | None = None, wavelength_angstrom: float | None = None, label: str = '') -> None
What one spectral line is: a species, a series member, a wavelength.
Also exported as vaft.spectroscopy.LineIdentity (deprecated).
4 fields
species: AtomicSpeciesseries: str | Nonewavelength_angstrom: float | Nonelabel: str
vaft.data.synthetic_kinetic_profiles
Records for synthetic kinetic profiles generated from a magnetic equilibrium (#122).
Composition
class
source
Composition(main_ion: str = 'H', impurity: str | None = None, z_eff: float = 1.0, impurity_charge: float | None = None) -> None
A hydrogenic main ion and at most one fully stripped impurity.
Also exported as vaft.data.Composition.
4 fields
main_ion: strimpurity: str | Nonez_eff: floatimpurity_charge: float | None
GradientProfile
class
source
GradientProfile(x: np.ndarray, a_over_L: np.ndarray, boundary_value: float, boundary_position: float = 1.0, coordinate: str = 'rho_tor_norm', unit: str = '') -> None
A profile defined by its normalized logarithmic gradient (Level 3).
Also exported as vaft.data.GradientProfile.
ION_SPECIES
data
ION_SPECIES = <builtins.mappingproxy>
IonSpecies
class
source
IonSpecies(label: str, z: float, a: float, role: str) -> None
One ion species of a generated state: label, charge, mass and role.
Also exported as vaft.data.IonSpecies.
4 fields · 1 members
label: strz: floata: floatrole: strelementproperty — The element symbol, hydrogen for D and T [-]. source
PRESSURE_CLOSURES
data
PRESSURE_CLOSURES = <builtins.dict>
PRESSURE_CONSTRAINTS
data
PRESSURE_CONSTRAINTS = ('equilibrium', 'thermal_energy', 'kinetic')
PressureClosureReport
class
source
PressureClosureReport(mode: str, closure: str | None, held: tuple[str, ...], solved: tuple[str, ...], absolute_residual: np.ndarray | None, relative_residual: np.ndarray | None, max_relative_residual: float, rms_relative_residual: float, thermal_energy_eq: float, thermal_energy_kin: float, thermal_energy_relative_difference: float, pressure_floor: float, tolerance: float, locally_consistent: bool, closure_exact_up_to_psi_n: float = nan, edge_max_relative_residual: float = nan) -> None
How the kinetic pressure compares with the equilibrium’s, and why.
Also exported as vaft.data.PressureClosureReport.
16 fields
mode: strclosure: str | Noneheld: tuple[str, ...]solved: tuple[str, ...]absolute_residual: np.ndarray | Nonerelative_residual: np.ndarray | Nonemax_relative_residual: floatrms_relative_residual: floatthermal_energy_eq: floatthermal_energy_kin: floatthermal_energy_relative_difference: floatpressure_floor: floattolerance: floatlocally_consistent: boolclosure_exact_up_to_psi_n: floatedge_max_relative_residual: float
ProfileSpec
class
source
ProfileSpec(shape: Any, target: ScalarTarget | None = None, peaking_factor: float | None = None) -> None
One kinetic channel: a shape, and optionally what normalizes it.
Also exported as vaft.data.ProfileSpec.
3 fields
shape: Anytarget: ScalarTarget | Nonepeaking_factor: float | None
SCALAR_TARGET_KINDS
data
SCALAR_TARGET_KINDS = ('axis', 'separatrix', 'line_average', 'volume_average', 'greenwald_fraction')
ScalarTarget
class
source
ScalarTarget(kind: str, value: float) -> None
One scalar a profile is normalized to by scaling its amplitude.
Also exported as vaft.data.ScalarTarget.
2 fields
kind: strvalue: float
SqrtPressureSplit
class
source
SqrtPressureSplit(te_axis: float | None = None, ne_over_te: float | None = None) -> None
The Level 0 amplitude: exactly one of an axis T_e or a fixed n_e/T_e.
Also exported as vaft.data.SqrtPressureSplit.
2 fields
te_axis: float | Nonene_over_te: float | None
SYNTHETIC_PROFILE_STATUSES
data
SYNTHETIC_PROFILE_STATUSES = ('success', 'invalid_equilibrium', 'invalid_profile_model', 'invalid_gradient_model', 'invalid_normalization', 'inval...
SYNTHETIC_PROFILE_UNITS
data
SYNTHETIC_PROFILE_UNITS = <builtins.mappingproxy>
SyntheticKineticProfiles
class
source
SyntheticKineticProfiles(label: str, status: str, message: str, fidelity_level: int, psi_norm: np.ndarray, rho_pol_norm: np.ndarray, rho_tor_norm: np.ndarray | None, psi: np.ndarray | None, volume: np.ndarray, n_e: np.ndarray, n_i: np.ndarray, n_impurity: np.ndarray, T_e: np.ndarray, T_i: np.ndarray, z_eff: np.ndarray, p_e: np.ndarray, p_i: np.ndarray, p_total: np.ndarray, p_eq: np.ndarray, species: tuple[IonSpecies, ...], pressure: PressureClosureReport, targets: tuple[TargetResidual, ...], validation: Mapping[str, Any], resolved: Mapping[str, Any], spec: SyntheticKineticSpec, provenance: Mapping[str, Any], time: float | None = None) -> None
A synthetic kinetic state generated from an equilibrium, with its checks.
Also exported as vaft.data.SyntheticKineticProfiles.
27 fields · 5 members
label: strstatus: strmessage: strfidelity_level: intpsi_norm: np.ndarrayrho_pol_norm: np.ndarrayrho_tor_norm: np.ndarray | Nonepsi: np.ndarray | Nonevolume: np.ndarrayn_e: np.ndarrayn_i: np.ndarrayn_impurity: np.ndarrayT_e: np.ndarrayT_i: np.ndarrayz_eff: np.ndarrayp_e: np.ndarrayp_i: np.ndarrayp_total: np.ndarrayp_eq: np.ndarrayspecies: tuple[IonSpecies, ...]pressure: PressureClosureReporttargets: tuple[TargetResidual, ...]validation: Mapping[str, Any]resolved: Mapping[str, Any]spec: SyntheticKineticSpecprovenance: Mapping[str, Any]time: float | Noneokproperty — Whether every requested constraint was met [-]. sourceunitmethod — The unit of one of the result’s arrays. sourcecoordinatemethod — The grid expressed inpsi_norm,rho_pol_normorrho_tor_norm[-]. sourcea_over_Lmethod —-d ln f/dxofn_e,T_eorT_i, by second-order differences on the grid [-]. sourceto_kinetic_profilesmethod — The state as the package’s kinetic-profile container, same units, same grid. source
SyntheticKineticSpec
class
source
SyntheticKineticSpec(temperature: TemperatureAssumption, composition: Composition = <factory>, n_e: ProfileSpec | None = None, T_e: ProfileSpec | None = None, pressure_constraint: str = 'kinetic', closure: str | None = None, sqrt_split: SqrtPressureSplit | None = None, psi_norm: np.ndarray | None = None, label: str = 'synthetic', edge_floor: float = 0.01, edge_value: float | None = None) -> None
Everything the generator is told, separate from the equilibrium it is applied to.
Also exported as vaft.data.SyntheticKineticSpec.
11 fields
temperature: TemperatureAssumptioncomposition: Compositionn_e: ProfileSpec | NoneT_e: ProfileSpec | Nonepressure_constraint: strclosure: str | Nonesqrt_split: SqrtPressureSplit | Nonepsi_norm: np.ndarray | Nonelabel: stredge_floor: floatedge_value: float | None
SyntheticProfileError
class
source
SyntheticProfileError(status: str, message: str)
An assumption set the generator refuses, with the status that names why.
Also exported as vaft.data.SyntheticProfileError.
TabulatedProfile
class
source
TabulatedProfile(x: np.ndarray, values: np.ndarray, coordinate: str = 'rho_tor_norm', interpolation: str = 'pchip', extrapolation: str = 'refuse', unit: str = '') -> None
A user-supplied profile on a declared radial coordinate.
Also exported as vaft.data.TabulatedProfile.
6 fields
x: np.ndarrayvalues: np.ndarraycoordinate: strinterpolation: strextrapolation: strunit: str
TargetResidual
class
source
TargetResidual(name: str, definition: str, requested: float, achieved: float, residual: float, relative_residual: float, solver_status: str, tolerance: float, met: bool) -> None
One requested constraint beside the value recomputed from the final profiles.
Also exported as vaft.data.TargetResidual.
9 fields
name: strdefinition: strrequested: floatachieved: floatresidual: floatrelative_residual: floatsolver_status: strtolerance: floatmet: bool
TemperatureAssumption
class
source
TemperatureAssumption(ti_over_te: Any = None, T_i: ProfileSpec | None = None, electron_pressure_fraction: float | None = None, source: str = 'assumed') -> None
How the ion temperature follows, exactly one route of three.
Also exported as vaft.data.TemperatureAssumption.
4 fields · 1 members
ti_over_te: AnyT_i: ProfileSpec | Noneelectron_pressure_fraction: float | Nonesource: strrouteproperty —"ratio","profile"or"partition"[-]. source
vaft.data.vfit
Read VFIT FEM/GSE MATLAB results and convert them to OMAS.
read_vfit
function
source
read_vfit(path: str | Path, kind: Literal['auto', 'fem', 'gse'] = 'auto') -> VFITResult
Read a VFIT v5/v7 MAT result.
Also exported as vaft.data.read_vfit.
VFITKind
function
VFITKind(*args, **kwargs)
VFITResult
class
source
VFITResult(kind: VFITKind, source: Path, shot: int, times: np.ndarray, raw: Mapping[str, Any]) -> None
A normalized VFIT FEM or Grad–Shafranov-equilibrium MAT result.
Also exported as vaft.data.VFITResult.
5 fields · 7 members
kind: VFITKindsource: Pathshot: inttimes: np.ndarrayraw: Mapping[str, Any]time_countproperty sourceto_omasmethod — Convert all result times to OMAS equilibrium slices. sourceto_imasmethod — Convert through OMAS and save using VAFT’s IMAS writer. sourceplot_equilibriummethod — Plot a VFIT equilibrium field with boundary and flux-surface overlays. sourceplot_profilesmethod — Plot available 1D VFIT profiles (q/J; additionally P/F for GSE). sourceplot_wall_currentsmethod — Plot discretized VEST passive-wall current at one equilibrium time. sourceplot_magnetics_residualsmethod — Plot VFIT magnetic-constraint residuals at their R-Z probe locations. source