PyNeb
1.1.2
PyNeb Reference Manua
|
Functions | |
def | between (array, limits) |
def | z2element (z) |
def | spectroscopic2name |
def | zion2name |
def | zion2dir |
def | zion2filename |
def | zion2localFilename |
def | zion2spectroscopic |
def | convertName (name) |
def | ion2filename (ions) |
def | el2z (els) |
def | qrp (z, u) |
def | splomDescale (splom, energy) |
def | dilute (radius) |
def | eaCross |
def | eaDescale (easplups, temperature) |
def | listFiles (path) |
def | scale_bti (evin, crossin, f, ev1) |
def | descale_bti (bte, btx, f, ev1) |
def | descale_bt (bte, btomega, f, ev1) |
def | scale_bt (evin, omega, f, ev1) |
def | cireclvlRead |
def | defaultsRead |
def | diRead |
def | drRead (ions) |
def | eaRead |
def | easplomRead |
def | elvlcRead |
def | elvlcWrite |
def | fblvlRead |
def | gffRead () |
def | gffintRead () |
def | itohRead () |
def | klgfbRead () |
def | ioneqRead |
def | ipRead |
def | masterListRead () |
def | masterListInfo |
def | photoxRead (ions) |
def | rrRead (ions) |
def | scupsRead |
def | splomRead |
def | splupsRead |
def | twophotonHRead () |
def | twophotonHeRead () |
def | vernerRead () |
def | versionRead () |
def | wgfaRead |
def | wgfaWrite |
Variables | |
list | splups = easplups["splups"] |
print easplups["easplups"][l1,l2] More... | |
tuple | kte = const.boltzmannEv*temperature/(const.ryd2Ev*de) |
int | st = 1 |
tuple | xs = dx*np.arange(nspl) |
tuple | y2 = interpolate.splrep(xs,splups,s=0) |
tuple | sups = interpolate.splev(st,y2,der=0) |
tuple | ups = np.where(ups > 0.,ups,0.) |
Utility functions, many for reading the CHIANTI database files. Copyright 2009, 2010 Kenneth P. Dere This software is distributed under the terms of the GNU General Public License that is found in the LICENSE file
def pyneb.utils._chianti_tools_8.between | ( | array, | |
limits | |||
) |
returns an index array of elements of array where the values lie between the limits given as a 2 element list or tuple
def pyneb.utils._chianti_tools_8.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
def pyneb.utils._chianti_tools_8.convertName | ( | name | ) |
convert ion name string to Z and Ion
def pyneb.utils._chianti_tools_8.defaultsRead | ( | verbose = 0 | ) |
possibleDefaults = {'wavelength':['angstrom', 'kev', 'nm']} symbolDefaults = {'wavelength':['A', 'keV', 'nm']}
def pyneb.utils._chianti_tools_8.descale_bt | ( | bte, | |
btomega, | |||
f, | |||
ev1 | |||
) |
descale BT excitation scaling returns [energy,collision strength]
def pyneb.utils._chianti_tools_8.descale_bti | ( | bte, | |
btx, | |||
f, | |||
ev1 | |||
) |
descale BT ionization scaling returns [energy,cross-section]
def pyneb.utils._chianti_tools_8.dilute | ( | radius | ) |
to calculate the dilution factor as a function distance from the center of a star in units of the stellar radius a radius of less than 1.0 (incorrect) results in a dilution factor of 0.
def pyneb.utils._chianti_tools_8.diRead | ( | ions, | |
filename = 0 |
|||
) |
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
def pyneb.utils._chianti_tools_8.drRead | ( | ions | ) |
read chianti dielectronic recombination .drparams files and return {'rrtype','params','ref'}
def pyneb.utils._chianti_tools_8.eaCross | ( | diparams, | |
easplom, | |||
elvlc, | |||
energy = None , |
|||
verbose = False |
|||
) |
Provide the excitation-autoionization cross section. Energy is given in eV.
def pyneb.utils._chianti_tools_8.eaDescale | ( | easplups, | |
temperature | |||
) |
Calculates the effective collision strengths (upsilon) for excitation-autoionization as a function of temperature. a duplicate of ion.eaDescale()
def pyneb.utils._chianti_tools_8.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}
def pyneb.utils._chianti_tools_8.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
def pyneb.utils._chianti_tools_8.el2z | ( | els | ) |
from an the name of the element (1-2 letter) return Z
def pyneb.utils._chianti_tools_8.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
def pyneb.utils._chianti_tools_8.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. 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
def pyneb.utils._chianti_tools_8.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}
def pyneb.utils._chianti_tools_8.gffintRead | ( | ) |
to read the integrated free-free gaunt factors of Sutherland, 1998, MNRAS, 300, 321.
def pyneb.utils._chianti_tools_8.gffRead | ( | ) |
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
def pyneb.utils._chianti_tools_8.ion2filename | ( | ions | ) |
convert ion string to generic file name string
def pyneb.utils._chianti_tools_8.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
def pyneb.utils._chianti_tools_8.ipRead | ( | verbose = False | ) |
reads the ionization potential file, returns ip array in eV
def pyneb.utils._chianti_tools_8.itohRead | ( | ) |
to read in the free-free gaunt factors of Itoh et al. (ApJS 128, 125, 2000)
def pyneb.utils._chianti_tools_8.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
def pyneb.utils._chianti_tools_8.listFiles | ( | path | ) |
walks the path and subdirectories to return a list of files
def pyneb.utils._chianti_tools_8.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
def pyneb.utils._chianti_tools_8.masterListRead | ( | ) |
read a chianti masterlist file and return a list of ions
def pyneb.utils._chianti_tools_8.photoxRead | ( | ions | ) |
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
def pyneb.utils._chianti_tools_8.qrp | ( | z, | |
u | |||
) |
qrp(Z,u) u = E/IP calculate Qr-prime (equ. 2.12) of Fontes, Sampson and Zhang 1999
def pyneb.utils._chianti_tools_8.rrRead | ( | ions | ) |
read chianti radiative recombination .rrparams files and return {'rrtype','params','ref'}
def pyneb.utils._chianti_tools_8.scale_bt | ( | evin, | |
omega, | |||
f, | |||
ev1 | |||
) |
apply BT excitation scaling to (energy, collision strength) returns [bte,btomega]
def pyneb.utils._chianti_tools_8.scale_bti | ( | evin, | |
crossin, | |||
f, | |||
ev1 | |||
) |
apply BT ionization scaling to (energy, cross-section) returns [bte,btx]
def pyneb.utils._chianti_tools_8.scupsRead | ( | ions, | |
filename = 0 , |
|||
verbose = 0 |
|||
) |
to read the new format ~ version 8 scups file containing the Burgess and Tully scaled temperature and upsilons. Python 2.7/3 compliant
def pyneb.utils._chianti_tools_8.spectroscopic2name | ( | el, | |
roman, | |||
dielectronic = False |
|||
) |
convert Z and ion to spectroscopic notation string
def pyneb.utils._chianti_tools_8.splomDescale | ( | splom, | |
energy | |||
) |
Calculates the collision strength for excitation-autoionization as a function of energy. energy in eV
def pyneb.utils._chianti_tools_8.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
def pyneb.utils._chianti_tools_8.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
def pyneb.utils._chianti_tools_8.twophotonHeRead | ( | ) |
to read the two-photon A values and distribution function for the He seq
def pyneb.utils._chianti_tools_8.twophotonHRead | ( | ) |
to read the two-photon A values and distribution function for the H seq
def pyneb.utils._chianti_tools_8.vernerRead | ( | ) |
Reads the Verner & Yakovlev (A&AS 109, 125, 1995) photoionization cross-section data
def pyneb.utils._chianti_tools_8.versionRead | ( | ) |
read the version number of the CHIANTI database
def pyneb.utils._chianti_tools_8.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'
def pyneb.utils._chianti_tools_8.wgfaWrite | ( | info, | |
outfile = 0 , |
|||
minBranch = 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
def pyneb.utils._chianti_tools_8.z2element | ( | z | ) |
convert Z to element string
def pyneb.utils._chianti_tools_8.zion2dir | ( | z, | |
ion, | |||
dielectronic = False , |
|||
xuvtop = 0 |
|||
) |
convert Z to generic file name string
def pyneb.utils._chianti_tools_8.zion2filename | ( | z, | |
ion, | |||
dielectronic = False , |
|||
xuvtop = 0 |
|||
) |
convert Z to generic file name string
def pyneb.utils._chianti_tools_8.zion2localFilename | ( | z, | |
ion, | |||
dielectronic = False |
|||
) |
convert Z to generic file name string with current directory at top
def pyneb.utils._chianti_tools_8.zion2name | ( | z, | |
ion, | |||
dielectronic = False |
|||
) |
convert Z, ion to generic name 26, 13 -> fe_13
def pyneb.utils._chianti_tools_8.zion2spectroscopic | ( | z, | |
ion, | |||
dielectronic = False |
|||
) |
convert Z and ion to spectroscopic notation string
tuple kte = const.boltzmannEv*temperature/(const.ryd2Ev*de) |
list splups = easplups["splups"] |
print easplups["easplups"][l1,l2]
tuple st = 1 |
tuple ups = np.where(ups > 0.,ups,0.) |
tuple xs = dx*np.arange(nspl) |