FileNotFoundError: klgfb.dat'
Closed this issue · 13 comments
I've successfully installed ChantiPy from github. I've unpacked the data from chianti website in "chianti_data/v10.0.1", where $XUVTOP points to.
Don't know exactly if it is a problem from the data or from the python distribution.
When I'm loading ChiantiPy in an ipython environment I get the error message:
import ChiantiPy.core as ch
Traceback (most recent call last):
File "/Users/name/Documents/python/ChiantiPy/ChiantiPy/tools/data.py", line 61, in
Klgfb = chio.klgfbRead()
File "/Users/name/Documents/python/ChiantiPy/ChiantiPy/tools/io.py", line 965, in klgfbRead
input = open(fname)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/name/Documents/chianti_data/v10.0.1/continuum/klgfb.dat'
In my data folder I don't have any klgfb.data file in the continuum subdirectory (while the others klgfb_n.dat are present).
Thank you in advance,
Benjamin
Hi, thank you for your prompt response,
unfortunately, it seems that the variable klgfb is used elsewhere, in particular in continuum.py/freeBoundLoss. The error is obtained by trying a calculation of radiative loss with ch.radLoss(). It is therefore a bit risky for me to modify all occurrences without breaking the code.
Benjamin.
Hi,
Thank you very much.
Benjamin.
Hi, thank you for the update !
I don't know if you are still working on it or not (I saw the new version this morning). Now the code stops after about a few minute because "AttributeError: 'continuum' object has no attribute 'FreeBoundLoss'".
I don't know if you want me to continue to report the possible errors, in any case thanks a lot for your handling of the problem.
Cheers,
Benjamin
Hi Benjamin,
I tried the following:
si14cont = ch.continuum('si_14', temp)
si14cont.freeBoundLoss(includeAbund=True, includeIoneq=True, verbose=1)
si14cont.FreeBoundLoss.keys()
and it worked.
can you send me some lines of code to see what happened?
thanks,
Ken
Tahnk you,
I tried your few lines of code and it worked.
si14cont.FreeBoundLoss.keys()
Out[8]: dict_keys(['rate', 'gfIntSum', 'gfInt', 'gfGL', 'egl', 'scaledE', 'peAll', 'gfAll', 'gfIntAllSum'])
the problem appears with the following:
import ChiantiPy.core as ch
import numpy as np
import matplotlib.pyplot as plt
temp = 10.**(4.+0.05*np.arange(81))
rl = ch.radLoss(temp, 1.e+4, minAbund=2.e-5)
(It takes some times before the error appears by the way)
The error message is then:
AttributeError Traceback (most recent call last)
in
----> 1 rl = ch.radLoss(temp, 1.e+4, minAbund=2.e-5)~/Documents/python/ChiantiPy/ChiantiPy/core/RadLoss.py in init(self, temperature, eDensity, elementList, ionList, minAbund, doContinuum, abundance, verbose, allLines, keepIons)
141 cont = continuum(akey, temperature, abundance=abundance)
142 cont.freeBoundLoss()
--> 143 if 'errorMessage' not in cont.FreeBoundLoss.keys():
144 freeBoundLoss += cont.FreeBoundLoss['rate']
145 if 'line' in self.Todo[akey]:AttributeError: 'continuum' object has no attribute 'FreeBoundLoss'
Cheers,
Ben
HI Benjamin,
the calculation blows up when trying to do the FBLoss for fe_2. This is because the fe_2.fblvl file does not exist.
the immediate fix is to remove the fe_2 ion from the masterlist.ions in /XUVTOP/masterlist
otherwise, I will try to create one.
regards,
Ken
Hi,
I removed the fe_2 line at the end of the file. But the problem is still there unfortunatelly.
Perhaps they are other ions to remove ?
Cheers,
Ben
Hi Ken,
a short update before closing the report.
First thank you for your help.
I was able to do a calculation of radiative loss + intensity for various densities and temperatures with and without lines for a broad range of wavelengths.
The value of the radiative loss as a function of T is retrieved with a frequency and angle integration of the intensity (ch.spectrum()['Intensity']).
Not yet familiar with all the units and convention in the X rays domain, but I'm assuming that the unit of the returned intensity is unit of emissivity per ne and per nH if em is not provided or (erg/s/cm2/sr/AA * cm5).
Also, I might have not understood yet all the definitions, but the intensity seems independent of the value of ne if we only consider continua.
Thanks again,
cheers,
Benjamin
The units look OK to me. The continuum should not depend on the density.
Ken