There are a variety of inversion codes in solar physics. An important category is the radiative transfer inversions. These codes take the observed spectra as input, compare it with the synthesized spectra of an initial model atmosphere, modify the model, and iterate it until convergence. There are many inversion codes with different level of sophistication, e.g., LTE vs NLTE, one dimensional versus two dimensional, etc. Mathematically, inversion is an ill-posed problem and has issues like uniqueness. Nonetheless, inverting multiple spectral lines at the same time provide enough constrain for the code to remove the degeneracy. That is the reason why multi-wavelength observations are so important.
In the simplest case, one employs a Mile-Eddington model which allows for an analytical solution to the radiative transfer equation. A more realistic approach is using the LTE assumption to populate states based on the Boltzmann factor. It also allows us to calculate the absorption and emission coefficients as a function of the temperature stratification. LTE is a good assumption in the solar photosphere.
Upper layers of the solar atmosphere have a number density several orders of magnitude lower than the photosphere. As a result, number of collisions decreases substantially and the LTE assumption breaks. A non-LTE calculation is far more complicated as one has to solve the statistical equilibrium equations for each spices separately. It can diverge even in the forward direction. Beside that, horizontal radiative exchanges can be important in the upper atmosphere where photons arrive from large distances. Three-dimensional NLTE codes are under development are require a computing power beyond laptops.
This page will be completed gradually.