ionTrails¶

class ChiantiPy.base.ionTrails[source] [edit on github]

Bases: object

Base class for ChiantiPy.core.ion and ChiantiPy.core.spectrum

Methods Summary

 intensityList([index, wvlRange, wvlRanges, …]) List the line intensities. intensityPlot([index, wvlRange, top, …]) Plot the line intensities. intensityRatio([wvlRange, wvlRanges, top]) Plot the intensity ratio of 2 lines or sums of lines. intensityRatioSave([outFile]) Save the intensity ratio to a file.

Methods Documentation

intensityList(index=-1, wvlRange=None, wvlRanges=None, top=10, relative=0, outFile=0)[source] [edit on github]

List the line intensities. Checks to see if there is an existing Intensity attribute. If it exists, then those values are used. Otherwise, the intensity method is called.

This method prints an ASCII table with the following columns:

1. Ion: the CHIANTI style notation for the ion, e.g. ‘c_4’ for C IV
2. lvl1: the lower level of the transition in the CHIANTI .elvlc file
3. lvl2: the upper level of the transition in the CHIANTI .elvlc file
4. lower: the notation, usually in LS coupling, of the lower fine structure level
5. upper: the notation, usually in LS coupling, of the upper fine structure level
6. Wvl(A): the wavelength of the transition in units as specified in the chiantirc file.
7. Intensity
8. A value: the Einstein coefficient for spontaneous emission from level ‘j’ to level ‘i’
9. Obs: indicates whether the CHIANTI database considers this an observed line or one obtained from theoretical energy levels

Regarding the intensity column, if ‘flux’ in the chiantirc file is set to ‘energy’, the intensity is given by,

$I = \Delta E_{ij}n_jA_{ij}\mathrm{Ab}\frac{1}{N_e} \frac{N(X^{+m})}{N(X)}\mathrm{EM},$

in units of ergs cm-2 s-1 sr-1. If ‘flux’ is set to ‘photon’,

$I = n_jA_{ij}\mathrm{Ab}\frac{1}{N_e}\frac{N(X^{+m})}{N(X)} \mathrm{EM},$

where,

• $$\Delta E_{ij}$$ is the transition energy (ergs)
• $$n_j$$ is the fractions of ions in level $$j$$
• $$A_{ij}$$ is the Einstein coefficient for spontaneous emission from level $$j$$ to level $$i$$ (in s-1)
• $$\mathrm{Ab}$$ is the abundance of the specified element relative to hydrogen
• $$N_e$$ is the electron density (in cm-3)
• $$N(X^{+m})/N(X)$$ is the fractional ionization of ion as a function of temperature
• $$\mathrm{EM}$$ is the emission measure integrated along the line-of-sight, $$\int\mathrm{d}l\,N_eN_H$$ (cm-5) where $$N_H$$ is the density of hydrogen (neutral + ionized) (cm-3)

Note that if relative is set, the line intensity is relative to the strongest line and so the output will be unitless.

Parameters: index : int,optional Index the temperature or eDensity array to use. -1 (default) sets the specified value to the middle of the array wvlRange : tuple Wavelength range wvlRanges : a tuple, list or array that contains at least 2 2 element tuples, lists or arrays so that multiple wavelength ranges can be specified top : int Number of lines to plot, sorted by descending magnitude. relative : int specifies whether to normalize to strongest line default (relative = 0) specified that the intensities should be their calculated values outFile : str specifies the file that the intensities should be output to default(outFile = 0) intensities are output to the terminal
intensityPlot(index=-1, wvlRange=None, top=10, linLog='lin', relative=False, verbose=False, plotFile=0, em=0)[source] [edit on github]

Plot the line intensities. Uses Intensity if it already exists. If not, call the intensity method.

Parameters: index: integer specified which value of the temperature array or eDensity array to use. default (index=-1) sets the specified value to the middle of the array wvlRange: 2 element tuple, list or array determines the wavelength range top: integer specifies to plot only the top strongest lines, default = 10 linLog: str default(‘lin’) produces a plot where the intensity scale is linear if set to ‘log’, produces a plot where the intensity scale is logarithmic normalize: = 1 specifies whether to normalize to strongest line default (relative = 0) specified that the intensities should be their calculated values plotFile: default=0, the plot is not saved to a file othewise, the plot is saved to the ‘plotFile’ em: emission measure if an Intensity attribute needs be created, then the emission measure is applied
intensityRatio(wvlRange=None, wvlRanges=None, top=10)[source] [edit on github]

Plot the intensity ratio of 2 lines or sums of lines. Shown as a function of density and/or temperature. For a single wavelength range, set wvlRange = [wMin, wMax] For multiple wavelength ranges, set wvlRanges = [[wMin1,wMax1],[wMin2,wMax2], …] A plot of relative emissivities is shown and then a dialog appears for the user to choose a set of lines.

Parameters: wvlRange : array-like Wavelength range, i.e. min and max wvlRanges: a tuple, list or array that contains at least 2 2 element tuples, lists or arrays so that multiple wavelength ranges can be specified top : int specifies to plot only the top strongest lines, default = 10
intensityRatioSave(outFile=0)[source] [edit on github]

Save the intensity ratio to a file.

The intensity ratio as a function to temperature and eDensity is saved to an asciii file. Descriptive information is included at the top of the file.