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
Keyword Arguments:
abundance (float, 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}\).
verbose (bool) – if True, prints additional info to the console
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 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 [108] and [106]. Eq. 1a of [106] can be integrated over wavelength to get the free-bound loss rate,
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 [106] (see mewe_gaunt_factor for more details) and \(C_{ff}\) is the numerical constant
as given in Eq. 4 of [108] and can be written in terms of the fine structure constant \(\alpha\),
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{Å}^{-1}\) for an individual ion.
If includeAbund is set,
the abundance is included. If includeIoneq is set, the ionization equililibrium for the given
ion is included
Notes
Uses the Gaunt factors of [103] for recombination to the excited levels
Uses the photoionization cross sections of [3] to develop the free-bound cross section
Include the elemental abundance and ionization fraction by default
The specified ion is the target ion
uses the corrected version of the K-L bf gaunt factors available in CHIANTI V10
revised to calculate the bf cross, fb cross section and the maxwell energy distribution
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 [103] Karzas, W.J, Latter, R, 1961, ApJS, 6, 167
provides rate = erg cm^-2 s^-1
.. rubric:: Notes
Uses the Gaunt factors of [103] 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
uses the corrected version of the K-L bf gaunt factors available in CHIANTI V10
revised to calculate the bf cross, fb cross section and the maxwell energy distribution
the Verner cross sections are not included for now
to calculate the radiative loss rate from the parameters of [109]
Mao J., Kaastra J., Badnell N.R.
<Astron. Astrophys. 599, A10 (2017)>=2017A&A…599A..10M
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 [108] and [106]. Eq. 1a of [106] can be integrated over wavelength to get the free-bound loss rate,
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 [106] (see mewe_gaunt_factor for more details) and \(C_{ff}\) is the numerical constant
as given in Eq. 4 of [108] and can be written in terms of the fine structure constant \(\alpha\),
Calculates the free-bound (radiative recombination) rate 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. If includeAbund is set,
the abundance is included. If includeIoneq is set, the ionization equililibrium for the given
ion is included
This method is only for the purposes of testing.
The best rr/FB rates come from the ion class
Notes
Uses the Gaunt factors of [103] for recombination to the excited levels
Uses the photoionization cross sections of [3] to develop the free-bound cross section
Include the elemental abundance and ionization fraction by default
The specified ion is the target ion
uses the corrected version of the K-L bf gaunt factors available in CHIANTI V10
revised to calculate the bf cross, fb cross section and the maxwell energy distribution
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 [107],
substituting \(\nu=c/\lambda\), dividing by the solid angle, and writing the numerical
constant in terms of the fine structure constant \(\alpha\),
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 [104] and [101], 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
includeAbund (bool, optional) – If True, include the ion abundance in the final output.
includeIoneq (bool, optional) – If True, include the ionization equilibrium in the final output
where where \(Z\) is the ion 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 [103]. Note that this expression for the
loss rate is just the integral over wavelength of Eq. 5.14a of [103], the free-free emission, and
is expressed in units of erg \(\mathrm{cm}^3\,\mathrm{s}^{-1}\).
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 [103]. Note that this expression for the
loss rate is just the integral over wavelength of Eq. 5.14a of [107], the free-free emission, and
is expressed in units of erg \(\mathrm{cm}^3\,\mathrm{s}^{-1}\).
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
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
An analytic fitting formulae for the relativistic Gaunt factor is given by Eq. 4 of [104],
\[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 [104]. These values
are valid for \(6<\log_{10}(T)< 8.5\) and \(-4<\log_{10}(u)<1\).
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,
where \(n_0\) is the principal quantum number, \(z_0\) is the effective charge (see Eq. 7 of [106]),
and \(\zeta_0\) is the number of vacancies in the 0th shell and is given in Table 1 of [106].
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 ion
Calculates the free-free gaunt factor calculations of [101].
The Gaunt factors of [101] 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.
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.
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 (:math:r`mathrm{cm^{-3}}` )
pDensity (float, tuple, list or ~numpy.ndarray, optional) – Proton density (:math:r`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
(:math:r`mathrm{int , n_e , n_H , dl}`)
(:math:r`mathrm{cm}^{-5}`.), for the volumetric emission measure
:math:r`mathrm{int , n_e , n_H , dV}` (:math:r`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.
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 (:math:r`mathrm{erg , cm^{-3}} , mathrm{s}^{-1}`) per unit emission measure.
temperature : (K).
eDensity : electron density (:math:r`mathrm{cm^{-3}}`)
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
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.
Take a set of data and interpolate against the IntensityRatio.
Given a set of intensities ratio data it correlates them to electron density
values. This is done by interpolating against the curve computed from
the IntenstyRatio (dict). For the interpolation, the B-spline representation
is used from scipy.
Parameters:
data (float or array-like) – The intensities ratio data to be converted into density values.
scale ({‘lin’, ‘loglog’, ‘logx’, ‘logy’}, str, default : ‘lin’) – The scale to be used for the interpolation (default ‘lin’ indicates linear).
plot (bool, default : False) – If True the input data will be plotted on top of the IntensityRatio
curve.
verbose (bool, default : False) – If True displays a message about the physical quantity that was used
(i.e. Temperature or Density).
Additionally, prints the interpolated data in pairs of data,value
(i.e. input intensities ratio data and corresponding density values).
Returns:
Creates the attribute
IntensityRatioInterpolated (dict) – Dictionary that contains the input data and the derived density values,
with keys
data : input intensities ratio (no units)
value : electron density (:math:r`mathrm{cm^{-3}}`)
Examples
>>> importChiantiPy.coreasch>>> temp=10**5.9>>> dens=10**(np.linspace(8,12,num=50,endpoint=True))>>> fe12=ch.ion('fe_12',temperature=temp,eDensity=dens)>>> fe12.intensityRatio(wvlRange=[186.,196.])>>> # Select for example lines 186.887 and 195.119 from the GUI>>> int_ratios=np.linspace(0.1,0.8,20)>>> fe12.intensityRatioInterpolate(int_ratios)>>> dens_values=fe12.IntensityRatioInterpolated['value']
>>> # Same setup but using a 2D array of input data>>> x=10>>> y=30>>> int_ratios_map=np.random.random((x,y))>>> fe12.intensityRatioInterpolate(int_ratios_map,verbose=True)>>> dens_values_map=fe12.IntensityRatioInterpolated['value'].reshape((x,y))
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
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.
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( …. label = ‘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.
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
discussed in [105]
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
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
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.
self.plot(tRange=None, yr=None, oplot=False)
stages = sequence of ions to be plotted, neutral == 1, fully stripped == Z+1
tRange = 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.
bw, if True, the plot is made in black and white
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
tRange = temperature range, yr = ion fraction range
a function to create a chianit .ioneq style ionization equilibrium
:Parameters: * filename (str) – the name of the file to be created - should end in .ioneq
directory (str) – the directory where the file will be placed. If it is None, the the file
will be placed in the uses home directory.
temperature (array-like) – the temperatures at which the ionization equilibrium will be calculated
the default value is None and the temperature will be 101 values exponentially
spaced between 10^4 and 10^9 K
reference (list of str) – a list of references to be added to tail of file.
such as [‘file created by me’, ‘today’]
verbose (bool) – if True, prints out information, the default is False
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
timeout - a small but non-zero value seems to be necessary
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
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
Parameters:
temperature (float, list, ndarray) – the temperature(s) in K
eDensity (float, ndarray) – eDensity: electron density in \(\mathrm{cm^{-3}}\)
wavelength (list or ndarray) – wavelength: array of wavelengths, generally in Angstroms
elementList (list) – elementList: list of elements to include, such as ‘fe’, ‘ne’, ‘s’
ionList (list) – ionList: list of ions to include, such as ‘fe_16’, ‘ne_10’
minAbund (float) – minAbund: minimum abundance (relative to H) to include
doLines (`bool1) – doLines: if true, line intensities are calculated
doContinuum (bool) – doContinuum: if true, continuum intensities are calculated only if wavelengths are in angstroms
keepIons (bool) –
keepIons: keep the ion instances used in the calculation
should be used with caution otherwise the bunch instance
can become quite large
em (float, list, ndarray) – em: the emission measure - the integral of the electron density times the hydrogen density
along the line of sight
abundance (str) –
abuncance: the file name of the abuncance set to be used
must be one in the $XUVTOP/abund directory
allLInes (bool) – allLines: whether or not to include unobserved lines
verbose (bool) – verbose: whether to allow certain print statements
Calculate the radiative emission loss rate 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
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
Calculate the radiative emission loss rate as a function of temperature and density.
this is the multiprocessing version of radloss
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
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
Parameters:
temperature (float, list, ndarray) – the temperature(s) in K
eDensity (float, ndarray) – eDensity: electron density in \(\mathrm{cm^{-3}}\)
elementList (list) – elementList: list of elements to include, such as ‘fe’, ‘ne’, ‘s’
ionList (list) – ionList: list of ions to include, such as ‘fe_16’, ‘ne_10’
minAbund (float) – minAbund: minimum abundance (relative to H) to include
doLines (`bool1) – doLines: if true, line intensities are calculated
doContinuum (bool) – doContinuum: if true, continuum intensities are calculated only if wavelengths are in angstroms
abundance (str) –
abuncance: the file name of the abuncance set to be used
must be one in the $XUVTOP/abund directory
allLInes (bool) – allLines: whether or not to include unobserved lines
verbose (bool) – verbose: whether to allow certain print statements
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
Parameters:
temperature (float, list, ndarray) – the temperature(s) in K
eDensity (float, ndarray) – eDensity: electron density in \(\mathrm{cm^{-3}}\)
wvlRange (2 element list or ndarray) – wvlRange: range of wavelengths to consider, generally in angstroms
elementList (list) – elementList: list of elements to include, such as ‘fe’, ‘ne’, ‘s’
ionList (list) – ionList: list of ions to include, such as ‘fe_16’, ‘ne_10’
minAbund (float) – minAbund: minimum abundance (relative to H) to include
keepIons (bool) –
keepIons: keep the ion instances used in the calculation
should be used with caution otherwise the bunch instance
can become quite large
em (float, list, ndarray) – em: the emission measure
abundance (str) –
abuncance: the file name of the abuncance set to be used
must be one in the $XUVTOP/abund directory
allLInes (bool) – allLines: whether or not to include unobserved lines
verbose (bool) – verbose: whether to allow certain print statements
the first application of spectrum calculates the line intensities within the specified wavelength
range and for set of ions specified
wavelength will not be used if applied to ‘spectrum’ objects
wavelength IS need for ‘bunch’ objects - in this case, the wavelength should not extend beyond
the limits of the wvlRange used for the ‘bunch’ calculation
Keyword Arguments:
wavelength (‘int’, list) – if an int, the attribute ‘Wavelength’ is looked for
otherwise, wavelength is used
filter (tuple) – first elements if one of the ChiantiPy.tools.filters object
second element is the width appropriate to the filter
label (str) – if set, creates a Spectrum[label] attribute
verbose (bool) – if True, prints info to the terminal
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
Parameters:
temperature (float, list, ndarray) – the temperature(s) in K
eDensity (float, ndarray) – eDensity: electron density in \(\mathrm{cm^{-3}}\)
wavelength (list or ndarray) – wavelength: array of wavelengths, generally in Angstroms
elementList (list) – elementList: list of elements to include, such as ‘fe’, ‘ne’, ‘s’
ionList (list) – ionList: list of ions to include, such as ‘fe_16’, ‘ne_10’
minAbund (float) – minAbund: minimum abundance (relative to H) to include
doLines (`bool1) – doLines: if true, line intensities are calculated
doContinuum (bool) – doContinuum: if true, continuum intensities are calculated only if wavelengths are in angstroms
keepIons (bool) –
keepIons: keep the ion instances used in the calculation
should be used with caution otherwise the bunch instance
can become quite large
em (float, list, ndarray) – em: the emission measure
abundance (str) –
abuncance: the file name of the abuncance set to be used
must be one in the $XUVTOP/abund directory
allLInes (bool) – allLines: whether or not to include unobserved lines
verbose (bool) – verbose: whether to allow certain print statements