Package chianti :: Module io
[hide private]
[frames] | no frames]

Module io

source code

a collection of reading and writing functions seems to be Python 2.7 and Python 3.4 compatible

Functions [hide private]
 
abundanceRead(abundancename='')
read an abundanc file and returns the abundance values relative to hydrogen
source code
 
cireclvlRead(ions, filename=0, cilvl=0, reclvl=0, rrlvl=0)
to read Chianti cilvl and reclvl files and return data must specify type as either cilvl, reclvl or rrlvl
source code
 
convertName(name)
convert ion name string to Z and Ion a duplicate of teh routine in util but needed by masterList Info
source code
 
defaultsRead(verbose=0)
possibleDefaults = {'wavelength':['angstrom', 'kev', 'nm']} symbolDefaults = {'wavelength':['A', 'keV', 'nm']}
source code
 
diRead(ions, filename=0)
read chianti direct ionization .params files and return...
source code
 
drRead(ions)
read chianti dielectronic recombination .drparams files and return...
source code
 
eaRead(ions, filename=0)
read a chianti excitation-autoionization file and return the EA ionization rate data derived from splupsRead {"lvl1":lvl1,"lvl2":lvl2,"ttype":ttype,"gf":gf,"de":de,"cups":cups,"bsplups":bsplups,"ref":ref}
source code
 
easplomRead(ions, filename=0, extension='.splom')
read chianti splom files and returns {"lvl1":lvl1,"lvl2":lvl2,"deryd":de,"gf":gf,"eryd":eout,"omega":omout} currently only works for 5 point spline fit files splomRead probably does just as good a job - this function may be redundant
source code
 
elvlcRead(ions, filename=0, getExtended=0, verbose=0, useTh=1)
reads the new format elvlc files read a chianti energy level file that has 6 energy columns 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, "ecmx":ecmx,"erydx":erydx,"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 if useTh is true Python 2.7 and 3 compliant
source code
 
elvlcWrite(info, outfile=0, addLvl=0, includeRyd=0)
for files created after elvlc format change in November 2012 creates a .elvlc in the current directory info is a dictionary that must 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.
source code
 
fblvlRead(filename, verbose=0)
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,"ref":ref}
source code
 
gffRead()
to read the free-free gaunt factors of Sutherland, 1998, MNRAS, 300, 321.
source code
 
gffintRead()
to read the integrated free-free gaunt factors of Sutherland, 1998, MNRAS, 300, 321.
source code
 
ioneqRead(ioneqname='', verbose=0)
reads an ioneq file and stores temperatures and ionization equilibrium values in self.IoneqTemperature and self.Ioneq and returns a dictionary containing these value and the reference to the literature
source code
 
ipRead(verbose=False)
reads the ionization potential file, returns ip array in eV
source code
 
itohRead()
to read in the free-free gaunt factors of Itoh et al.
source code
 
klgfbRead()
to read CHIANTI files file containing the free-bound gaunt factors for n=1-6 from Karzas and Latter, 1961, ApJSS, 6, 167 returns {pe, klgfb}, the photon energy and the free-bound gaunt factors
source code
 
masterListInfo(force=0, verbose=0)
returns information about ions in masterlist the reason for this file is to speed 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 and the following information returned for each ion wmin, wmax : the minimum and maximum wavelengths in the wgfa file tmin, tmax : the minimum and maximum temperatures for which the ionization balance is nonzero for pickle compatibility between Python 2 and 3, have used floats
source code
 
masterListRead()
read a chianti masterlist file and return a list of ions
source code
 
photoxRead(ions)
read chianti photoionization .photox files and return...
source code
 
rrRead(ions)
read chianti radiative recombination .rrparams files and return...
source code
 
scupsRead(ions, filename=0, verbose=0)
to read the new format ~ version 8 scups file containing the Burgess and Tully scaled temperature and upsilons.
source code
 
splomRead(ions, ea=0, filename=None)
read chianti .splom files and return {"lvl1":lvl1,"lvl2":lvl2,"ttype":ttype,"gf":gf,"deryd":de,"c":c,"splom":splomout,"ref":hdr} still needed for ionization cross sections
source code
 
splupsRead(ions, filename=0, prot=0, ci=0, diel=0)
read a chianti splups file and return {"lvl1":lvl1,"lvl2":lvl2,"ttype":ttype,"gf":gf,"de":de,"cups":cups,"bsplups":bsplups,"ref":ref} if prot >0, then reads the psplups file if ci > 0, then reads cisplups file if diel > 0, then reads dielsplups file
source code
 
twophotonHRead()
to read the two-photon A values and distribution function for the H seq
source code
 
twophotonHeRead()
to read the two-photon A values and distribution function for the He seq
source code
 
vernerRead()
Reads the Verner & Yakovlev (A&AS 109, 125, 1995) photoionization cross-section data
source code
 
versionRead()
read the version number of the CHIANTI database
source code
 
wgfaRead(ions, filename=0, elvlcname=-1, total=0, verbose=0)
reads chianti wgfa file and returns {"lvl1":lvl1,"lvl2":lvl2,"wvl":wvl,"gf":gf,"avalue":avalue,"ref":ref} if elvlcname is specified, the lsj term labels are returned as 'pretty1' and 'pretty2'
source code
 
wgfaWrite(info, outfile=0, minBranch=0.0)
to write a wgfa file info is a dictionary the contains the following elements 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 minBranch: the transition must have a branching ratio greater than the specified to be written to the file
source code
 
zion2name(z, ion, dielectronic=False)
convert Z, ion to generic name 26, 13 -> fe_13 a duplicate of teh routine in util but needed by masterList Info
source code
Variables [hide private]
  __package__ = 'chianti'
Function Details [hide private]

diRead(ions, filename=0)

source code 

read chianti direct ionization .params files and return
    {"info":info,"btf":btf,"ev1":ev1,"xsplom":xsplom,"ysplom":ysplom,"ref":hdr}
    info={"iz":iz,"ion":ion,"nspl":nspl,"neaev":neaev}
cannot read dilvlparams files

drRead(ions)

source code 

read chianti dielectronic recombination .drparams files and return
    {'rrtype','params','ref'}
    

elvlcWrite(info, outfile=0, addLvl=0, includeRyd=0)

source code 

for files created after elvlc format change in November 2012 creates a .elvlc in the current directory info is a dictionary that must 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

the output filename will be ionS+'.elvlc' unless outfile is specified addLvl is to add a constant value to the index of all levels setting includeRyd will also write the Rydberg energies in the extended area, demarked by a comma

gffRead()

source code 

to read the free-free gaunt factors of Sutherland, 1998, MNRAS, 300, 321. this function reads the file and reverses the values of g2 and u

itohRead()

source code 

to read in the free-free gaunt factors of Itoh et al. (ApJS 128, 125, 2000)

photoxRead(ions)

source code 

read chianti photoionization .photox files and return
    {"energy", "cross"} where energy is in Rydbergs and the
    cross section is in cm^2
    the photox files are not in any released version of the CHIANTI database

rrRead(ions)

source code 

read chianti radiative recombination .rrparams files and return
    {'rrtype','params','ref'}

scupsRead(ions, filename=0, verbose=0)

source code 

to read the new format ~ version 8 scups file containing the Burgess and Tully scaled temperature and upsilons. Python 2.7/3 compliant