# ChiantiPy Tools¶

## ChiantiPy.tools.archival Module¶

Functions for reading pre-v8 CHIANTI files

### Functions¶

 elvlcWrite(info[, outfile, addLvl]) Write Chianti data to .elvlc file. wgfaRead(ions[, filename, elvlcname, total, ...]) Read CHIANTI data from a .wgfa file.

## ChiantiPy.tools.constants Module¶

A set of physical constants, in (mostly) cgs unit system. Most are from [R12].

### References¶

 [R12] NIST Reference on Constants, Units and Uncertainty (link)

### Notes¶

Many of these can be replaced by the constants module. Elemental symbols can be removed in favor of the periodictable module. Spectroscopic roman numerals can be removed in favor of roman module. The Gauss-Laguerre weights can be calculated by laggauss.

## 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.

### Functions¶

 boxcar(wvl, wvl0[, factor]) Box-car filter gaussian(wvl, wvl0[, factor]) A gaussian filter gaussianR(wvl, wvl0[, factor]) A gaussian filter where the gaussian width is given by wvl0/factor. lorentz(wvl, wvl0[, factor]) Lorentz profile filter with the exception that all factors are in wavelength units rather than frequency as the lorentz profile is usually defined. moffat(wvl, wvl0[, factor]) Moffat profile with parameters suited to Chandra Letg spectra

## ChiantiPy.tools.io Module¶

### Functions¶

 abundanceRead([abundancename]) Read abundance file abundancename and return the abundance values relative to hydrogen cireclvlRead(ions[, filename, filetype]) Read Chianti cilvl, reclvl, or rrlvl files and return data convertName(name) Convert ion name string to Z and Ion defaultsRead([verbose]) Read in configuration from .chiantirc file or set defaults if one is not found. diRead(ions[, filename]) Read chianti direct ionization .params files and return data. drRead(ions) Read CHIANTI dielectronic recombination .drparams files eaRead(ions[, filename]) Read a CHIANTI excitation-autoionization file and calculate the EA ionization rate data derived from splupsRead. easplomRead(ions[, filename, extension]) Read CHIANTI splom files for ions. elvlcRead(ions[, filename, getExtended, ...]) Reads the new format elvlc files. elvlcWrite(info[, outfile, addLvl, includeRyd]) Write Chianti data to .elvlc file. fblvlRead(filename[, verbose]) Read a Chianti energy level file gffRead() Read the free-free gaunt factors of [R13]. gffintRead() Read the integrated free-free gaunt factors of [R14]. ioneqRead([ioneqname, verbose]) Reads an ioneq file ipRead([verbose]) Reads the ionization potential file itohRead() Read in the free-free gaunt factors of [R15]. klgfbRead() Read CHIANTI files containing the free-bound gaunt factors for n=1-6 from [R16]. masterListInfo([force, verbose]) Get information about ions in the CHIANTI masterlist. masterListRead() Read a CHIANTI masterlist file. photoxRead(ions) Read CHIANTI photoionization .photox files rrRead(ions) Read CHIANTI radiative recombination .rrparams files scupsRead(ions[, filename, verbose]) Read the new format v8 scups file containing the scaled temperature and upsilons from [R17]. splomRead(ions[, ea, filename]) Read chianti .splom files splupsRead(ions[, filename, filetype]) Read a CHIANTI .splups file twophotonHRead() Read the two-photon Einstein A values and distribution function for the H sequence. twophotonHeRead() Read the two-photon Einstein A values and distribution function for the He sequence. vernerRead() Reads the photoionization cross-section data from [R18]. versionRead() Read the version number of the CHIANTI database wgfaRead(ions[, filename, elvlcname, total, ...]) Read CHIANTI data from a .wgfa file. wgfaWrite(info[, outfile, minBranch]) Write data to a CHIANTI .wgfa file zion2name(z, ion[, dielectronic]) Convert Z and ion to generic name, e.g.

## ChiantiPy.tools.mputil Module¶

Functions needed for standard Python multiprocessing module mspectrum

### Functions¶

 doFbQ(inQ, outQ) Multiprocessing helper for ChiantiPy.core.continuum.freeBound doFfQ(inQ, outQ) Multiprocessing helper for ChiantiPy.core.continuum.freeFree doIonQ(inQueue, outQueue) Multiprocessing helper for ChiantiPy.core.ion and ChiantiPy.core.ion.twoPhoton

## ChiantiPy.tools.sources Module¶

Blackbody temperature calculations

### Functions¶

 blackbody(temperature, variable[, hnu]) 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}$$

### Classes¶

 blackStar(temperature, radius) Calculate blackbody radiation

## ChiantiPy.tools.util Module¶

Utility functions, many for reading the CHIANTI database files.

### Notes¶

Some of these functions can be replaced by roman numeral and periodic table lookup libraries.

### Functions¶

 between(array, limits) Find the indices of array corresponding to values in the range given by limits convertName(name) Convert ion name string (e.g. descale_bt(bte, btomega, f, ev1) Apply excitation descaling of [R19] to energy and collision strength descale_bti(bte, btx, f, ev1) Apply ionization descaling of [R20] to energy and cross-section. dilute(radius) Calculate the dilution factor. el2z(els) Convert elemental symbol to atomic number ion2filename(ions) Convert ion name string to generic directory-file name. listFiles(path) Walks the path and subdirectories to return a list of files. qrp(z, u) Calculate $$Q_R^{\prime}(Z,u)$$, where $$u=\epsilon/I$$ is the impact electron energy in threshold units, from Eq. scale_bt(evin, omega, f, ev1) Apply excitation scaling of [R22] to energy and collision strength. scale_bti(evin, crossin, f, ev1) Apply ionization scaling of [R23] to energy and cross-section. spectroscopic2name(el, roman) Convert from spectroscopic notation, e.g. splomDescale(splom, energy) Calculate the collision strength for excitation-autoionization as a function of energy. z2element(z) Convert atomic number z to its elemental symbol. zion2dir(z, ion[, dielectronic, xuvtop]) Convert atomic number and ion number to CHIANTI database directory. zion2filename(z, ion[, dielectronic, xuvtop]) Convert atomic number and ion number to CHIANTI database filename. zion2localFilename(z, ion[, dielectronic]) Convert atomic number and ion number to generic file name with current directory at top. zion2name(z, ion[, dielectronic]) Convert atomic number and ion number to generic name, e.g. zion2spectroscopic(z, ion[, dielectronic]) Convert atomic number and ion number to spectroscopic notation string