ChiantiPy.core package¶
Subpackages¶
Submodules¶
ChiantiPy.core.Continuum module¶
Continuum module
-
class
ChiantiPy.core.Continuum.
continuum
(ionStr, temperature, abundance=None, em=None, verbose=0)¶ Bases:
ChiantiPy.base._IonTrails.ionTrails
The top level class for continuum calculations. Includes methods for the calculation of the free-free and free-bound continua.
Parameters: - ionStr (str) – CHIANTI notation for the given ion, e.g. ‘fe_12’ that corresponds to the Fe XII ion.
- temperature (array-like) – In units of Kelvin
- abundance (float or str, optional) – Elemental abundance relative to Hydrogen or name of CHIANTI abundance file, without the ‘.abund’ suffix, e.g. ‘sun_photospheric_1998_grevesse’.
- em (array-like, optional) – Line-of-sight emission measure (\(\int\mathrm{d}l\,n_en_H\)), in units of \(\mathrm{cm}^{-5}\), or the volumetric emission measure (\(\int\mathrm{d}V\,n_en_H\)) in units of \(\mathrm{cm}^{-3}\).
Examples
>>> import ChiantiPy.core as ch >>> import numpy as np >>> temperature = np.logspace(4,9,20) >>> cont = ch.continuum('fe_15',temperature) >>> wavelength = np.arange(1,1000,10) >>> cont.freeFree(wavelength) >>> cont.freeBound(wavelength, include_abundance=True, include_ioneq=False) >>> cont.calculate_free_free_loss() >>> cont.calculate_free_bound_loss()
Notes
The methods for calculating the free-free and free-bound emission and losses return their result to an attribute. See the respective docstrings for more information.
-
calculate_free_bound_loss
(**kwargs)¶ Calculate the free-bound energy loss rate of an ion. The result is returned to the free_bound_loss attribute.
The free-bound loss rate can be calculated by integrating the free-bound emission over the wavelength. This is difficult using the expression in calculate_free_bound_emission so we instead use the approach of [1]_ and [2]_. Eq. 1a of [2]_ can be integrated over wavelength to get the free-bound loss rate,
\[\frac{dW}{dtdV} = C_{ff}\frac{k}{hc}T^{1/2}G_{fb},\]in units of erg \(\mathrm{cm}^3\,\mathrm{s}^{-1}\) where \(G_{fb}\) is the free-bound Gaunt factor as given by Eq. 15 of [2]_ (see mewe_gaunt_factor for more details) and \(C_{ff}\) is the numerical constant as given in Eq. 4 of [1]_ and can be written in terms of the fine structure constant \(\alpha\),
\[C_{ff}\frac{k}{hc} = \frac{8}{3}\left(\frac{\pi}{6}\right)^{1/2}\frac{h^2\alpha^3}{\pi^2}\frac{k_B}{m_e^{3/2}} \approx 1.43\times10^{-27}\]References
[1] Gronenschild, E.H.B.M. and Mewe, R., 1978, A&AS, 32, 283 [2] Mewe, R. et al., 1986, A&AS, 65, 511
-
freeBound
(wvl, verner=1)¶ to calculate the free-bound (radiative recombination) continuum rate coefficient of an ion, where the ion is taken to be the target ion, including the elemental abundance and the ionization equilibrium population uses the Gaunt factors of Karzas, W.J, Latter, R, 1961, ApJS, 6, 167 for recombination to the ground level, the photoionization cross sections of Verner and Yakovlev, 1995, A&ASS, 109, 125 are used to develop the free-bound cross section includes the elemental abundance and the ionization fraction provides emissivity = ergs cm^-2 s^-1 str^-1 Angstrom ^-1
-
freeBoundEmiss
(wvl, verner=1)¶ Calculates the free-bound (radiative recombination) continuum emissivity of an ion. Provides emissivity in units of ergs \(\mathrm{cm}^{-2}\) \(\mathrm{s}^{-1}\) \(\mathrm{str}^{-1}\) \(\mathrm{\AA}^{-1}\) for an individual ion.
Notes
- Uses the Gaunt factors of [1]_ for recombination to the ground level
- Uses the photoionization cross sections of [2]_ to develop the free-bound cross section
- Does not include the elemental abundance or ionization fraction
- The specified ion is the target ion
References
[1] Karzas and Latter, 1961, ApJSS, 6, 167 [2] Verner & Yakovlev, 1995, A&AS, 109, 125
-
freeBoundLoss
()¶ to calculate the free-bound (radiative recombination) energy loss rate coefficient of an ion, the ion is taken to be the target ion, including the elemental abundance and the ionization equilibrium population uses the Gaunt factors of Karzas, W.J, Latter, R, 1961, ApJS, 6, 167 provides rate = ergs cm^-2 s^-1
-
freeBoundLossMewe
(**kwargs)¶ Calculate the free-bound energy loss rate of an ion. The result is returned to the free_bound_loss attribute.
The free-bound loss rate can be calculated by integrating the free-bound emission over the wavelength. This is difficult using the expression in calculate_free_bound_emission so we instead use the approach of [1]_ and [2]_. Eq. 1a of [2]_ can be integrated over wavelength to get the free-bound loss rate,
\[\frac{dW}{dtdV} = C_{ff}\frac{k}{hc}T^{1/2}G_{fb},\]in units of erg \(\mathrm{cm}^3\,\mathrm{s}^{-1}\) where \(G_{fb}\) is the free-bound Gaunt factor as given by Eq. 15 of [2]_ (see mewe_gaunt_factor for more details) and \(C_{ff}\) is the numerical constant as given in Eq. 4 of [1]_ and can be written in terms of the fine structure constant \(\alpha\),
\[C_{ff}\frac{k}{hc} = \frac{8}{3}\left(\frac{\pi}{6}\right)^{1/2}\frac{h^2\alpha^3}{\pi^2}\frac{k_B}{m_e^{3/2}} \approx 1.43\times10^{-27}\]References
[1] Gronenschild, E.H.B.M. and Mewe, R., 1978, A&AS, 32, 283 [2] Mewe, R. et al., 1986, A&AS, 65, 511
-
freeBoundwB
(wavelength, includeAbundance=True, includeIoneq=True, useVerner=True, **kwargs)¶ Calculate the free-bound emission of an ion. The result is returned as a 2D array to the free_bound_emission attribute.
The total free-bound continuum emissivity is given by,
\[\frac{dW}{dtdVd\lambda} = \frac{1}{4\pi}\frac{2}{hk_Bc^3m_e\sqrt{2\pi k_Bm_e}}\frac{E^5}{T^{3/2}}\sum_i\frac{\omega_i}{\omega_0}\sigma_i^{bf}\exp\left(-\frac{E - I_i}{k_BT}\right)\]where \(E=hc/\lambda\) is the photon energy, \(\omega_i\) and \(\omega_0\) are the statistical weights of the \(i^{\mathrm{th}}\) level of the recombined ion and the ground level of the recombing ion, respectively, \(\sigma_i^{bf}\) is the photoionization cross-section, and \(I_i\) is the ionization potential of level \(i\). This expression comes from Eq. 12 of [3]_. For more information about the free-bound continuum calculation, see Peter Young’s notes on free-bound continuum.
The photoionization cross-sections are calculated using the methods of [2]_ for the transitions to the ground state and [1]_ for all other transitions. See verner_cross_section and karzas_cross_section for more details.
The free-bound emission is in units of erg \(\mathrm{cm}^3\mathrm{s}^{-1}\mathrm{\mathring{A}}^{-1}\mathrm{str}^{-1}\). If the emission measure has been set, the units will be multiplied by \(\mathrm{cm}^{-5}\) or \(\mathrm{cm}^{-3}\), depending on whether it is the line-of-sight or volumetric emission measure, respectively.
Parameters: - wavelength (array-like) – In units of angstroms
- include_abundance (bool, optional) – If True, include the ion abundance in the final output.
- include_ioneq (bool, optional) – If True, include the ionization equilibrium in the final output
- use_verner (bool, optional) – If True, cross-sections of ground-state transitions using [2]_, i.e. verner_cross_section
Raises: ValueError
– If no .fblvl file is available for this ionReferences
[1] Karzas and Latter, 1961, ApJSS, 6, 167 [2] Verner & Yakovlev, 1995, A&AS, 109, 125 [3] Young et al., 2003, ApJSS, 144, 135
-
freeFree
(wavelength, include_abundance=True, include_ioneq=True, **kwargs)¶ Calculates the free-free emission for a single ion. The result is returned as a dict to the FreeFree attribute. The dict has the keywords intensity, wvl, temperature, em.
The free-free emission for the given ion is calculated according Eq. 5.14a of [1]_, substituting \(\nu=c/\lambda\), dividing by the solid angle, and writing the numerical constant in terms of the fine structure constant \(\alpha\),
\[\frac{dW}{dtdVd\lambda} = \frac{c}{3m_e}\left(\frac{\alpha h}{\pi}\right)^3\left(\frac{2\pi}{3m_ek_B}\right)^{1/2}\frac{Z^2}{\lambda^2T^{1/2}}\exp{\left(-\frac{hc}{\lambda k_BT}\right)}\bar{g}_{ff},\]where \(Z\) is the nuclear charge, \(T\) is the electron temperature in K, and \(\bar{g}_{ff}\) is the velocity-averaged Gaunt factor. The Gaunt factor is estimated using the methods of [2]_ and [3]_, depending on the temperature and energy regime. See itoh_gaunt_factor and sutherland_gaunt_factor for more details.
The free-free emission is in units of erg \(\mathrm{cm}^3\mathrm{s}^{-1}\mathrm{\mathring{A}}^{-1}\mathrm{str}^{-1}\). If the emission measure has been set, the units will be multiplied by \(\mathrm{cm}^{-5}\) or \(\mathrm{cm}^{-3}\), depending on whether it is the line-of-sight or volumetric emission measure, respectively.
Parameters: - wavelength (array-like) – In units of angstroms
- include_abundance (bool, optional) – If True, include the ion abundance in the final output.
- include_ioneq (bool, optional) – If True, include the ionization equilibrium in the final output
References
[1] Rybicki and Lightman, 1979, Radiative Processes in Astrophysics, (Wiley-VCH) [2] Itoh, N. et al., 2000, ApJS, 128, 125 [3] Sutherland, R. S., 1998, MNRAS, 300, 321
-
freeFreeLoss
(**kwargs)¶ Calculate the free-free energy loss rate of an ion. The result is returned to the FreeFreeLoss attribute.
The free-free radiative loss rate is given by Eq. 5.15a of [1]_. Writing the numerical constant in terms of the fine structure constant \(\alpha\),
\[\frac{dW}{dtdV} = \frac{4\alpha^3h^2}{3\pi^2m_e}\left(\frac{2\pi k_B}{3m_e}\right)^{1/2}Z^2T^{1/2}\bar{g}_B\]where where \(Z\) is the nuclear charge, \(T\) is the electron temperature, and \(\bar{g}_{B}\) is the wavelength-averaged and velocity-averaged Gaunt factor. The Gaunt factor is calculated using the methods of [2]_. Note that this expression for the loss rate is just the integral over wavelength of Eq. 5.14a of [1]_, the free-free emission, and is expressed in units of erg \(\mathrm{cm}^3\,\mathrm{s}^{-1}\).
References
[1] Rybicki and Lightman, 1979, Radiative Processes in Astrophysics, (Wiley-VCH) [2] Karzas and Latter, 1961, ApJSS, 6, 167
-
free_free_loss
(**kwargs)¶ Calculate the free-free energy loss rate of an ion. The result is returned to the free_free_loss attribute.
The free-free radiative loss rate is given by Eq. 5.15a of [1]_. Writing the numerical constant in terms of the fine structure constant \(\alpha\),
\[\frac{dW}{dtdV} = \frac{4\alpha^3h^2}{3\pi^2m_e}\left(\frac{2\pi k_B}{3m_e}\right)^{1/2}Z^2T^{1/2}\bar{g}_B\]where where \(Z\) is the nuclear charge, \(T\) is the electron temperature, and \(\bar{g}_{B}\) is the wavelength-averaged and velocity-averaged Gaunt factor. The Gaunt factor is calculated using the methods of [2]_. Note that this expression for the loss rate is just the integral over wavelength of Eq. 5.14a of [1]_, the free-free emission, and is expressed in units of erg \(\mathrm{cm}^3\,\mathrm{s}^{-1}\).
References
[1] Rybicki and Lightman, 1979, Radiative Processes in Astrophysics, (Wiley-VCH) [2] Karzas and Latter, 1961, ApJSS, 6, 167
-
ioneqOne
()¶ Provide the ionization equilibrium for the selected ion as a function of temperature. Similar to but not identical to ion.ioneqOne() - the ion class needs to be able to handle the ‘dielectronic’ ions returned in self.IoneqOne
-
ioneq_one
(stage, **kwargs)¶ Calculate the equilibrium fractional ionization of the ion as a function of temperature.
Uses the ChiantiPy.core.ioneq module and does a first-order spline interpolation to the data. An ionization equilibrium file can be passed as a keyword argument, ioneqfile. This can be passed through as a keyword argument to any of the functions that uses the ionization equilibrium.
Parameters: stage (int) – Ionization stage, e.g. 25 for Fe XXV
-
itoh_gaunt_factor
(wavelength)¶ Calculates the free-free gaunt factors of [1]_.
An analytic fitting formulae for the relativistic Gaunt factor is given by Eq. 4 of [1]_,
\[g_{Z} = \sum^{10}_{i,j=0}a_{ij}t^iU^j\]where,
\[t = \frac{1}{1.25}(\log_{10}{T} - 7.25),\ U = \frac{1}{2.5}(\log_{10}{u} + 1.5),\]\(u=hc/\lambda k_BT\), and \(a_{ij}\) are the fitting coefficients and are read in using ChiantiPy.tools.io.itohRead and are given in Table 4 of [1]_. These values are valid for \(6<\log_{10}(T)< 8.5\) and \(-4<\log_{10}(u)<1\).
See also
ChiantiPy.tools.io.itohRead()
- Read in Gaunt factor coefficients from [1]_
References
[1] Itoh, N. et al., 2000, ApJS, 128, 125
-
karzasCross
(photon_energy, ionization_potential, n, l)¶ Calculate the photoionization cross-sections using the Gaunt factors of [1]_.
The free-bound photoionization cross-section is given by,
\[\sigma_i^{bf} = 1.077294\times8065.54\times10^{16}\left(\frac{I_i}{hc}\right)^2\left(\frac{hc}{E}\right)^3\frac{g_{bf}}{n_i},\]where \(I_i\) is the ionization potential of the \(i^{\mathrm{th}}\) level, \(E\) is the photon energy, \(g_{bf}\) is the Gaunt factor calculated according to [1]_, and \(n_i\) is the principal quantum number of the \(i^{\mathrm{th}}\) level. \(\sigma_i^{bf}\) is units of \(\mathrm{cm}^{2}\). This expression is given by Eq. 13 of [2]_. For more information on the photoionization cross-sections, see Peter Young’s notes on free-bound continuum.
Parameters: - photon_energy (array-like)
- ionization_potential (float)
- n (int)
- l (int)
References
[1] Karzas and Latter, 1961, ApJSS, 6, 167 [2] Young et al., 2003, ApJSS, 144, 135
-
klgfbInterp
(wvl, n, l)¶ A Python version of the CHIANTI IDL procedure karzas_xs.
Interpolates free-bound gaunt factor of Karzas and Latter, (1961, Astrophysical Journal Supplement Series, 6, 167) as a function of wavelength (wvl).
-
mewe_gaunt_factor
(**kwargs)¶ Calculate the Gaunt factor according to [1]_ for a single ion \(Z_z\).
Using Eq. 9 of [1]_, the free-bound Gaunt factor for a single ion can be written as,
\[G_{fb}^{Z,z} = \frac{E_H}{k_BT}\mathrm{Ab}(Z)\frac{N(Z,z)}{N(Z)}f(Z,z,n)\]where \(E_H\) is the ground-state potential of H, \(\mathrm{Ab}(Z)\) is the elemental abundance, \(\frac{N(Z,z)}{N(Z)}\) is the fractional ionization, and \(f(Z,z,n)\) is given by Eq. 10 and is approximated by Eq 16 as,
\[f(Z,z,n) \approx f_2(Z,z,n_0) = 0.9\frac{\zeta_0z_0^4}{n_0^5}\exp{\left(\frac{E_Hz_0^2}{n_0^2k_BT}\right)} + 0.42\frac{z^4}{n_0^{3/2}}\exp{\left(\frac{E_Hz^2}{(n_0 + 1)^2k_BT}\right)}\]where \(n_0\) is the principal quantum number, \(z_0\) is the effective charge (see Eq. 7 of [1]_), and \(\zeta_0\) is the number of vacancies in the 0th shell and is given in Table 1 of [1]_. Here it is calculated in the same manner as in fb_rad_loss.pro of the CHIANTI IDL library. Note that in the expression for \(G_{fb}\), we have not included the \(N_H/n_e\) factor.
Raises: ValueError
– If no .fblvl file is available for this ionReferences
[1] Mewe, R. et al., 1986, A&AS, 65, 511
-
sutherland_gaunt_factor
(wavelength)¶ Calculates the free-free gaunt factor calculations of [1]_.
The Gaunt factors of [1]_ are read in using ChiantiPy.tools.io.gffRead as a function of \(u\) and \(\gamma^2\). The data are interpolated to the appropriate wavelength and temperature values using ~scipy.ndimage.map_coordinates.
References
[1] Sutherland, R. S., 1998, MNRAS, 300, 321
-
vernerCross
(wvl)¶ Calculates the photoionization cross-section using data from [1]_ for transitions to the ground state.
The photoionization cross-section can be expressed as \(\sigma_i^{fb}=F(E/E_0)\) where \(F\) is an analytic fitting formula given by Eq. 1 of [1]_,
\[F(y) = ((y-1)^2 + y_w^2)y^{-Q}(1 + \sqrt{y/y_a})^{-P},\]where \(E\) is the photon energy, \(n\) is the principal quantum number, \(l\) is the orbital quantum number, \(Q = 5.5 + l - 0.5P\), and \(\sigma_0,E_0,y_w,y_a,P\) are fitting paramters. These can be read in using ChiantiPy.tools.io.vernerRead.
References
[1] Verner & Yakovlev, 1995, A&AS, 109, 125
ChiantiPy.core.Ion module¶
Ion class
-
class
ChiantiPy.core.Ion.
ion
(ionStr, temperature=None, eDensity=None, pDensity='default', radTemperature=None, rStar=None, abundance=None, setup=True, em=None, verbose=0)¶ Bases:
ChiantiPy.base._IoneqOne.ioneqOne
,ChiantiPy.base._IonTrails.ionTrails
,ChiantiPy.base._SpecTrails.specTrails
The top level class for performing spectral calculations for an ion in the CHIANTI database.
Parameters: - ionStr (str) – CHIANTI notation for the given ion, e.g. ‘fe_12’ that corresponds to the Fe XII ion.
- temperature (float , tuple, list, ~numpy.ndarray, optional) – Temperature array (Kelvin)
- eDensity (float , tuple, list, or ~numpy.ndarray, optional) – Electron density array (\(\mathrm{cm^{-3}}\) )
- pDensity (float, tuple, list or ~numpy.ndarray, optional) – Proton density (\(\mathrm{cm}^{-3}\) )
- radTemperature (float or ~numpy.ndarray, optional) – Radiation black-body temperature (in Kelvin)
- rStar (float or ~numpy.ndarray, optional) – Distance from the center of the star (in stellar radii)
- abundance (float or str, optional) – Elemental abundance relative to Hydrogen or name of CHIANTI abundance file to use, without the ‘.abund’ suffix, e.g. ‘sun_photospheric_1998_grevesse’.
- setup (bool or str, optional) – If True, run ion setup function. Otherwise, provide a limited number of attributes of the selected ion
- em (float or ~numpy.ndarray, optional) – Emission Measure, for the line-of-sight emission measure (\(\mathrm{\int \, n_e \, n_H \, dl}\)) (\(\mathrm{cm}^{-5}\).), for the volumetric emission measure \(\mathrm{\int \, n_e \, n_H \, dV}\) (\(\mathrm{cm^{-3}}\)).
Variables: - IonStr (str) – Name of element plus ion, e.g. fe_12 for Fe XII
- Z (int) – the nuclear charge, 26 for fe_12.
- Ion (int) – the ionization stage, 12 for fe_12.
- Dielectronic (bool) – true if the ion is a ‘dielectronic’ ion where the levels are populated by dielectronic recombination.
- Spectroscopic (str) – the spectroscopic notation for the ion, such as Fe XII for fe_12.
- Filename (str) – the complete name of the file generic filename in the CHIANTI database, such as $XUVTOP/fe/fe_12/fe_12.
- Ip (float) – the ionization potential of the ion
- FIP (float) – the first ionization potential of the element
- Defaults (dict) – these are specified by the software unless a chiantirc file is found in ‘$HOME/.chianti’:
Notes
The keyword arguments temperature, eDensity, radTemperature, rStar, em must all be either a float or have the same dimension as the rest if specified as lists, tuples or arrays.
The Defaults dict should have the following keys:
- abundfile, the elemental abundance file, unless specified in chiantirc this defaults to sun_photospheric_1998_grevesse.
- ioneqfile, the ionization equilibrium file name. Unless specified in ‘chiantirc’ this is defaults to chianti. Other choices are availble in $XUVTOP/ioneq
- wavelength, the units of wavelength (Angstroms, nm, or kev), unless specified in the ‘chiantirc’ this is defaults to ‘angstrom’.
- flux, specified whether the line intensities are give in energy or photon fluxes, unless specified in the ‘chiantirc’ this is defaults to energy.
- gui, specifies whether to use gui selection widgets (True) or to make selections on the command line (False). Unless specified in the ‘chiantirc’ this is defaults to False.
-
boundBoundLoss
(allLines=1)¶ Calculate the summed radiative loss rate for all spectral lines of the specified ion.
Parameters: - allLines (bool) – If True, include losses from both observed and unobserved lines. If False, only include losses from observed lines.
- includes elemental abundance and ionization fraction.
Returns: creates the attribute
BoundBoundLoss (dict with the keys below.) – rate : the radiative loss rate (\(\mathrm{erg \, cm^{-3}} \, \mathrm{s}^{-1}\)) per unit emission measure.
temperature : (K).
eDensity : electron density (\(\mathrm{cm^{-3}}\))
-
diCross
(energy=None, verbose=False)¶ Calculate the direct ionization cross section (cm$^2) as a function of the incident electron energy in eV, puts values into attribute DiCross
Parameters: - energy (array-like) – incident electron energy in eV
- verbose (bool, int) – with verbose set to True, printing is enabled
Variables: DiCross (dict) – keys: energy, cross
-
diRate
()¶ Calculate the direct ionization rate coefficient as a function of temperature (K)
-
drPopulate
(popCorrect=1, verbose=0)¶ Calculate level populations for specified ion. possible keyword arguments include temperature, eDensity, pDensity, radTemperature and rStar different from method populate() in that it includes the dielectronic recombination from all levels specified by the .auto file - consequently, it also calculates the populations of the higher ionization stage
-
drRate
()¶ Provide the dielectronic recombination rate coefficient as a function of temperature (K).
-
drRateLvl
(verbose=0)¶ to calculate the level resolved dielectronic rate from the higher ionization stage to the ion of interest rates are determined from autoionizing A-values the dictionary self.DrRateLvl contains rate = the dielectronic rate into an autoionizing level effRate = the dielectronic rate into an autoionizing level mutilplied by the branching ratio for a stabilizing transition totalRate = the sum of all the effRates
-
eaCross
(energy=None, verbose=False)¶ Provide the excitation-autoionization cross section.
Energy is given in eV.
-
eaDescale
()¶ Calculates the effective collision strengths (upsilon) for excitation-autoionization as a function of temperature.
-
eaRate
()¶ Calculate the excitation-autoionization rate coefficient.
-
emiss
(allLines=True)¶ Calculate the emissivities for lines of the specified ion.
units: ergs s^-1 str^-1
Does not include elemental abundance or ionization fraction
Wavelengths are sorted
set allLines = True to include unidentified lines
-
emissList
(index=-1, wvlRange=None, wvlRanges=None, top=10, relative=0, outFile=0)¶ List the emissivities.
wvlRange, a 2 element tuple, list or array determines the wavelength range
Top specifies to plot only the top strongest lines, default = 10
normalize = 1 specifies whether to normalize to strongest line, default = 0
-
emissPlot
(index=-1, wvlRange=None, top=10, linLog='lin', relative=0, verbose=0, plotFile=0, saveFile=0)¶ Plot the emissivities.
wvlRange, a 2 element tuple, list or array determines the wavelength range
Top specifies to plot only the top strongest lines, default = 10
linLog specifies a linear or log plot, want either lin or log, default = lin
normalize = 1 specifies whether to normalize to strongest line, default = 0
-
emissRatio
(wvlRange=None, wvlRanges=None, top=10)¶ Plot the 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.
-
gofnt
(wvlRange=0, top=10, verbose=0, plot=True)¶ Calculate the ‘so-called’ G(T) function.
Given as a function of both temperature and eDensity.
Only the top( set by ‘top’) brightest lines are plotted. the G(T) function is returned in a dictionary self.Gofnt
-
intensity
(allLines=1, verbose=0)¶ Calculate the intensities for lines of the specified ion.
units: ergs cm^-3 s^-1 str^-1
includes elemental abundance and ionization fraction.
the emission measure ‘em’ is included if specified
-
intensityRatioInterpolate
(data, scale='lin', plot=0, verbose=0)¶ to take a set of date and interpolate against the IntensityRatio the scale can be one of ‘lin’/’linear’ [default], ‘loglog’, ‘logx’, ‘logy’,
-
ionizCross
(energy=None)¶ Provides the total ionization cross section.
Notes
uses diCross and eaCross.
-
ionizRate
()¶ Provides the total ionization rate.
Calls diRate and eaRate.
-
p2eRatio
()¶ Calculates the proton density to electron density ratio using Eq. 7 of [1]_.
Notes
Uses the abundance and ionization equilibrium.
References
[1] Young, P. R. et al., 2003, ApJS, 144, 135
-
popPlot
(top=10, levels=[], scale=0, plotFile=0, outFile=0, pub=0, addTitle=None)¶ Plots populations vs temperature or eDensity.
top specifies the number of the most highly populated levels to plot (the default)
or can set levels to an array such as a list to set the desired levels to plot
if scale is set, then the population, if plotted vs. density, is divided by density - only useful if plotting level populations vs density
if pub is set, the want publication plots (bw, lw=2).
-
populate
(popCorrect=1, verbose=0)¶ Calculate level populations for specified ion. possible keyword arguments include temperature, eDensity, pDensity, radTemperature and rStar populate assumes that all of the population in the higher ionization stages exists only in the ground level use drPopulate() for cases where the population of various levels in the higher ionization stage figure into the calculation
-
recombRate
()¶ Provides the total recombination rate coefficient.
Calls drRate and rrRate
-
rrRate
()¶ Provide the radiative recombination rate coefficient as a function of temperature (K).
-
rrlvlDescale
(verbose=1)¶ Interpolate and extrapolate rrlvl rates. Used in level population calculations.
-
setup
(alternate_dir=None, verbose=False)¶ Setup various CHIANTI files for the ion including .wgfa, .elvlc, .scups, .psplups, .reclvl, .cilvl, and others.
Parameters: - alternate_dir (str) – directory cotaining the necessary files for a ChiantiPy ion; use to setup an ion with files not in the current CHIANTI directory
- verbose (bool)
Notes
If ion is initiated with setup=False, call this method to do the setup at a later point.
-
setupIonrec
(alternate_dir=None, verbose=False)¶ Setup method for ion recombination and ionization rates.
Notes
Allows a bare-bones ion object to be setup up with just the ionization and recombination rates. For ions without a complete set of files - one that is not in the MasterList.
-
spectrum
(wavelength, filter=(<function gaussianR>, 1000.0), label=0, allLines=1)¶ Calculates the line emission spectrum for the specified ion.
Convolves the results of intensity to make them look like an observed spectrum the default filter is the gaussianR filter with a resolving power of 1000. Other choices include chianti.filters.box and chianti.filters.gaussian. When using the box filter, the width should equal the wavelength interval to keep the units of the continuum and line spectrum the same.
includes ionization equilibrium and elemental abundances
can be called multiple times to use different filters and widths uses label to keep the separate applications of spectrum sorted by the label for example, do .spectrum( …. labe=’test1’) and do .spectrum( …. label = ‘test2’) then will get self.Spectrum.keys() = test1, test2 and self.Spectrum[‘test1’] = {‘intensity’:aspectrum, ‘wvl’:wavelength, ‘filter’:useFilter.__name__, ‘filterWidth’:useFactor}
Notes
scipy.ndimage.filters also includes a range of filters.
-
twoPhoton
(wvl, verbose=False)¶ to calculate the two-photon continuum - only for hydrogen- and helium-like ions includes the elemental abundance and the ionization equilibrium includes the emission measure if specified
-
twoPhotonEmiss
(wvl)¶ To calculate the two-photon continuum rate coefficient - only for hydrogen- and helium-like ions
-
twoPhotonLoss
()¶ to calculate the two-photon energy loss rate - only for hydrogen- and helium-like ions includes the elemental abundance and the ionization equilibrium does not include the emission measure
-
upsilonDescale
(prot=0)¶ Provides the temperatures and effective collision strengths (upsilons) set prot for proton rates otherwise, ce will be set for electron collision rates uses the new format “scups” files
ChiantiPy.core.Ioneq module¶
Ionization equilibrium class
-
class
ChiantiPy.core.Ioneq.
ioneq
(el_or_z)¶ Bases:
object
Calculation ion fractions as a function of temperature assuming ionization equilibrium.
Parameters: el_or_z (int or str) – Atomic number or symbol Note
When either loading or calculating a set of ion fractions, the temperature and ion fractions are returned to the Temperature and Ioneq attributes, respectively.
-
calculate
(temperature)¶ Calculate ion fractions for given temperature array using the total ionization and recombination rates.
-
load
(ioneqName=None)¶ Read temperature and ion fractions from a CHIANTI “.ioneq” file.
-
plot
(stages=0, xr=0, yr=0, oplot=False, label=1, title=1, bw=0, semilogx=0, verbose=0)¶ Plots the ionization equilibria.
self.plot(xr=None, yr=None, oplot=False) stages = sequence of ions to be plotted, neutral == 1, fully stripped == Z+1 xr = temperature range, yr = ion fraction range
for overplotting: oplot=”ioneqfilename” such as ‘mazzotta’ or if oplot=True or oplot=1 and a widget will come up so that a file can be selected.
-
plotRatio
(stageN, stageD, xr=0, yr=0, label=1, title=1, bw=0, semilogx=1, verbose=0)¶ Plots the ratio of the ionization equilibria of two stages of a given element
self.plotRatio(stageN, stageD) stages = sequence of ions to be plotted, neutral == 1, fully stripped == Z+1 stageN = numerator stageD = denominator xr = temperature range, yr = ion fraction range
-
ChiantiPy.core.IpyMspectrum module¶
-
ChiantiPy.core.IpyMspectrum.
doAll
(inpt)¶ to process ff, fb and line inputs
-
class
ChiantiPy.core.IpyMspectrum.
ipymspectrum
(temperature, eDensity, wavelength, filter=(<function gaussianR>, 1000.0), label=None, elementList=None, ionList=None, minAbund=None, keepIons=0, doLines=1, doContinuum=1, allLines=1, em=None, abundance=None, verbose=0, timeout=0.1)¶ Bases:
ChiantiPy.base._IonTrails.ionTrails
,ChiantiPy.base._SpecTrails.specTrails
this is the multiprocessing version of spectrum for using inside an IPython Qtconsole or notebook.
be for creating an instance, it is necessary to type something like the following into a console
> ipcluster start –n=3
this is the way to invoke things under the IPython 6 notation
Calculate the emission spectrum as a function of temperature and density.
temperature and density can be arrays but, unless the size of either is one (1), the two must have the same size
the returned spectrum will be convolved with a filter of the specified width on the specified wavelength array
the default filter is gaussianR with a resolving power of 100. Other filters, such as gaussian, box and lorentz, are available in ChiantiPy.filters. When using the box filter, the width should equal the wavelength interval to keep the units of the continuum and line spectrum the same.
A selection of elements can be make with elementList a list containing the names of elements that are desired to be included, e.g., [‘fe’,’ni’]
A selection of ions can be make with ionList containing the names of the desired lines in Chianti notation, i.e. C VI = c_6
Both elementList and ionList can not be specified at the same time
a minimum abundance can be specified so that the calculation can be speeded up by excluding elements with a low abundance. With solar photospheric abundances -
setting minAbund = 1.e-4 will include H, He, C, O, Ne setting minAbund = 2.e-5 adds N, Mg, Si, S, Fe setting minAbund = 1.e-6 adds Na, Al, Ar, Ca, Ni
Setting em will multiply the spectrum at each temperature by the value of em.
em [for emission measure], can be a float or an array of the same length as the temperature/density. allLines = 1 will include lines with either theoretical or observed wavelengths. allLines=0 will include only those lines with observed wavelengths
proc = the number of processors to use timeout - a small but non-zero value seems to be necessary
ChiantiPy.core.Mspectrum module¶
-
class
ChiantiPy.core.Mspectrum.
mspectrum
(temperature, eDensity, wavelength, filter=(<function gaussianR>, 1000.0), label=0, elementList=None, ionList=None, minAbund=None, keepIons=0, abundance=None, doLines=1, doContinuum=1, allLines=1, em=None, proc=3, verbose=0, timeout=0.1)¶ Bases:
ChiantiPy.base._IonTrails.ionTrails
,ChiantiPy.base._SpecTrails.specTrails
this is the multiprocessing version of spectrum set proc to the desired number of processors, default=3
Calculate the emission spectrum as a function of temperature and density.
temperature and density can be arrays but, unless the size of either is one (1), the two must have the same size
the returned spectrum will be convolved with a filter of the specified width on the specified wavelength array
the default filter is gaussianR with a resolving power of 100. Other filters, such as gaussian, box and lorentz, are available in chianti.filters. When using the box filter, the width should equal the wavelength interval to keep the units of the continuum and line spectrum the same.
A selection of elements can be make with elementList a list containing the names of elements that are desired to be included, e.g., [‘fe’,’ni’]
A selection of ions can be make with ionList containing the names of the desired lines in Chianti notation, i.e. C VI = c_6
Both elementList and ionList can not be specified at the same time
a minimum abundance can be specified so that the calculation can be speeded up by excluding elements with a low abundance. With solar photospheric abundances -
setting minAbund = 1.e-4 will include H, He, C, O, Ne setting minAbund = 2.e-5 adds N, Mg, Si, S, Fe setting minAbund = 1.e-6 adds Na, Al, Ar, Ca, Ni
Setting em will multiply the spectrum at each temperature by the value of em.
em [for emission measure], can be a float or an array of the same length as the temperature/density. allLines = 1 will include lines with either theoretical or observed wavelengths. allLines=0 will include only those lines with observed wavelengths
proc = the number of processors to use timeout - a small but non-zero value seems to be necessary
ChiantiPy.core.RadLoss module¶
-
class
ChiantiPy.core.RadLoss.
radLoss
(temperature, eDensity, elementList=0, ionList=0, minAbund=0, doContinuum=1, abundance=None, verbose=0, allLines=1, keepIons=0)¶ Bases:
ChiantiPy.base._IonTrails.ionTrails
,ChiantiPy.base._SpecTrails.specTrails
Calculate the emission spectrum as a function of temperature and density.
includes elemental abundances or ionization equilibria
temperature and density can be arrays but, unless the size of either is one (1), the two must have the same size
the returned spectrum will be convolved with a filter of the specified width on the specified wavelength array
the default filter is gaussianR with a resolving power of 1000. Other filters, such as gaussian, box and lorentz, are available in ChiantiPy.filters. When using the box filter, the width should equal the wavelength interval to keep the units of the continuum and line spectrum the same.
A selection of ions can be make with ionList containing the names of the desired lines in Chianti notation, i.e. C VI = c_6
a minimum abundance can be specified so that the calculation can be speeded up by excluding elements with a low abundance. With solar photospheric abundances -
setting minAbund = 1.e-4 will include H, He, C, O, Ne setting minAbund = 2.e-5 adds N, Mg, Si, S, Fe setting minAbund = 1.e-6 adds Na, Al, Ar, Ca, Ni
Setting em will multiply the spectrum at each temperature by the value of em.
em [for emission measure], can be a float or an array of the same length as the temperature/density.
- abundance: to select a particular set of abundances, set abundance to the name of a CHIANTI abundance file,
- without the ‘.abund’ suffix, e.g. ‘sun_photospheric_1998_grevesse’ If set to a blank (‘’), a gui selection menu will popup and allow the selection of an set of abundances
-
radLossPlot
(title=0)¶ to plot the radiative losses vs temperature
ChiantiPy.core.Spectrum module¶
-
class
ChiantiPy.core.Spectrum.
bunch
(temperature, eDensity, wvlRange, elementList=None, ionList=None, minAbund=None, keepIons=0, em=None, abundance=None, verbose=0, allLines=1)¶ Bases:
ChiantiPy.base._IonTrails.ionTrails
,ChiantiPy.base._SpecTrails.specTrails
Calculate the emission line spectrum as a function of temperature and density.
‘bunch’ is very similar to ‘spectrum’ except that continuum is not calculated and the spectrum is not convolved over a filter. However, this can be done with the inherited convolve method
one of the convenient things is that all of the instantiated ion classes, determined through such keywords as ‘elementList’, ‘ionList’, and ‘minAbund’ are kept in a dictionary self.IonInstances where self.IonInstances[‘mg_7’] is the class instance of ChiantiPy.core.ion for ‘mg_7’. All its methods and attributes are available.
includes elemental abundances and ionization equilibria
the set of abundances, a file in $XUVTOP/abundance, can be set with the keyword argument ‘abundanceName’
temperature and density can be arrays but, unless the size of either is one (1), the two must have the same size
Inherited methods include ‘intensityList’, ‘intensityRatio’ (between lines of different ions), and ‘intensityRatioSave’ and ‘convolve’.
A selection of elements can be make with elementList a list containing the names of elements that are desired to be included, e.g., [‘fe’,’ni’]
A selection of ions can be make with ionList containing the names of the desired lines in Chianti notation, i.e. C VI = c_6
Both elementList and ionList can not be specified at the same time
a minimum abundance can be specified so that the calculation can be speeded up by excluding elements with a low abundance. With solar photospheric abundances -
setting minAbund = 1.e-4 will include H, He, C, O, Ne setting minAbund = 2.e-5 adds N, Mg, Si, S, Fe setting minAbund = 1.e-6 adds Na, Al, Ar, Ca, Ni
At least one of elementList, ionList, or minAbund must be set in order for ‘bunch’ to include any ions.
Setting em will multiply the spectrum at each temperature by the value of em.
em [for emission measure], can be a float or an array of the same length as the temperature/density
-
class
ChiantiPy.core.Spectrum.
spectrum
(temperature, eDensity, wavelength, filter=(<function gaussianR>, 1000.0), label=None, elementList=None, ionList=None, minAbund=None, doLines=1, doContinuum=1, em=None, keepIons=0, abundance=None, verbose=0, allLines=1)¶ Bases:
ChiantiPy.base._IonTrails.ionTrails
,ChiantiPy.base._SpecTrails.specTrails
Calculate the emission spectrum as a function of temperature and density.
one of the convenient things is that all of the instantiated ion classes, determined through such keywords as ‘elementList’, ‘ionList’, and ‘minAbund’ are kept in a dictionary self.IonInstances where self.IonInstances[‘mg_7’] is the class instance of ChiantiPy.core.ion for ‘mg_7’. All its methods and attributes are available.
includes elemental abundances and ionization equilibria
the set of abundances, a file in $XUVTOP/abundance, can be set with the keyword argument ‘abundanceName’
temperature and density can be arrays but, unless the size of either is unity (1), the two must have the same size
the returned spectrum will be convolved with a filter of the specified width on the specified wavelength array
the default filter is gaussianR with a resolving power of 1000. Other filters, such as gaussian, box and lorentz, are available in ChiantiPy.tools.filters. When using the box filter, the width should equal the wavelength interval to keep the units of the continuum and line spectrum the same.
Inherited methods include ‘intensityList’, ‘intensityRatio’ (between lines of different ions), ‘intensityRatioSave’ and ‘convolve’
A selection of elements can be make with elementList a list containing the names of elements that are desired to be included, e.g., [‘fe’,’ni’]
A selection of ions can be make with ionList containing the names of the desired lines in CHIANTI notation, i.e. C VI = c_6
Both elementList and ionList can not be specified at the same time
a minimum abundance can be specified so that the calculation can be speeded up by excluding elements with a low abundance. The default of minAbund is 1.e-6
It is necessary to specify at least an elementList, an ionList, or a minAbund to select any ions for a spectrum calculation
With solar photospheric abundances -
setting minAbund = 1.e-4 will include H, He, C, O, Ne setting minAbund = 2.e-5 adds N, Mg, Si, S, Fe setting minAbund = 1.e-6 adds Na, Al, Ar, Ca, Ni
Setting doLines = 0 will skip the calculation of spectral lines. Setting doContinuum =0 will skip the continuum calculation.
Setting em [for emission measure] will multiply the spectrum at each temperature by the value of em.
em [for emission measure] can be a float or an array of the same length as the temperature/density
keepIons: set this to keep the ion instances that have been calculated in a dictionary self.IonInstances with the keywords being the CHIANTI-style ion names
abundance: to select a particular set of abundances, set abundance to the name of a CHIANTI abundance file, without the ‘.abund’ suffix, e.g. ‘sun_photospheric_1998_grevesse’
If set to a blank (‘’), a gui selection menu will popup and allow the selection of an set of abundances
Module contents¶
chianti.core - contains the main classes for ChiantiPy users.
This software is distributed under the terms of the ISC Software License that is found in the LICENSE file


Enjoy a Welsh weekend at Disneyland Paris for St David's Day
The park hosts a celebratory Welsh festival every year, complete with themed costumes and fireworks
by Leena SidatYou’ve probably heard of Disneyland Paris. You’re probably also aware of St. David’s Day. But did you know that, every year, Disneyland Paris hosts a Welsh weekend?
Since 2007, the festival celebrates Wales’ patron saint with an exciting Disney twist. Everywhere you turn the park is flooded with Welsh accents and the coach park filled with Welsh companies.
The 2020 festival is set to take place from March 6 to 8 and promises to be a truly unique experience for all visitors, especially families.
Looking for the lowdown? Read on…
Witness dazzling performances
Disney is famous for its incredible performances and the St. David’s Welsh weekend is no different.
On the afternoon of Saturday, March 7, watch as multiple talented dancers take to the stage in the Videopolis Theatre wearing traditional Welsh dress to open the dazzling live performances.
The main show will invite school choirs from across Wales to perform, and also see the winners from the Urdd Welsh National Eisteddfod perform on the international stage.
Mickey and Minnie will also make an appearance, dressed in Welsh themed costumes, and, at this year's festival back in March, the winners of BBC talent show Last Choir Standing, Only Men Aloud, performed live at the festival.
Enjoy an epic fireworks show
Arguably the highlight of the experience is the Disneyland's Illuminations show which takes place over Sleeping Beauty’s castle every night just before the park closes.
Watch thousands of people gather as the sky turns red and Welsh dragons are projected on to the castle, highlighted by the incredible fireworks.
The spectacle is sound-tracked by all your favourite Disney songs, so, for those of you who have spent years learning the lyrics, make sure to sing along!
Experience the land of song
Of course, Wales has a very long history of fantastic music, which Disneyland Paris makes sure to showcase throughout the festival.
Bands reminiscent of the Stereophonics and Manic Street Preachers will perform in Billy Bob’s Country Western Saloon, making you feel like you’re on a proper Welsh night out - just grab some chips on the way back to the hotel to top it off!
Enjoy the extra Welsh touches
However, it’s not just the big set pieces that make this festival so special; it’s the little touches that are dotted throughout.
Spot Mickey and Minnie Mouse in traditional Welsh dress, daffodil information boards, face painting reminiscent of a rugby match day in Cardiff, and, of course, there’ll be plenty of Welsh flags to spot!
Top tip
When you book with Edwards Coaches, not only is your travel and entry covered for the weekend, but you can also make use of Disney’s Magic Hours.
This means that you can get access to the parks a whole hour earlier than the general public, avoid crowds on the big rides, and have more time to soak up the magical atmosphere.
For more information on Disneyland Paris tours, visit www.edwardscoaches.co.uk or call one of Edwards’ travel shops.


Here is all the information about board button
Clinet board ID:{{pointid}}
返回主页
PatternID:{{patternid}}
Current Pattern is {{patternContent}}
Submit


Enumeration members
AlreadyReported
AlreadyReported: = 208
BadGateway
BadGateway: = 502
BadRequest
BadRequest: = 400
EarlyHints
EarlyHints: = 103
ExpectationFailed
ExpectationFailed: = 417
FailedDependency
FailedDependency: = 424
Forbidden
Forbidden: = 403
GatewayTimeout
GatewayTimeout: = 504
InsufficientStorage
InsufficientStorage: = 507
InternalServerError
InternalServerError: = 500
LengthRequired
LengthRequired: = 411
LoopDetected
LoopDetected: = 508
MethodNotAllowed
MethodNotAllowed: = 405
MisdirectedRequest
MisdirectedRequest: = 421
MovedPermanently
MovedPermanently: = 301
MultipleChoices
MultipleChoices: = 300
NoContent
NoContent: = 204
NonAuthorativeInformation
NonAuthorativeInformation: = 203
NotAccepable
NotAccepable: = 406
NotImplemented
NotImplemented: = 501
NotModified
NotModified: = 304
PartialContent
PartialContent: = 206
PayloadTooLarge
PayloadTooLarge: = 413
PaymentRequired
PaymentRequired: = 402
PermRedirect
PermRedirect: = 308
PreconditionFailed
PreconditionFailed: = 412
Processing
Processing: = 102
RequestHeaderTooLarge
RequestHeaderTooLarge: = 431
RequestTimeout
RequestTimeout: = 408
ResetContent
ResetContent: = 205
ServiceUnavailable
ServiceUnavailable: = 503
SwitchProtocols
SwitchProtocols: = 101
TempRedirect
TempRedirect: = 307
TooManyRequests
TooManyRequests: = 429
Unauthorized
Unauthorized: = 401
UnavailableForLeagalReasons
UnavailableForLeagalReasons: = 451
UnprocessableEntity
UnprocessableEntity: = 422
UnsupportedMediaTyppe
UnsupportedMediaTyppe: = 415
UpgradeRequired
UpgradeRequired: = 426
UriTooLong
UriTooLong: = 414
400


Help
→ General → name
The name of this source.
- Alphanummeric and underscores only
- A minimum of 3 characters and a maximum of 14 characters.
→ General → Info
Use this to describe the server. This text will be shown in the server browser.
- A maximum of 360 characters is allowed.
→ General → Image
Upload a thumbnail image for the source.
- Must be a valid image that is no larger than 512x512.
→ General → Location
The location to the source.
HTTP(s):
http://example.org/files/
FTP:
ftp://example.org/
Use the 'test connection' button to see if everything works correctly before adding the server.
Linking directly to a protoindex file is allowed.
-
Must start with a valid scheme (http://, https://, ftp://, smb://)
→ General → Protocol
Pick any of the available protocols.
→ General → Speed
Use this to specify how fast the source is, in mbit.
-
Must be an integer ranging from 0 to 5000.
→ General → Country
Useful for searching for a nearby source.
→ Authentication → Type
The type of authentication to use. If you don't know what to use, use the 'test connection' button near 'Location' to detect what kind of authentication is needed for accessing this source.
→ Crawler → Interval
Determine at what interval to crawl, if at all.
→ Crawler → User-Agent
The useragent to use while crawling the source.
→ Crawler → Wait
The time between individual requests to wait. In some cases it is best to cut the source some slack.