ChiantiPy.tools package¶
Submodules¶
ChiantiPy.tools.archival module¶
Functions for reading pre-v8 CHIANTI files
-
ChiantiPy.tools.archival.
elvlcRead
(ions, filename=0, verbose=0, useTh=0)[source] [edit on github]¶ read a chianti energy level file and returns {“lvl”:lvl,”conf”:conf,”term”:term,”spin”:spin,”l”:l,”spd”:spd,”j”:j ,”mult”:mult,”ecm”:ecm,”eryd”:eryd,”ecmth”:ecmth,”erydth”:erydth,”ref”:ref,”pretty”:pretty, ‘ionS’:ions} if a energy value for ecm or eryd is zero(=unknown), the theoretical values (ecmth and erydth) are inserted
-
ChiantiPy.tools.archival.
elvlcWrite
(info, outfile=None, addLvl=0)[source] [edit on github]¶ Write Chianti data to .elvlc file.
Parameters: info :
dict
Information about the Chianti data to write. Should contain the following keys: ionS, the Chianti style name of the ion such as c_4 conf, an integer denoting the configuration - not too essential term, a string showing the configuration spin, an integer of the spin of the state in LS coupling l, an integer of the angular momentum quantum number spd, an string for the alphabetic symbol of the angular momemtum, S, P, D, etc j, a floating point number, the total angular momentum ecm, the observed energy in inverse cm, if unknown, the value is 0. eryd, the observed energy in Rydbergs, if unknown, the value is 0. ecmth, the calculated energy from the scattering calculation, in inverse cm erydth, the calculated energy from the scattering calculation in Rydbergs ref, the references in the literature to the data in the input info
outfile :
str
Output filename. ionS+’.elvlc’ (in current directory) if None
addLvl :
int
Add a constant value to the index of all levels
See also
ChiantiPy.tools.io.elvlcWrite
- Write .elvlc file using the new format.
Notes
For use with files created before elvlc format change in November 2012
-
ChiantiPy.tools.archival.
wgfaRead
(ions, filename=None, elvlcname=-1, total=False, verbose=False)[source] [edit on github]¶ Read CHIANTI data from a .wgfa file.
Parameters: ions :
str
Ion, e.g. ‘c_5’ for C V
filename :
str
Custom filename, will override that specified by
ions
elvlcname :
str
If specified, the lsj term labels are returned in the
pretty1
andpretty2
keys ofWgfa
total :
bool
Return the level 2 avalue data in
Wgfa
verbose :
bool
Returns: Wgfa :
dict
Information read from the .wgfa file. The dictionary structure is {“lvl1”,”lvl2”,”wvl”,”gf”,”avalue”,”ref”,”ionS”,”filename”}
See also
ChiantiPy.tools.io.wgfaRead
- Read .wgfa file with the new format.
Notes
This is text-wise not different than the v8 version except that it uses the archival elvlcRead in
archival
though this has now been commented out. Can this routine be removed? Should the elvlcRead routine be uncommented?
ChiantiPy.tools.constants module¶
A set of physical constants, in (mostly) cgs unit system. Most are from [R60].
ChiantiPy.tools.data module¶
Module for collecting various top-level Chianti data
Descriptions for keywordArgs
:
temperature
: temperature (in K)eDensity
: electron density (in \(\mathrm{cm}^{-3}\))hDensity
: hydrogen density (in \(\mathrm{cm}^{-3}\))pDensity
: proton density (in \(\mathrm{cm}^{-3}\))radTemperature
: radiation temperature of central source (in K)rStar
: distance of the plasma from the source (in units of the source’s radius)distance
: distance from the central source
ChiantiPy.tools.filters module¶
Line profile filters for creating synthetic spectra.
-
ChiantiPy.tools.filters.
boxcar
(wvl, wvl0, factor=None)[source] [edit on github]¶ Box-car filter
Parameters: wvl :
ndarray
Wavelength array
wvl0 :
float64
Wavelength filter should be centered on.
factor :
float64
Full width of the box-car filter
-
ChiantiPy.tools.filters.
gaussian
(wvl, wvl0, factor=1.0)[source] [edit on github]¶ A gaussian filter
Parameters: wvl :
ndarray
Wavelength array
wvl0 :
float64
Wavelength filter should be centered on.
factor :
float64
Gaussian width
integrated value is unity
-
ChiantiPy.tools.filters.
gaussianR
(wvl, wvl0, factor=1000.0)[source] [edit on github]¶ A gaussian filter where the gaussian width is given by
wvl0
/factor
.Parameters: wvl :
ndarray
Wavelength array
wvl0 :
float64
Wavelength filter should be centered on.
factor :
float64
Resolving power
-
ChiantiPy.tools.filters.
lorentz
(wvl, wvl0, factor=1.0)[source] [edit on github]¶ Lorentz profile filter with the exception that all factors are in wavelength units rather than frequency as the lorentz profile is usually defined.
Parameters: wvl :
ndarray
Wavelength array
wvl0 :
float64
Wavelength filter should be centered on.
factor :
float64
Value of the so-called constant gamma
integrated value is unity
the FWHM is 2*gamma
.. math::
L = frac{1}{pi gamma} frac{ gamma^2}{(lambda - lambda_0)^2 + gamma^2}
-
ChiantiPy.tools.filters.
moffat
(wvl, wvl0, factor=2.5)[source] [edit on github]¶ Moffat profile with parameters suited to Chandra Letg spectra
Parameters: wvl :
ndarray
Wavelength array
wvl0 :
float64
Wavelength the filter is centered on.
factor :
float64
Resolving power (TODO: correct description)
-
ChiantiPy.tools.filters.
voigt
(wvl, wvl0, factor=(0.5, 1.0))[source] [edit on github]¶ pseudo-Voigt filter the sum of a Gaussian and a Lorentzian
Parameters: wvl :
ndarray
Wavelength array
wvl0 :
float64
Wavelength the filter is centered on.
factor: array-type
contains the following 2 parameters
A :
float64
relative size of gaussian and lorentz components must be between 0. and 1. but this is not currently checked
sigma: `~numpy.float64`
the gaussian width of the gaussian profile (the standard deviation) also creates the lorentz component with the same fwhm
ChiantiPy.tools.io-2017-5-7 module¶
ChiantiPy.tools.io module¶
Reading and writing functions
-
ChiantiPy.tools.io.
abundanceRead
(abundancename='')[source] [edit on github]¶ Read abundance file
abundancename
and return the abundance values relative to hydrogen
-
ChiantiPy.tools.io.
autoRead
(ions, filename=None, total=True, verbose=False)[source] [edit on github]¶ Read CHIANTI autoionization rates from a .auto file.
Parameters: ions :
str
Ion, e.g. ‘c_5’ for C V
filename :
str
Custom filename, will override that specified by
ions
elvlcname :
str
If specified, the lsj term labels are returned in the ‘pretty1’ and ‘pretty2’ keys of ‘Wgfa’ dict
total :
bool
Return the summed level 2 autoionization rates in ‘Auto’
verbose :
bool
Returns: Auto :
dict
Information read from the .wgfa file. The dictionary structure is {“lvl1”, “lvl2”, “avalue”, “pretty1”, “pretty2”, “ref”,”ionS”, “filename”}
-
ChiantiPy.tools.io.
autoWrite
(info, outfile=None, minBranch=None)[source] [edit on github]¶ Write data to a CHIANTI .wgfa file
Parameters: info :
dict
Should contain the following: ionS, the Chianti style name of the ion such as c_4 for C IV, lvl1, the lower level, the ground level is 1, lvl2, the upper level, wvl, the wavelength (in Angstroms), avalue, the autoionization rate, pretty1, descriptive text of the lower level (optional), pretty2, descriptive text of the upper level (optiona), ref, reference text, a list of strings
outfile :
str
minBranch :
float64
The transition must have a branching ratio greater than the specified to be written to the file
-
ChiantiPy.tools.io.
cireclvlRead
(ions, filename=None, filetype='cilvl')[source] [edit on github]¶ Read Chianti cilvl, reclvl, or rrlvl files and return data
Parameters: ions :
str
Ion, e.g. ‘c_5’ for C V
filename :
str
, optionalCustom filename, will override that specified by
ions
filetype :
str
{‘cilvl’, ‘reclvl’, ‘rrlvl’} Type of the file to read
-
ChiantiPy.tools.io.
convertName
(name)[source] [edit on github]¶ Convert ion name string to Z and Ion and other interesting info
Parameters: name :
str
a generic name of an ion in the CHIANTI database, such as fe_14 for Fe XIV
Notes
A duplicate of the routine in
ChiantiPy.tools.util
but needed by masterList Info TODO: Put in separate module to avoid multiple copies
-
ChiantiPy.tools.io.
defaultsRead
(verbose=False)[source] [edit on github]¶ Read in configuration from .chiantirc file or set defaults if one is not found.
-
ChiantiPy.tools.io.
diRead
(ions, filename=None)[source] [edit on github]¶ Read chianti direct ionization .params files and return data.
Parameters: ions :
str
Ion, e.g. ‘c_5’ for C V
filename :
str
, optionalCustom filename, will override that specified by
ions
-
ChiantiPy.tools.io.
drRead
(ions, filename=None)[source] [edit on github]¶ Read CHIANTI dielectronic recombination .drparams files if filename is set, then reads that file
-
ChiantiPy.tools.io.
eaRead
(ions, filename=None)[source] [edit on github]¶ Read a CHIANTI excitation-autoionization file and calculate the EA ionization rate data derived from splupsRead.
Parameters: ions :
str
Ion, e.g. ‘c_5’ for C V
filename :
str
, optionalCustom filename, will override that specified by
ions
-
ChiantiPy.tools.io.
elvlcRead
(ions, filename=None, getExtended=False, verbose=False, useTh=True)[source] [edit on github]¶ Reads the new format elvlc files.
Parameters: ions :
str
Ion, e.g. ‘c_5’ for C V
filename :
str
, optionalCustom filename, will override that specified by
ions
getExtended :
bool
verbose :
bool
useTh :
bool
If True, the theoretical values (ecmth and erydth) are inserted when an energy value for ecm or eryd is zero(=unknown)
-
ChiantiPy.tools.io.
elvlcWrite
(info, outfile=None, round=0, addLvl=0, includeRyd=False, includeEv=False)[source] [edit on github]¶ Write Chianti data to .elvlc file.
Parameters: info :
dict
Information about the Chianti data to write. Should contain the following keys: ionS, the Chianti style name of the ion such as c_4 term, a string showing the configuration spin, an integer of the spin of the state in LS coupling l, an integer of the angular momentum quantum number spd, an string for the alphabetic symbol of the angular momemtum, S, P, D, etc j, a floating point number, the total angular momentum ecm, the observed energy in inverse cm, if unknown, the value is 0. eryd, the observed energy in Rydbergs, if unknown, the value is 0. ecmth, the calculated energy from the scattering calculation, in inverse cm erydth, the calculated energy from the scattering calculation in Rydbergs ref, the references in the literature to the data in the input info
outfile :
str
Output filename. ionS+’.elvlc’ (in current directory) if None
round :
int
input to `np.round’ to round input values to maintain the correct number of significant figures
addLvl :
int
Add a constant value to the index of all levels
includeRyd :
bool
If True, write the Rydberg energies in the extended area, delimited by a comma
includeEv :
bool
If True, write the energies in eV in the extended area, delimited by a comma
See also
ChiantiPy.tools.archival.elvlcWrite
- Write .elvlc file using the old format.
Notes
For use with files created after elvlc format change in November 2012
-
ChiantiPy.tools.io.
fblvlRead
(ions, filename=None, verbose=False)[source] [edit on github]¶ Read a Chianti energy level file for calculating the free-bound continuum
-
ChiantiPy.tools.io.
gffRead
()[source] [edit on github]¶ Read the free-free gaunt factors of [R61].
Notes
This function reads the file and reverses the values of g2 and u
References
[R61] (1, 2) Sutherland, R. S., 1998, MNRAS, 300, 321
-
ChiantiPy.tools.io.
gffintRead
()[source] [edit on github]¶ Read the integrated free-free gaunt factors of [R62].
References
[R62] (1, 2) Sutherland, R. S., 1998, MNRAS, 300, 321
-
ChiantiPy.tools.io.
ioneqRead
(ioneqname='', minIoneq=1e-20, verbose=False)[source] [edit on github]¶ Reads an ioneq file ionization equilibrium values less then minIoneq are returns as zeros Returns ——- {‘ioneqname’,’ioneqAll’,’ioneqTemperature’,’ioneqRef’} :
dict
Ionization equilibrium values and the reference to the literature
-
ChiantiPy.tools.io.
ipRead
(verbose=False)[source] [edit on github]¶ Reads the ionization potential file
Returns: ip : array-like
Ionization potential (in eV)
-
ChiantiPy.tools.io.
itohRead
()[source] [edit on github]¶ Read in the free-free gaunt factors of [R63].
References
[R63] (1, 2) Itoh, N. et al., 2000, ApJS, 128, 125
-
ChiantiPy.tools.io.
klgfbRead
()[source] [edit on github]¶ Read CHIANTI files containing the free-bound gaunt factors for n=1-6 from [R64].
Returns: {‘pe’, ‘klgfb’} :
dict
Photon energy and the free-bound gaunt factors
References
[R64] (1, 2) Karzas and Latter, 1961, ApJSS, 6, 167
-
ChiantiPy.tools.io.
masterListInfo
(force=False, verbose=False)[source] [edit on github]¶ Get information about ions in the CHIANTI masterlist.
Returns: masterListInfo :
dict
{‘wmin’, ‘wmax’, ‘tmin’, ‘tmax’} Minimum and maximum wavelengths in the wgfa file. Minimum and maximum temperatures for which the ionization balance is nonzero.
Notes
This function speeds up multi-ion spectral calculations. The information is stored in a pickled file ‘masterlist_ions.pkl’ If the file is not found, one will be created.
-
ChiantiPy.tools.io.
masterListRead
()[source] [edit on github]¶ Read a CHIANTI masterlist file.
Returns: masterlist :
list
All ions in Chianti database
-
ChiantiPy.tools.io.
photoxRead
(ions)[source] [edit on github]¶ Read CHIANTI photoionization .photox files
Returns: {‘lvl1’, ‘lvl2’, ‘energy’, ‘cross’, ‘ref’} :
dict
Energy (in Rydbergs) and cross section (in \(\mathrm{cm}^{-2}\))
Notes
The photox files are not in any released version of the CHIANTI database.
-
ChiantiPy.tools.io.
rrLossRead
()[source] [edit on github]¶ to read the Mao 2017 rr loss parameters
References
[R65] Mao J., Kaastra J., Badnell N.R., 2017 Astron. Astrophys. 599, A10
-
ChiantiPy.tools.io.
rrRead
(ions, filename=None)[source] [edit on github]¶ Read CHIANTI radiative recombination .rrparams files
Returns: {‘rrtype’,’params’,’ref’} : dict
-
ChiantiPy.tools.io.
scupsRead
(ions, filename=None, verbose=False)[source] [edit on github]¶ Read the new format v8 scups file containing the scaled temperature and upsilons from [R66].
Parameters: ions :
str
Ion, e.g. ‘c_5’ for C V
filename :
str
, optionalCustom filename, will override that specified by
ions
verbose :
bool
References
[R66] (1, 2) Burgess, A. and Tully, J. A., 1992, A&A, 254, 436
-
ChiantiPy.tools.io.
splomRead
(ions, ea=False, filename=None)[source] [edit on github]¶ Read chianti .splom files
Parameters: ions :
str
Ion, e.g. ‘c_5’ for C V
ea :
bool
Read .easplom file
filename :
str
, optionalCustom filename, will override that specified by
ions
Returns: {‘lvl1’, ‘lvl2’, ‘ttype’, ‘gf’, ‘deryd’, ‘c’, ‘splom’, ‘ref’} :
dict
Notes
Still needed for ionization cross sections
-
ChiantiPy.tools.io.
splupsRead
(ions, filename=None, filetype='splups')[source] [edit on github]¶ Read a CHIANTI .splups file
Parameters: ions :
str
Ion, e.g. ‘c_5’ for C V
filename :
str
, optionalCustom filename, will override that specified by
ions
filetype :
str
, optional{
psplups
,`cisplups`,`splups`} Type of file to readReturns: {‘lvl1’, ‘lvl2’, ‘ttype’, ‘gf’, ‘de’, ‘cups’, ‘bsplups’, ‘ref’} :
dict
-
ChiantiPy.tools.io.
trRead
(ionS)[source] [edit on github]¶ read the files containing total recombination rates .trparams
-
ChiantiPy.tools.io.
twophotonHRead
()[source] [edit on github]¶ Read the two-photon Einstein A values and distribution function for the H sequence.
Returns: {‘y0’, ‘z0’, ‘avalue’, ‘asum’, ‘psi0’} : dict
-
ChiantiPy.tools.io.
twophotonHeRead
()[source] [edit on github]¶ Read the two-photon Einstein A values and distribution function for the He sequence.
Returns: {‘y0’, ‘avalue’, ‘psi0’} : dict
-
ChiantiPy.tools.io.
vernerRead
()[source] [edit on github]¶ Reads the photoionization cross-section data from [R67].
Returns: {‘pqn’,’l’,’eth’,’e0’,’sig0’,’ya’,’p’, yw’} :
dict
pqn
is the principal quantum number,l
is the subshell orbital quantum number,eth
(in eV) is the subshell ionization threshold energy;sig0
,ya
,p
, andyw
are all fit parameters used in calculating the total photoionization cross-section.References
[R67] (1, 2) Verner & Yakovlev, 1995, A&AS, 109, 125
-
ChiantiPy.tools.io.
versionRead
()[source] [edit on github]¶ Read the version number of the CHIANTI database
-
ChiantiPy.tools.io.
wgfaRead
(ions, filename=None, elvlcname=0, total=False, verbose=False)[source] [edit on github]¶ Read CHIANTI data from a .wgfa file.
Parameters: ions :
str
Ion, e.g. ‘c_5’ for C V
filename :
str
Custom filename, will override that specified by
ions
elvlcname :
str
If specified, the lsj term labels are returned in the ‘pretty1’ and ‘pretty2’ keys of ‘Wgfa’ dict
total :
bool
Return the summed level 2 avalue data in ‘Wgfa’
verbose :
bool
Returns: Wgfa :
dict
Information read from the .wgfa file. The dictionary structure is {“lvl1”,”lvl2”,”wvl”,”gf”,”avalue”,”ref”,”ionS”,”filename”}
See also
ChiantiPy.tools.archival.wgfaRead
- Read .wgfa file with the old format.
-
ChiantiPy.tools.io.
wgfaWrite
(info, outfile=None, minBranch=1e-05, rightDigits=4)[source] [edit on github]¶ Write data to a CHIANTI .wgfa file
Parameters: info :
dict
Should contain the following keys: ionS, the Chianti style name of the ion such as c_4 for C IV, lvl1, the lower level, the ground level is 1, lvl2, the upper level, wvl, the wavelength (in Angstroms), gf,the weighted oscillator strength, avalue, the A value, pretty1, descriptive text of the lower level (optional), pretty2, descriptive text of the upper level (optiona), ref, reference text, a list of strings
outfile :
str
minBranch :
float64
The transition must have a branching ratio greater than the specified minBranchto be written to the file
-
ChiantiPy.tools.io.
zion2name
(z, ion, dielectronic=False)[source] [edit on github]¶ Convert
Z
andion
to generic name, e.g. 26, 13 -> fe_13Parameters: z :
int
the nuclear charge, for example 26 for Fe XIV
ion :
int
the ion stage, for example, 14 for Fe XIV
Notes
A duplicate of the routine in
ChiantiPy.tools.util
but needed by masterList Info TODO: Put in separate module to avoid multiple copies
ChiantiPy.tools.mputil module¶
Functions needed for standard Python multiprocessing module mspectrum
-
ChiantiPy.tools.mputil.
doFbQ
(inQ, outQ)[source] [edit on github]¶ Multiprocessing helper for
ChiantiPy.core.continuum.freeBound
Parameters: inQ :
Queue
Ion free-bound emission jobs queued up by multiprocessing module
outQ :
Queue
Finished free-bound emission jobs
-
ChiantiPy.tools.mputil.
doFfQ
(inQ, outQ)[source] [edit on github]¶ Multiprocessing helper for
ChiantiPy.core.continuum.freeFree
Parameters: inQ :
Queue
Ion free-free emission jobs queued up by multiprocessing module
outQ :
Queue
Finished free-free emission jobs
-
ChiantiPy.tools.mputil.
doIonQ
(inQueue, outQueue)[source] [edit on github]¶ Multiprocessing helper for
ChiantiPy.core.ion
andChiantiPy.core.ion.twoPhoton
Parameters: inQueue :
Queue
Jobs queued up by multiprocessing module
outQueue :
Queue
Finished jobs
ChiantiPy.tools.sources module¶
Blackbody temperature calculations
-
class
ChiantiPy.tools.sources.
blackStar
(temperature, radius)[source] [edit on github]¶ Bases:
object
Calculate blackbody radiation
Parameters: temperature :
ndarray
Temperature in Kelvin
radius :
ndarray
Stellar radius in cm
Attributes
Temperature ( ndarray
) Temperature in KelvinRadius ( ndarray
) Stellar radius in cmIncident ( ndarray
) Blackbody photon distribution-
incident
(distance, energy)[source] [edit on github]¶ Calculate photon distribution times the visible cross-sectional area.
Parameters: distance :
ndarray
Distance to the stellar object in cm
energy :
ndarray
Energy range in erg
Notes
This function returns the photon distribution instead of the distribution times the cross-sectional area. Is this correct? Why is the incident photon distribution calculated at all?
-
-
ChiantiPy.tools.sources.
blackbody
(temperature, variable, hnu=1)[source] [edit on github]¶ Calculate the blackbody photon distribution as a function of energy (
hnu
= 1) or as a function of wavelength (hnu
= 0) in units of \(\mathrm{photons}\,\mathrm{cm}^{-2}\,\mathrm{s}^{-1}\,\mathrm{str}^{-1}\,\mathrm{erg}^{-1}\)Parameters: temperature :
float64
Temperature at which to calculate the blackbody photon distribution
variable :
ndarray
Either energy (in erg) or wavelength (in angstrom)
hnu :
int
If 1, calculate distribution as a function of energy. Otherwise, calculate it as a function of wavelength
Returns: {‘photons’, ‘temperature’, ‘energy’} or {‘photons’, ‘temperature’, ‘wvl’} :
dict
ChiantiPy.tools.util module¶
Utility functions
Notes¶
Some of these functions can be replaced by roman numeral and periodic table lookup libraries. some functions using os.walk can be replaced by os.path
-
ChiantiPy.tools.util.
between
(array, limits)[source] [edit on github]¶ Find the indices of
array
corresponding to values in the range given bylimits
Parameters: array : ‘list` or ~numpy.ndarray`
-
ChiantiPy.tools.util.
convertName
(name)[source] [edit on github]¶ Convert ion name string (e.g. ‘fe_13’) to atomic number and ion number
Parameters: name :
str
Returns: {‘Z’, ‘Ion’, ‘Dielectronic’, ‘Element’, ‘higher’, ‘lower’} :
dict
higher
andlower
are the Chianti-style names for the higher and lower ionization stages, respectively.
-
ChiantiPy.tools.util.
descale_bt
(bte, btomega, f, ev1)[source] [edit on github]¶ Apply excitation descaling of [R68] to energy and collision strength
Parameters: bte : array-like
Scaled energy
btomega : array-like
Scaled collision strength
f : array-like
ev1 : array-like
Returns: [energy,omega] :
list
Descaled energy and collision strength
See also
scale_bt
- Apply scaling to excitation energy and cross-section
Notes
Need more details here. Not clear which equations are being used.
References
[R68] (1, 2) Burgess, A. and Tully, J. A., 1992, A&A, 254, 436
-
ChiantiPy.tools.util.
descale_bti
(bte, btx, f, ev1)[source] [edit on github]¶ Apply ionization descaling of [R69] to energy and cross-section.
Parameters: bte : array-like
Scaled energy
btx : array-like
Scaled cross-section
f : float
Scaling parameter
ev1 : float
ionization potential - units determine the output energy units
Returns: [energy,cross] :
list
Descaled energy and cross-section
See also
scale_bti
- Descale ionization energy and cross-section
Notes
This is the scaling used and discussed in the Dere (2007) calculation [1] of cross sections. It was derived from similar scalings provided by reference [2]
References
[R69] (1, 2) Dere, K. P., 2007, A&A, 466, 771, [R70] Burgess, A. and Tully, J. A., 1992, A&A, 254, 436
-
ChiantiPy.tools.util.
dilute
(radius)[source] [edit on github]¶ Calculate the dilution factor.
Parameters: radius : array-like
Distance from the center of a star in units of the stellar radius.
Notes
If
radius
is less than 1.0, returns 0.
-
ChiantiPy.tools.util.
el2z
(els)[source] [edit on github]¶ Convert elemental symbol to atomic number
-
ChiantiPy.tools.util.
ion2filename
(ions)[source] [edit on github]¶ Convert ion name string to generic directory-file name. convertName has probably made this redundant
-
ChiantiPy.tools.util.
listFiles
(path)[source] [edit on github]¶ Walks the path and subdirectories to return a list of files.
Notes
This can be replaced by functions in
os.path
.
-
ChiantiPy.tools.util.
qrp
(z, u)[source] [edit on github]¶ Calculate \(Q_R^{\prime}(Z,u)\), where \(u=\epsilon/I\) is the impact electron energy in threshold units, from Eq. 2.12 of [R71].
Parameters: z :
int
Atomic number
u : array-like
Impact electron energy in threshold units.
Returns: q : array-like
1s ionization cross-section, \(Q_R^{\prime}(Z,u)\)
Notes
Used for calculations of direct ionization cross-sections of the H and He sequences in
ChiantiPy.tools.io.twophotonHRead
andChiantiPy.tools.io.twophotonHeRead
, respectively.References
[R71] (1, 2) Fontes, C. et al., 1999, PhRvA, 59, 1329
-
ChiantiPy.tools.util.
scale_bt
(evin, omega, f, ev1)[source] [edit on github]¶ Apply excitation scaling of [R72] to energy and collision strength.
Parameters: evin : array-like
omega : array-like
f : array-like
ev1 : array-like
Returns: [bte,btomega] :
list
Scaled energy and collision strength
See also
descale_bt
- Descale excitation energy and cross-section
Notes
Need more details here. Not clear which equations are being used.
References
[R72] (1, 2) Burgess, A. and Tully, J. A., 1992, A&A, 254, 436
-
ChiantiPy.tools.util.
scale_bt_rate
(inDict, ip, f=1.7)[source] [edit on github]¶ Apply ionization descaling of [R73], a Burgess-Tully type scaling to ionization rates and temperatures. The result of the scaling is to return a scaled temperature between 0 and 1 and a slowly varying scaled rate as a function of scaled temperature. In addition, the scaled rates vary slowly along an iso-electronic sequence.
Parameters: inDict :
dict
the input dictionary should have the following key pairs:
temperature
, array-like andrate
, array-likeip :
float
the ionization potential in eV.
f :
float
(optional)the scaling parameter, 1.7 generally works well
Notes
btTemperature
andbtRate
keys are added toinDict
References
[R73] (1, 2) Dere, K. P., 2007, A&A, 466, 771
-
ChiantiPy.tools.util.
scale_bti
(evin, crossin, f, ev1)[source] [edit on github]¶ Apply ionization scaling of [R74],[R75]_ to energy and cross-section.
Parameters: evin : float
Energy - same units as ev1
crossin : array-like
Cross-section
f : float - the scale factor
ev1 : float
the ionization potential units - the same as evin
Returns: [bte,btx] :
list
Scaled energy and cross-section
See also
descale_bti
- Descale ionization energy and cross-section
Notes
This is the scaling used and discussed in the Dere (2007) calculation [1] of cross sections. It was derived from similar scalings derived in reference [2]
References
[R74] (1, 2) Dere, K. P., 2007, A&A, 466, 771, [R75] Burgess, A. and Tully, J. A., 1992, A&A, 254, 436
-
ChiantiPy.tools.util.
scale_classical
(inDict, ip)[source] [edit on github]¶ to apply the ‘classical’ scaling to the input data
Parameters: inDict: dictionary
- the input dictionary should have the following key pairs
energy and cross or temperature and rate
energy: array-like
energy values of the cross-section
cross: array-like
a cross-section
temperature: array-like
rate: array-like
ip: float
the ionization potential. Typically in eV.
Returns
the following keys are added to inDict
——-
{‘csEnergy’, ‘csCross’, ‘ip’} or {‘csTemperature’, ‘csRate’, ‘ip’}
-
ChiantiPy.tools.util.
spectroscopic2name
(el, roman)[source] [edit on github]¶ Convert from spectroscopic notation, e.g. Fe XI to ‘fe_11’
Parameters: el :
str
Elemental symbol, e.g. Fe for iron
roman :
str
Roman numeral spectroscopic symbol
-
ChiantiPy.tools.util.
splomDescale
(splom, energy)[source] [edit on github]¶ Calculate the collision strength for excitation-autoionization as a function of energy.
Parameters: energy : array-like
In eV
splom :
dict
Structure returned by
ChiantiPy.tools.io.splomRead
Returns: omega : array-like
Collision strength
-
ChiantiPy.tools.util.
z2element
(z)[source] [edit on github]¶ Convert atomic number
z
to its elemental symbol.
-
ChiantiPy.tools.util.
zion2dir
(z, ion, dielectronic=False, xuvtop='')[source] [edit on github]¶ Convert atomic number and ion number to CHIANTI database directory.
Parameters: z :
int
ion :
int
dielectronic :
bool
, optionalxuvtop :
str
, optionalSet different CHIANTI database than the default
-
ChiantiPy.tools.util.
zion2filename
(z, ion, dielectronic=False, xuvtop='')[source] [edit on github]¶ Convert atomic number and ion number to CHIANTI database filename.
Parameters: z :
int
ion :
int
dielectronic :
bool
, optionalxuvtop :
str
, optionalSet different CHIANTI database than the default
-
ChiantiPy.tools.util.
zion2localFilename
(z, ion, dielectronic=False)[source] [edit on github]¶ Convert atomic number and ion number to generic file name with current directory at top.
Parameters: z :
int
ion :
int
dielectronic :
bool
, optional
Module contents¶
Basic tools and utilities used in ChiantiPy