Collisional radiative model for the evaluation of the thermal helium beam diagnostic at ASDEX upgrade

The thermal helium beam diagnostic at ASDEX Upgrade is used to infer the electron density n e and temperature T e in the scrape-off layer and the pedestal region from the emission of visible lines of the locally injected helium. The link between n e and T e and the emission is provided by a collisional radiative model, which delivers the evolution of the populations of the relevant excited states as the He atoms travel through the plasma. A computationally efficient method with just three effective states is shown to provide a good approximation of the population dynamics. It removes an artificial rise of T e at the plasma edge when using a simple static model. Furthermore, the re-absorption of the vacuum ultra-violet resonance lines has been introduced as an additional excitation mechanism being mainly important in the region close to the injection point. This extra excitation leads to a much better fit of the measured line ratios in this region for larger puff rates.


Introduction
Thermal helium beam (THB) diagnostics are used to determine the electron temperature and density in the scrape-off layer (SOL) and at the very edge of the confined region of magnetic fusion devices [1]. For this, helium at room temperature is locally injected into the plasma, using a piezo valve. Via an 3 See author list of H Meyer et al 2019 Nucl. Fusion 59 112014. 4 These authors contributed equally. * Author to whom any correspondence should be addressed.
Original Content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI. optical head mounted in the vessel, the line emission caused by the injected helium is measured. To translate the measured intensities into electron temperature (T e ) and density (n e ) values, a collisional radiative model (CRM) is used. The most simple and computationally least expensive approach, i.e. the static model, assumes that all states of the observed helium atoms are in a local collisional radiative equilibrium (CRE). Then, the local emission coefficient per helium atom is just a function of n e and T e . So far, we used the corresponding dataset pec96#he_pju#he0.dat from ADAS [2] to evaluate the THB diagnostic at ASDEX Upgrade [3]. However, the equilibrium condition holds only in the region close to the separatrix, with a sufficiently high electron density causing high collision rates. Further outside, the evaluation with the static model produces an artificial temperature rise in the far SOL [4]. The appearance of the high electron temperatures is produced by the long equilibration times between singlet and triplet states. It can be avoided when calculating the time dependent solution of the CRM, as has been shown in [1], where the time dependent solution of the full model is used in the low electron density region and the static model in the region with high electron density. Here, we use a different approach based on the generalised collisional-radiative (GCR) coefficients [5], which allow to calculate the dynamics of the system using only a few metastable states (in our case three states). This approach, which is called in the ADAS framework the resolved picture, is sufficiently exact and fast, such that it can be used for the whole evolution into the region with high electron density.
The transitions of neutral helium are purely determined by electron collisions and photon emission. Other processes like recombination, ion excitation [1] and charge exchange reactions [6] are much weaker and are not included in our approach. However, the re-absorption of helium resonance line emission is an additional mechanism, exciting the atomic system. It results from the absorption of helium lines which are emitted from the helium cloud. This effect has only been treated in helium plasmas so far [7][8][9][10]. For the typical temperature and density profiles, the opacity for these vacuumultraviolet lines leads to significant transition rates in the atoms, changing the line emission of the measured visible transitions. This effect is included in a new CRM, which is based on a dynamic approach to calculate the population of the helium states.
This paper is organized as follows. The diagnostic is briefly explained in section 2. In section 3, the new CRM is explained, improving the previous model by a dynamic state calculation and the introduction of the re-absorption. Section 4 explains the data processing and fit to calculate the temperature and density profiles, as well as the uncertainties. The results from the different models are then compared in section 5. In section 6, the model and its results are summarized.

The helium beam diagnostic
A detailed explanation of the experimental setup can be found in [4]. The THB diagnostic at ASDEX Upgrade is located below the outer midplane. It consists of an in-vessel piezo valve, which injects helium from a reservoir at room temperature through a capillary into the SOL. Typical helium injection rates during the active phases are in the range of 1 × 10 19 to 4 × 10 19 s −1 . To determine the background radiation, the injection is modulated with a frequency of 10 Hz, consisting of equally long beam on and beam off phases. Laboratory measurements determined a half-opening angle of 20 • and a Gaussian density distribution, which is also assumed for the injection into the torus.
The helium cloud is observed by an optical head, which is located slightly above the valve and looks sidelong at the helium cloud. The head is roughly 67 cm away from the valve, giving the optical imaging a focal spot sizes of 3 mm in the helium cloud. The optical head measures 53 lines of sight, of The experimental setup of the THB diagnostic at ASDEX Upgrade. It consists of a piezo valve injecting helium, resulting in an expanding helium cloud in the torus. The excitation by the plasma leads to helium line emission, which is observed on 53 lines of sight, of which 27 are oriented radially. Image adapted from [4], with the permission of AIP Publishing. whom 27 are aligned in radial direction, as shown in figure 1. Other lines of sight were not utilized for the experiments presented here. Via long optical fibres, the light is guided to a polychromator system, which measures four atomic transitions. The radiances from the 587, 667, 706 and 728 nm lines are sampled with a frequency of 900 kHz.
The optical transmissions and the sensitivity of the system are calibrated annually in campaign breaks. The injection rates have been determined by puffing into an evacuated torus and measuring the resulting pressure rise.

The CRM of He
The new CRM aims to model the spectral emission of the injected helium cloud, based on given temperature and density profiles. As in other experiments [1,[11][12][13], the ASDEX Upgrade helium beam diagnostic measures the 728, 706 and the 667 nm lines, and in addition the 587 nm line [4], which typically shows the brightest emission among these lines. The 587 nm line was added to the polychromator system as it is additionally used for gas puff imaging [14]. For evaluating the reabsorption, the 501 nm singlet line would also be suitable [7], but for the given setup, the influence of the reabsorption can be seen on the singlet line ratio for high puffing rates as well (see figure 17(c)). These four line emissions are then modelled in the forward CRM. The origin of the lines is displayed in the Grotrian diagram in figure 2.

Modelling the dynamic state population
The CRM is based on the ADAS dataset helike_hps02he.d at [2]. It calculates the time derivative of the occupation N i of the lowest 19 states with electron configurations between 1 s 2 up to 1s4f. Higher energetic states are included via the socalled bundle-n approach [5]. For all the levels, the population is given by: , for j < i n e q i1 + ν abs,1→i , for j = 1(1s 2 1 S) and i = 1snp 1 P(n = 2, 3, 4) −n e s i − k̸ =i c ki , for j = i.
The reaction rate matrix c ij contains rates n e q ij , describing the excitation and de-excitation from state j to state i due to electron impact, with the electron density n e and the electron excitation coefficient q ij . Other process rates are the spontaneous radiative decay rates A j→i and ionisation rates n e s i of state i due to electron impact ionization, with the electron ionization coefficient s i . For the 1 snp 1 P (n = 2, 3, 4) states, absorption rates on the transitions from the ground state ν abs,1→i are added to the transition rates.
The absorption is only used on three transitions from 1 s 2 to 1 snp 1 P (n = 2, 3, 4). These lines, also called resonances, have by far the highest emission in the spectrum but their ultraviolet wavelengths cannot be directly measured with the given setup at ASDEX Upgrade. The transitions are displayed with the dotted lines in figure 2. The calculation of the re-absorption rates is described in section 3.3.
The He atoms start in the ground state when they exit the nozzle of the piezo valve. They shall have a velocity υ injected and move along the coordinate r. When prescribing the profiles of n e and T e along r, the excited state populations can be calculated from a numerical solution of the CRM along r: This approach implicitly assumes a constant velocity υ injected over the propagation distance. The value from equation (19) (1760 m s −1 ) is used, which is derived in section 3.4. Besides the assumption of a constant velocity, a static temperature and density profile is required as well. To do so, the experimental data is binned with 500 data points, resulting in an interval length of 1 ms, which means that fluctuations are averaged out. With a focal spot size of 3 mm [4], the premise of single temperature and density value per line of sight (LOS) is justified.
Solving equation (3) is computationally expensive (see also [1]) so that sufficiently exact approximative solutions are needed.
The most simple approach assumes that all excited levels are very fast in equilibrium with the ground state and that all populations decay with the same time constant. We call this the static model. Here, the relative abundances of the levels are given by the eigenvector connected to the longest eigentime of the system of linear differential equations. In the static model, the fractional abundance of state j f eq j = N eq j /N tot = N eq j / j N eq j only depends on the local temperature and density. A common way to evaluate the model without knowledge about the neutral helium density or the ionisation influencing this density is to use line ratios [4]. They are formed from two emitted lines and ignore the information from the shape of the intensity curve. As mentioned previously, this model produces the artificial temperature rise in the far-SOL.
A more exact approximation can be achieved by calculating the temporal evolution of m states. These states are the ground state and different numbers of metastable states, which is why the set is later referred to as metastables. In addition, this notation allows to distinguish between the levels in the full model and the calculation based on the m metastables. The levels referred as metastables are listed in table 1.
To distinguish the metastables from the full set of states, the metastables are indexed in the following with α and β. At first, we compute the relative equilibrium abundance r eq iα = N eq iα /N eq α of the ordinary levels i > m with respect to each meta-stable α ⩽ m by solving for each α the system of equations.
We then obtain generalised collisional radiative ionisation rate coefficient for each metastable S α = s α + 19 j=m+1 r eq jα s j (5) and the GCR mixing rate coefficients from β to α The temporal evolution of the occupation of all metastable levels is found by solving a reduced set of differential equations.
The elements C αβ are: After obtaining a solution for the temporal evolution of the metastables the occupation of the ordinary levels is then given by This approach strongly reduces the computational effort since it is about proportional with the square of the involved levels in the system of differential equation.
In figure 3, the solution of the full CRM (black lines) is compared with the results from this approach for two (upper row), three (second and third row), and four (lowest row) metastables (red lines) for all states in the shell with main quantum number n = 3. In all cases, the helium, which is injected in the ground state, propagates over a constant profile with density n e = 4.4 × 10 18 m −3 and T e = 19.6 eV. The evolution of the population with respect to the population of the ground state at the start of the injection , i.e. N j (t)/N(1s 2 , t = 0), is shown versus the path length r. The assumed injection velocity is 1760 m s −1 . Re-absorption processes are set to zero in this example. The singlet ground state 1 s 2 1 S is populated from the beginning and all states in the singlet system quickly equilibrate. After this short equilibration phase, the population of all singlet states decrease with the same decay length due to the ionisation. In contrast to this, the population of the triplet states show a significant longer equilibration phase. The different behaviour comes from the low transition rates between both spin systems. The approximate solution with two metastables (upper row) yields a too fast rise for the triplet states. When adding a third metastable, a very good match with the evolution of the full model can be achieved either for the singlet or the triplet levels. The addition of the 1s2s 1 S state, which was also used in [16], leads to a good description of the fast equilibration of the singlet states (second row). However, since it is more important to obtain a better representation of the triplet evolution, the addition of the 1s2p 3 P state is the preferred choice as can be seen in the third row of figure 3. Finally, when adding a fourth metastable, the evolution of both group of states can be achieved (lowest row). After a distance of 7 mm, all models show practically equal populations.
We conclude, that the model with three metastables using the 1s2p 3 P state adequately reproduces the populations from the full model, whereas the model with four metastables does not yield a significant improvement since it only affects the evolution directly after the injection, which is anyway not observed in the experiment. Therefore, the forward model was based on this choice with three metastables, which also saves some computational effort compared to the model with four metastables. Figure 4 shows the deviation of the static from the dynamic treatment for the more realistic case with increasing n e and T e along the path of the helium atom. We chose an exponential rise with a gradient length of 1.5 cm (upper left box of figure 4). The decay of the total helium occupation is displayed in the upper right box. In addition, the equilibration length λ 95 to reach 95% of the population balance in equilibrium is shown. This is calculated from the second longest eigentime τ 2 of equation (7): λ 95 = −τ 2 υ injected ln (0.05). The equilibration length starts at ≈10 cm and decays to values around 0.1 mm due to the increasing electron density. The fractional abundance of all states with main quantum number n = 3 is shown for static (dashed lines) and dynamic case (full lines) in the lower left box. The deviation between both approaches is largest for the triplet states. A quantification of the deviation is shown in the lower right box. Here, the ratio υ of the fractional abundances of two states is used and the relative deviation of the static values υ eq from the dynamic value υ is plotted. This is plotted for the ratio of the two singlet states, which converges the zero line at much lower path lengths than the ratio of a triplet to a singlet state. For this ratio, the deviation goes through zero at around 3 cm and then converges towards zero from negative values.
When just fitting the measured line ratios, only the ratio of the occupations of the upper levels of the lines multiplied with the respective transition probabilities need to be calculated.
Experimentally, this has the advantage, that only the relative calibration of the different wavelength channels needs to be known. However, it turned out, that it is advantageous to include also the radiance in the fit procedure. For the calculation of the radiance on the transition j → k, the corresponding line emission coefficient ϵ jk along the line-of-sight needs to be known. With the level occupation N j from equation (9) it is obtained from where n He,0 is the helium density of the non-attenuated beam. The shape of the beam profile was determined from camera measurements [17] using injections into a laboratory glow discharge. For a point with distance r to the nozzle and angle θ to the symmetry axis of the cloud, the density n He,0 can be described as the product of a Gaussian depending on sin θ times a radial decay with 1/r 2 .
n He,0 (r, θ) =Ṅ Here,Ṅ He is the injection rate and γ s = 0.411 yields 20 deg for the angle θ HWHM at which the density drops to one half. The remaining factors provide for a correct normalisation such that the integral of the flux density Γ He = n He,0 υ injected over a half sphere gives back the injection rate.

Uncertainty of the atomic data of the CRM
The atomic data set from ADAS also contains estimates for uncertainties of the rate coefficients for excitation and ionisation. The relative uncertainties are shown in table 2 in percentages. For the remaining transitions from n = 1 and 2 to n >3, a relative uncertainty of 15% is given, while the uncertainty of all other transitions from n = 3 to n = 4 is 30%. Finally, the uncertainty of the ionisation rate coefficients from n ⩾3 is 50%.
The uncertainties of all the derived GCR coefficients have been calculated from these values using the rule of error propagation, i.e. for the quantity f the standard deviation is (12) where the summation extends over all the 190 rate coefficients x i appearing in the model. For the excitation rate coefficients, the partial derivative of f with respect to a change of the excitation and the corresponding de-excitation rate was used.
The GCR ionisation rate coefficients S α (see equation (5)) and mixing coefficients Q αβ (see equation (6)) are used to calculate the temporal evolution of the occupation N α (t) of the metastables of He as the He atom moves through the plasma using equation (7). The uncertainties of the N α are again calculated with the rule of error propagation, where the uncertainty at time t 0 is depending on the uncertainties of S α and Q αβ at all times t < t 0 . Finally, we calculate the occupation N j of the radiating ordinary levels with equation (9) and use it to obtain the emitted photon rate per injected atom on the transition j to i by multiplying with the corresponding Einstein coefficient A ji . Here, the uncertainties of the metastable population and the photon emissivity coefficients A ji r eq jα have to be taken into account, where the uncertainties of the Einstein coefficient is considered to be negligible.  In figures 5, the evolution of the metastable occupations, the emission rates and the line ratios of four lines are shown with their uncertainties for a typical example along the path of the He atom. Here, we used the approximation with three metastables. The electron density and temperature along the path of the He atom are shown in upper left boxes. n e and T e have no uncertainty since we are only interested in the effect of the uncertainty of the atomic data. Below the electron density, the evolution of the occupation of the three metastables are shown. The uncertainty of the ground state occupation is zero at the start, since it starts by definition at 1, and slowly grows as the He atom is ionised. The relative uncertainty at the end of the interval is 14%. The uncertainty is dominated by the uncertainty of the ionisation rate coefficient S 1 of the ground state atoms, where the relative uncertainty of S 1 does not differ very much from the respective value of s 1 and is about 5% (see table 2). Thus, the relative uncertainty of the occupation of 1 s 2 1 S grows to much larger values than 5% the more the atom is ionised away and N α approaches zero. The relative uncertainties of the occupations of the two triplet levels are around 5% for low path lengths and increase up to about 17% at the highest path lengths.
The right column in figure 5 shows the evolution of the two triplet and the two singlet lines used for the diagnostic. The triplet lines radiate at lower temperatures while the singlet radiation extends further into the plasma. The total uncertainties are depicted by the grey regions and the uncertainties due to the metastable populations alone is given by the region between the two black lines. The uncertainties are similar at about 10% but the singlet line at 728 nm has a larger uncertainty in the range of 15%-20%. For the triplet lines, this uncertainty is dominated by the uncertainty of the metastable populations, however, for the singlet lines, this is only the case at the highest path lengths. In the middle column, the line ratios are depicted. The relative uncertainties of the ratios follow directly from the uncertainties of the emissivities of the individual lines via error propagation. For the ratio of the two singlet lines at 668 and 728 nm, the relative uncertainty grows from about 17%-25% and is just due to the uncertainty of the photon emissivity coefficients. For the ratio of the singlet line at 728 nm to the triplet lines at 706/587 nm, the relative uncertainty rises from 19%/18% at l = 1 cm to 21%/26% at 4 cm and then to 31%/40% at 5 cm. These relative uncertainties are dominated by the uncertainties of the metastable populations.

Calculation of the re-absorption rates
The absorption coefficient α on the resonance lines, i.e. the transitions from the ground state to the states 1snp 1 P with n = 2-4, can become rather large close to the valve, where the density of injected helium is large. For the calculation of the absorption coefficient, the Zeeman effect has to be taken into account. It splits the upper states with magnetic quantum numbers m = 0 and ±1 into three energy levels. The spectrum contains an unshifted π-line for the transition to the state with m = 0 and two equally shifted σ ± -lines for the transitions to m = ±1. The relative line strength depends on the angle β between the wave vector and the magnetic field and the polarisation. We choose two independent polarisation directions s and p, where s is perpendicular to the B-field and p perpendicular to s and the wave vector. The relative line strengths are: The normalisation is such that the sum over all line strengths is 1/2 for each polarisation direction. The absorption coefficient for the polarisation direction s and the transition n = 2−1 is.
Here, A 21 = 1.8×10 9 s −1 is the transition probability, λ 21 = 58.44 nm is the central wavelength, g 2 = 3 and g 1 = 1 are the statistical weights, and the wavelength dependence is due to the Doppler broadening with γ = λ 21  When neglecting the ionisation losses, an estimate of the mean absorption length ⟨α⟩ −1 can be obtained by setting n He = n He,0 . Furthermore, we simply assume that the incoming radiance has the same line shape as the absorption coefficient and average over all possible directions of the wave vector. The result is shown in figure 6 for two injection rates as function of the distance to the valve for points on the beam axis. The black lines are for the standard rate ofṄ He = 2 × 10 19 s −1 , while the blue lines for a high rate ofṄ He = 1 × 10 20 s −1 . The 1/r 2 decay of the helium density is shown (right scale) and the absorption length for the most typical magnetic field of B = 2 T. The influence of the Zeeman effect can be seen by comparing with the dashed lines, which are for zero magnetic field. For the outermost measurement points, which are depicted by crosses, the absorption length is in the mmrange and a considerable amount of radiation is re-absorbed.
For our purpose, we are not so much interested in the optical thickness of the resonance lines but in the additional excitation mechanism due to photon absorption which finally might influence the line ratios used for the determination of n e and T e . The first step is to calculate the rate of absorbed photons per atom ν abs on the resonance lines at each point where the sightline intersects the gas cloud and use this rate in a second step to modify the collisional-radiative model. This rate depends on the resonance line emission at all other points in the cloud and on the amount which can reach the selected point without being absorbed. For a point ⃗ x and a direction ⃗ k = cos ϕ k sin θ k ⃗ e x + sin ϕ k sin θ k ⃗ e y + cos θ k ⃗ e z , the spectral radiance is obtained by integrating the spectral emission coefficient times the attenuation due to absorption.
When evaluating this for the polarisation direction s and the transition n = 2 − 1, equation (14) gives the corresponding absorption coefficient while the spectral emission coefficient is.
Here, f 2 denotes the fraction of atoms in the state 1s2p 1 P. The absorption rate per atom is then obtained by integrating the absorbed radiance at ⃗ x over the whole solid angle and all wavelengths and by summation over both polarisation directions.
This becomes a quite complex calculation with five nested integrals. For the evaluation of equation (17), the helium density and the fraction of excited atoms in the 1 P-states needs to be known for the whole cloud. Here, we can use the static model since the 1 P-states are very well coupled to the ground state. The helium density follows from the profile of the ionisation rate coefficient S and equation (11) n He = n He,0 exp −ˆr 0 n e S υ injected dr (18) and the fraction of excited atoms in the 1 P-states is given by the solution of the CRM for a given set of n e T e and ν abs to all 1 P-states. Thus, the calculation of the absorption rates depends on the values of ν abs . This is solved iteratively. In the first iteration, the absorption rates in the CRM are set to zero, while in the following iterations the absorption rates from the previous iteration are used in the CRM. The convergence is not very fast and 15 iterations are needed to obtain the final absorption rates.
The computational effort to obtain ν abs is too expensive to be included in a fit procedure that finds the profiles of n e and T e . Thus, the rates are pre-computed for a set of simplified profiles of n e and T e . Each profile is just defined by two parameters: the value at the separatrix and the decay length of an exponential decay. The rates are then computed and stored for all combinations of the four parameters on a grid of radii r and angles θ. Furthermore, we use a simplified geometry. Here, n e and T e are just functions of the coordinate along the beam axis, the B-field is perpendicular to the beam axis and the lines-ofsight are in the same plane as B. This setting is very close to the real geometry and creates some symmetry which reduces the computational effort. These tables are produced for different values of B andṄ He and interpolated during the fit procedure.

Determining the velocity for the propagation
To determine the helium injection velocity, a thermodynamic ideal expansion into the vacuum is assumed [18]. The overall energy during the process is assumed constant and leads to with the initial and injected enthalpies H initial and H injected , the Helium molar mass m mol and the injected velocity υ injected .
Assuming an adiabatic expansion, this leads according to [19] to The initial temperature at the reservoir T initial is 300 K, the pressure ratio p injected p initial is assumed to be zero and C p is the heat capacity of helium at constant pressure. The injection velocity resulting from this is 1760 m s −1 . In the capillary, the helium propagates with a Mach number of 1. After the injection, the helium cloud further expands, keeping the injection velocity constant but increasing the Mach number. These high Mach numbers correlate with a narrow velocity distribution, allowing the usage of a single velocity for the propagation. To validate this assumption, profiles with different Mach numbers are evaluated in the next subsection. This velocity presents a maximum value, which probably gets in the experiment slightly lowered by friction.

Supersonic velocity distributions
Supersonic velocity distributions for Mach numbers M = 0, 1, 5 and 40 are shown in figure 7 [20]. An effusive beam is obtained for M = 0. Helium line emission profiles, using typical temperature and density profiles depicted in figure 8, are shown in figure 9 for all four Mach numbers. There is nearly no  difference in the emission profiles between M = 5 and M = 40 for all four helium lines used in this work. Since a Mach number between M = 10 and M = 50 is expected in the present experimental setting, the assumption of a single injection velocity corresponding to the maximum of the supersonic distribution is justified. Only for very small Mach numbers close to an effusive beam (M = 0) changes of the emission lines are observed mainly due to the larger contribution of lower velocities. This robustness with respect to the unknown Mach number and with the assumption of a single propagation velocity is even larger for line ratios. Figure 10 shows the three line ratios used in this work for profile estimation for the various Mach numbers. In the region with significant line emission the line ratios are nearly insensitive to the Mach number chosen. Only in the low-intensity wings of the emission profiles the line ratios vary for small Mach numbers. Summarizing, the emission profiles as well as the line ratios for the Mach number of the present experiment can reliably be calculated from the injection velocity of the maximum of the supersonic distribution.

The forward model
The forward model is integrated in the IDA Framework [21]. The model takes arrays of temperature and density over the poloidal flux label ρ pol as an input. This coordinate is then mapped via the CLISTE magnetic equilibrium [22,23] on the helium cloud. On special request or in the case of high uncertainties by the CLISTE equilibrium, a kinetic IDE equilibrium [24,25] is used. The radiance on each LOS of the experimental setup is obtained by a numerical integration of the specific optical emission coefficient (equation (10)) along the LOS. The numerical integration of´ϵ j→k dℓ along the LOS can be performed with sufficient accuracy by just using three points on the LOS. The best choice of abscissas and weights for the corresponding Gaussian quadrature rule were estimated from the moments µ n of the non-attenuated density along the LOS, i.e. µ n =´n He,0 ℓ n dℓ, using the code QUADMOM [26]. The mean relative deviation between the Gaussian quadrature and a trapezoidal rule with 500 intervals is in the range of 2%, while for the ratios of two radiances, it is only 0.5%. Thus, for each LOS, the evolution of the metastables has to be computed for three paths from the valve to the relevant points on the LOS using equation (7) in a time centred approach.

Measured data
The measured data consist of the intensities of four emission lines for each of the 27 LOSs. Various options exist for fitting these data with the intensities obtained from the forward model. The first option is to generate three line ratios (using two line ratios only are not considered in this work): The ratio of two singlet transitions I 667nm /I 728nm is most sensitive to the density n e . The ratios of a singlet and triplet transitions, I 728nm /I 587nm and I 728nm /I 706nm , are most sensitive to the temperature T e . Figure 11 shows for #36299 at t = 3.245 s the measured line rations (dots) (e) I 667nm /I 728nm , (f) I 728nm /I 706nm and (g) I 728nm /I 587nm . The dots in figures 11(a)-(e) shows the corresponding measured line intensities from which the line ratios are calculated. Frequently only two ratios are used to estimate the two parameters n e and T e [4]. Since the present data allow for three line ratios we have an over-determined data analysis problem with noisy data which frequently is solved with a least-squares approach.
If the signal-to-noise level of the line-ratio data would be very high and if the collisional-radiative model including all atomic data would be accurate, then fitting two or three line ratios would be sufficient for a unique solution. Since the data are noisy and since the model is not expected to be perfect, fitting three line ratios is not sufficient to describe the population densities of the excited states correctly. This can easily be seen at the region where the beam enters the plasma with a small density. Figure 12 shows T e and n e profiles estimated from the data in figure 11 fitted with various settings of the four line intensities and three line ratios. For ρ pol ≳ 1.05, T e and n e is too small for a significant population of the radiating levels. Therefore, the signal-to-noise level of the line-ratios are poor. Although the fits to the data is reasonable, the match with the (not fitted) line intensities is rather poor. The lines in figure 11 alias 'FFFF TTT' shows the fits to the data where the line intensities are not used (FFFF in ascending wavelength order figures 11(a)-(d)) and where the three line ratios are fitted (TTT in the order figures 11(e)-(g), the first block references the used line intensities, the second the line ratios, with either T(rue) or F(alse)). Using the 'FFFF TTT' setting the density and temperature is overestimated as seen in the overestimation of the line intensities for ρ pol > 1.04. Therefore, the three line ratios were augmented with the emission of one extra line intensity. The fitting procedure allows for an arbitrary choice of setting a vector of the seven data sets with logical values for enabling a sensitivity analysis. 'TFFF TTT' to 'FFFT TTT' shows the augmentation of the three line ratios with one additional line intensity going from 587 to 728 nm. 'TTTT TTT' depicts the fit using all line intensities and line ratios. An augmentation of the three line ratios with any of the four line intensities improves the fit to the data significantly.
There is some variability in the T e and n e profiles using different line intensities because the region closest to the plasma, typically at ρ pol ≲ 1.0, shows different decay behaviour for triplet and singlet lines which cannot be fitted simultaneous as shown in figure 13 for the triplet line at 587 nm and the singlet line at 667 nm. Here only the 587 nm line is fitted together with all three line ratios. For fitting the other line or both lines simultaneously it is also not possible to find T e and n e profiles where both intensity profiles can be fitted properly. Although an extension of the intensities of the singlet lines (667 and 728 nm) deeper into the plasma as compared to the triplet lines is expected from the modelling, the measured extension exceeds the modelling prediction. Therefore, the 'TFFF TTT' and the 'FTFF TTT' fits are significantly apart. A sensitivity analysis with various velocity distributions could not resolve this observation (see section 3.5). Only an unfounded increase of the mean (upper limit) velocity by a factor of 1.4 reduces this discrepancy but is not expected to be the correct interpretation.
Thorough inspection of the background estimation routine could also not resolve this observation. The background light is estimated from the beam-off phases of the pulsed helium beam [3] and then subtracted from the data. Since a decay of the helium content is observed after switching the beam off, the background is estimated in the beam-off phase where the intensity saturates. Nevertheless, the discrepancy in the singlet  and triplet fall-off is beyond the uncertainty of the background estimation.
Another source of uncertainty is given by the uncertainties in the mixing rates between the singlet and triplet states. The propagation of these uncertainties to the uncertainties in the modelled line intensities and ratios is performed by randomly drawing mixing rates from a multivariate normal distribution with mean values given by the data base, and relative uncertainties for the mixing rates of the six transitions (3.1% for 1 s 2 1 S → 1s2s 3 S, 7.0% for 1 s 2 1 S → 1s2p 3 P, 11% for 1s2s 3 S → 1 s 2 1 S, 3.3% for 1s2s 3 S → 1s2p 3 P, 26% for 1s2p 3 P → 1 s 2 1 S, 0.2% for 1s2p 3 P → 1s2s 3 S). The major source of uncertainty for the uncertainty of the intensity profiles is the 7.0% for 1 s 2 1 S → 1s2p 3 P followed by 3.1% for 1 s 2 1 S → 1s2s 3 S. The uncertainty of the other mixing transitions are less important. Figure 14 shows normalized line intensity profiles for the four transitions with error bars evaluated from the standard distribution of the intensity profiles evaluated with the randomly drawn mixing rates. The uncertainty of the profiles from the two singlet states, 667 and 728 nm, are very small as expected due to the main excitation channel from the ground state. In contrast, the two triplet-state transitions, 587 and 706 nm, depend much more on the mixing rates. Nevertheless, the uncertainties due to the mixing rates are far too small to be able to explain the discrepancy between the singlet and triplet fall-off behaviour. Figure 15 shows the normalized intensity ratio profiles. Again the ratio of the two singlet-state intensities, 667 nm/728 nm, is insensitive to the mixing rate uncertainties, whereas the uncertainties of the ratios between singlet and triplet states are somewhat larger. Again, the uncertainties of the modelled data are significantly smaller than the uncertainties of the measured data. This allows one to neglect the uncertainties of mixing rates.
Since the discrepancy in the fall-off of the singlet and triplet states could not be resolved, the various settings for the line intensities being fitted helps to estimate the systematic uncertainty by the modelling deficits. Figure 12 shows for the 'TFFF TTT' setting additionally the statistical uncertainties of the T e and n e profiles. This uncertainty is in about the same order as the differences of the profiles for the various fitting settings.
As a result, the 'TFFF TTT' configuration (intensity shape of 587 nm line and the ratio of I 667nm /I 728nm , I 728nm /I 706nm and I 728nm /I 587nm ) was selected for routine analysis. The absolute calibration, however, does only match with a scaling factor (between 1 and 2) to the model predictions. One possible reason for this could be a coating of the in-vessel components and a degradation of the optical fibres during the campaign. This is supported by calibrations before and after each campaign, which, however, show that the line ratios are mainly unaffected by changes in the absolute transmission. The calibration is performed with a stationary light source measuring at 1 million time points. Therefore, statistical uncertainties are very small.
The estimation of the T e and n e profiles is embedded in the IDA fitting approach using multiple diagnostics [21]. For the data presented here all diagnostics providing data at the plasma edge region are switched off such that the shown edge temperature and densities are purely determined by the THB diagnostic. Switched off are the lithium beam diagnostic [27], all channels of the edge Thomson scattering system, the outermost channels of the core Thomson scattering system, the outermost channels of the ECE diagnostic and the outermost interferometry channel 'H-5' [28]. Only the core ECE channels, most of the core Thomson scattering channels, as well as the 4 interferometry channels 'H-0', 'H-1', 'H-2' and 'H-4' are used, which do not to disturb the interpretation of the THB diagnostic but do provide a smooth transition into the core profiles.

Uncertainty of measured data
The uncertainties (one standard deviation) of the four line intensities and the derived three line ratios are determined separately. Since the data are sampled with a frequency of 900 kHz, they are binned into data subsets. A typical estimation of a pair of T e and n e profiles includes all measured line intensities within a time interval of 1 ms binned into five subintervals of 0.2 ms each. If the plasma is stationary within this 1 ms, all binned line intensities coincide within their scatter. The detection of a non-stationary plasma edge, e.g. given by an ELM is easily detected by significant differences in the binned intensity profiles. For studies of filamentary structures at the plasma edge, typically occurring with higher frequencies, the time interval can be reduced to a limit of about 5 µs and the number of time intervals for binning can be adapted appropriately.
The binned line ratios can be evaluated in two ways, either by binning the ratios of the measured line intensities or by evaluating the ratio of the binned line intensities. Binning the ratios of the measured line intensities is less robust due to intensities close to zero in the denominator. Therefore, only ratios of binned line intensities are considered in the following.
The uncertainties of the binned line intensities are evaluated from their variance within the sub-intervals and a base uncertainty value of 10% of the binned line intensity is added quadratically. The variance within the sub-intervals includes statistical scatter of the data as well as physical scatter due to filaments not resolved in a coarse binning grid. The base uncertainty represents calibration uncertainties which might occur by multiple re-connections of glass fibres. The uncertainties of the binned line ratios are evaluated by applying Gaussian error propagation using the uncertainties of the binned line intensities. Additionally, a lower limit for the uncertainties for the line intensities of 5% of the maximum of the binned line intensity profile is applied to take account of potential modelling uncertainties in the outer plasma region with small intensities due to small densities and in the plasma region where the THB is nearly ionized. This lower limit of 5% is not applied to the uncertainty of the binned line ratios as the ratio is observed to be more robust to modelling uncertainties with the exception of the discrepancy in the singlet-triplet fall-off behaviour.
The frequently used Gaussian likelihood, corresponding to the familiar least-squares fitting approach, is useful if the data uncertainties follow Gaussian statistics. In case of outlier data not described properly by the model, data failures not detected and eliminated, or mis-specified uncertainties, the Student's tdistribution (Cauchy distribution as special case) provides an outlier robust estimation technique. Additionally, the Student's t-distribution allows one to define a parameter determining the weight of the heavy tails, and, therefore, the influence of any outlying data.

Comparison of static and dynamic CRMs
In this section we show SOL profiles measured with the THB diagnostics in typical H-mode scenarios. The evaluation results with different CRMs are compare to the Li-beam diagnostic. The discharge selected is #36548 in the time interval from 3.0 to 4.0 s, where the separatrix lies inside the inner most LOS of the THB diagnostic. Diagnostic helium gets injected with a rate of 3.11 × 10 19 s −1 (50% duty cycle), while the plasma is heated with 2.5 MW ECRH and 4.9 MW NBI power. The edge density (see the H-5 line in [28]) is 2.7 × 10 19 m −3 , the toroidal magnetic field has −1.8 T and the plasma current is 800 kA.
In plot 16, SOL temperature and density profiles are shown. Temperatures from the new forward model and the static model are compared in the upper plot. On the one hand, the static model shows the previously mentioned temperature rise in the far-SOL, from ρ pol = 1.09 outwards. With an increasing electron density towards the core, the collision rates increase and the CRE is achieved, fulfilling the assumptions of the static model and resulting in correct temperatures. In this region, the profiles of both models deliver similar results. In the forward model, on the other hand, the re-absorption and dynamic state mixing lead in the evaluation to radially decaying temperature profiles, even in the far-SOL.
The density profiles from both models, as well as the lithium beam diagnostic [27], are displayed in the lower plot of figure 16. The profiles of the two models match over large parts. Only at the outermost points the density from the static model is clearly above the one from the new model, which is caused by the wrong temperature with this model. The comparison with the lithium beam shows an agreement with the new model for the outer points. For the points further inside, the values of the lithium beam agree within the uncertainty range with both models, but showing a slight tendency towards higher densities.
As a result, the new model gets rid of the artificial temperature rise, which was the main motivation for implementing the new effects in the model. The density profiles are only marginally influenced, caused by the simultaneous evaluation of n e and T e in the CRM. The effect of re-absorption and its influence to edge profiles is further discussed in the next section.

Rating of the influence of re-absorption effects
After comparing the full dynamic model with re-absorption to the pure static model, the influence of the re-absorption is individually addressed in this section. Therefore, the ASDEX Upgrade discharge #36299 is chosen, with a diagnostic helium injection rate of 5 × 10 19 s −1 (50% duty cycle), which is slightly above the typical injection rates from 1 × 10 19 to The result is displayed in figure 17, with the resulting temperature and density in the subplots 17(a) and (b) and the fitted line ratios and intensities in subplots 17(c)-(f). The influence of the re-absorption on the density is extremely small and only provides a visible difference in the profiles at the outermost three measurement points, which is within the error bars. In the case of the temperature, a wide radial region is affected by re-absorption. In the far SOL, the temperature evaluated with re-absorption effects is higher than in the case without, while the effect is reversed in the area around ρ pol = 1.02.
A look at the fitted data describes the validity of the model with re-absorption. In figures 17(c) and (e), the model without re-absorption is not capable of reproducing the measured line ratios in a broad radial region in the far-SOL, where only the model with the re-absorption leads to reasonable results. In addition to the line ratios, the intensity curve of the 587 nm line is fitted, as displayed in figure 17(f). Here, the model without re-absorption reproduces the profile in certain regions better. However, the increase of intensity on the outermost points corresponds more to the model with re-absorption. The difference could not be solved, but more emphasis is put on the correct fitting of the line ratios than the intensity, since the intensity curve depends on many parameters, including the neutral helium density distribution, the injection rate and velocity, the transmissions and the position of the lines of sight. As described previously, all measured intensities are multiplied by a fitting factor of ∼1-2 to describe the model radiance.
For an identical discharge performed, #36300, the diagnostic helium injection rate is set to 1 × 10 19 s −1 (also 50% duty cycle). Analogous to figure 17, the same values for discharge #36300 are shown in figure 18. Small differences in the fitted line ratios can still be observed from ρ pol = 1.08 outwards. But both models are now within the uncertainty of the experimental data. The temperature and density are marginally affected, so that the differences in temperature and density are for this low injection rate within errors. This fulfills the expected behaviour. With smaller injection rates, the emission of the resonances and the re-absorption reduces as well. This leads to a convergence of the results between models without and with re-absorption for very low injection rates. A general behaviour is observed that fit difference by re-absorption increases with the injection rate, as the region influenced by it. The model without re-absorption is not capable of compensating the reabsorption for high injection rates, generally worsening the fit quality.

Summary and conclusion
A new CRM for the evaluation of the ASDEX Upgrade THB diagnostic is derived. In the model, the dynamic state mixing and the re-absorption are included. The dynamics of the model is calculated using GCR coefficients for a reduced system with just three metastable states, which reproduces the behaviour of the full model with sufficient precision, and is evaluated much faster than the full CRM. This approach, which is called in the ADAS framework the resolved picture, is a general method to include the influence of the transport of an atom or ion in the plasma on the balance of the excited states of that ionisation stage. The corresponding GCR coefficients are available in the ADAS database for a number of light elements and can be used for code simulation work. However, in contrast to our approach, the standard metastable set of an ion just uses one state per spin system. In previous helium beam evaluations, the singlet-triplet mixing has proven to be crucial for the temperature calculation. This effect was included in the new model together with the re-absorption, which results from the emission of UV lines in the local helium cloud. The CRM was tested for different combinations of fitted values, velocity distributions as well as uncertainties arising from the atomic data, to estimate its uncertainties. This full CRM is benchmarked and compared to the static ADAS model and the lithium beam diagnostic for density profiles. Resulting from the combination of two effects, the artificial temperature rise from the static model was corrected, while the density was mainly unaffected. To check the general concept of re-absorption, the evaluation with and without re-absorption were compared for discharges with different Hepuffing strength. The comparison shows that the re-absorption effect increases the fit quality significantly for higher puffing strength (Ṅ > 5 × 10 19 s −1 ). For He-puffing with lower rates, re-absorption plays a minor effect, so that the solution of both models converges.

Data availability statement
The data that support the findings of this study are available upon reasonable request from the authors.