Process reference: transients
Generated from the docstrings of vaft.process.transients:
2 public functions. Each entry is what
vaft.process.describe("transients.<name>") prints.
All process categories
Overview
A current quench and the brief rise of current that can precede it are the
two features of a plasma-current record a transient-event analysis starts
from. Everything here measures them – times, rates, amplitudes – on a
(time, current) pair and knows nothing about the machine that produced it.
| Symbol | Meaning | Unit |
|---|---|---|
| t | time | s |
| I_p | plasma current, as stored | A |
| I_ref | reference current the fractions are taken of | A |
| t_80, t_20 | last 80 % and first 20 % crossings of the quench | s |
| dI/dt | rate of change of the current magnitude | A/s |
Numbers, not names. A quench found here is a fall of the current magnitude through two fractions of a reference; a spike is a short positive excursion above the local trend. Neither is called an internal reconnection event or a disruption: that is a classification, and it needs evidence – the magnetic fluctuation, the radiation, the position – that a current record alone does not carry.
The sign of the stored current is removed. Every quantity is measured on
polarity * I_p, where polarity is the sign of the current at its
largest magnitude, and the polarity is returned, so a machine that stores a
negative current gets the same numbers as one that stores a positive one.
Absence is an answer. A record with no quench, or no spike above its own
noise, returns a result whose measured fields are None and whose
reason says why, never the record bounds or its loudest noise sample.
Functions
current_quench | Time a current quench between 80 % and 20 % of a reference current, and its fastest fall. Convention |
current_spike | Measure a short positive rise of the current magnitude above its trend, before a quench. Convention |
No function matches.
current_quench
Machine-independentConvention-sensitive
source
current_quench(time, ip, *, window=None, reference_current=None, smoothing_s=None)
Time a current quench between 80 % and 20 % of a reference current, and its fastest fall.
| Name | Type | Unit | Description |
|---|---|---|---|
time | array_like | s | Strictly increasing sample times. |
ip | array_like | A | Plasma current, either sign. |
window | sequence of float, optional | s |
|
reference_current | float, optional | A | Current the fractions are taken of; default the largest magnitude in the window. |
smoothing_s | float, optional | s | Width of a quadratic Savitzky-Golay window the rate is taken with; |
| Returns | |||
| — | CurrentQuench | - | The reference current in amperes, the 80 % and 20 % crossing times, their separation and its extrapolation to a full quench in seconds, the most negative rate of change of the current magnitude in amperes per second and when it occurred, the polarity, and |
Convention
Measured on the magnitude. didt_min is the most negative rate of the
polarity-corrected current, so a falling current reads negative whichever
sign the machine stores. The rate is searched between the two crossings
only, so the sharp fall at the end of a spike before the 80 % crossing is
not mistaken for the quench rate.
extrapolated_quench_time is duration_80_20 / 0.6, the ITPA convention
for the time a linear quench would take from 100 % to zero.
Processing steps · Defaults · Applicability · Limitations · Provenance
Processing steps
- Restrict to the window and flip the record to positive polarity.
- Take the reference current, and the time of the largest magnitude.
- Find the first sample after that time below 20 % of the reference, and
the last sample before it at or above 80 %; interpolate both crossings.
With no sample at or above 80 % in between – a
reference_currentabove the peak divided by 0.8 – stop with a reason. - Differentiate the magnitude – centred differences, or a quadratic
Savitzky-Golay derivative over
smoothing_s– and take its minimum between the two crossings.
Defaults
The 80 % and 20 % fractions are the conventional ITPA disruption-database
values. With no reference_current the largest magnitude in the window is
used, a numerical convenience.
Applicability
Machine-independent.
Limitations
The default reference is the largest magnitude, so a spike on the flat top
raises it and moves both crossings slightly earlier; pass
reference_current to use a plateau value instead. Only the first fall
through 20 % after the largest magnitude is timed. A spike inside the
quench still contributes the fall that ends it, which can be several times
the mean quench rate; time_didt_min says where the minimum was, and
current_spike with before= set past it measures the spike. The raw
derivative of a noisy record is dominated by the noise; smoothing_s
exists for that, and assumes uniform sampling (it uses the median step).
Provenance
- A. Savitzky and M. J. E. Golay, Anal. Chem. 36 (1964) 1627, as implemented by
scipy.signal.savgol_filter: the smoothed rate.
current_spike
Machine-independentConvention-sensitive
source
current_spike(time, ip, *, before=None, lookback_s=0.002, trend_s=0.0005, n_sigma=5.0)
Measure a short positive rise of the current magnitude above its trend, before a quench.
| Name | Type | Unit | Description |
|---|---|---|---|
time | array_like | s | Strictly increasing sample times. |
ip | array_like | A | Plasma current, either sign. |
before | float, optional | s | End of the search; default the quench’s 80 % crossing from |
lookback_s | float, optional | s | Length of the search window ending at |
trend_s | float, optional | s | Width of the centred median filter that defines the trend. |
n_sigma | float, optional | - | Robust standard deviations of the residual a spike must exceed. |
| Returns | |||
| — | CurrentSpike | - | The time of the largest excursion in seconds, its height above the trend in amperes and as a fraction of the trend current, the trend current and the noise’s robust sigma in amperes, the search end, the polarity, and |
Convention
Positive on the magnitude. A spike is a rise of the polarity-corrected current, so on a machine that stores a negative current it is a more negative excursion of the stored value. Its amplitude is reported positive.
Processing steps · Defaults · Applicability · Limitations · Provenance
Processing steps
- Flip the record to positive polarity.
- Take
beforeas given, or the 80 % crossing of the quench; with neither, stop with a reason. - Median-filter the magnitude over
trend_sand subtract it: an excursion shorter than half that width survives in the residual, the trend does not. - Within
[before - lookback_s, before]take the largest residual above the residual’s median, and the noise as the robust sigma of the first differences over the same samples divided by the square root of two. - Accept it only above
n_sigmarobust sigmas.
Defaults
lookback_s = 2 ms and trend_s = 0.5 ms are empirical, a numerical
convenience sized for sub-millisecond excursions on a current that changes over
milliseconds, as in a small tokamak; a longer discharge wants both scaled.
n_sigma = 5 is a numerical convenience that keeps the largest of a few
hundred Gaussian residual samples below the threshold.
Applicability
Machine-independent.
Limitations
One spike: the largest excursion in the window. An excursion longer than
half of trend_s is absorbed into the trend and not reported. Pickup from a
coil switching at the same time looks identical in a current record; nothing
here can tell them apart.