ChiantiPy icon indicating copy to clipboard operation
ChiantiPy copied to clipboard

Problem with ipymspectrum

Open svaberg opened this issue 6 years ago • 2 comments

Hi Ken and all,

Using the current revision of ChiantiPy the ipymspectrum class is not working for me. Following the example in the Quick Start

temp = [1.e+6, 2.e+6]
dens = 1.e+9
wvl = 200. + 0.05*np.arange(2001)
emeasure = [1.e+27 ,1.e+27]
s = ch.ipymspectrum(temp, dens, wvl, filter = (chfilters.gaussian,.2), em = emeasure, doContinuum=1, minAbund=1.e-5, verbose=0)
plt.figure
plt.plot(wvl, s.Spectrum['integrated'])

I get the following error

~/Documents/PHD/sw_tools/ChiantiPy/ChiantiPy/core/IpyMspectrum.py in __init__(self, temperature, eDensity, wavelength, filter, label, elementList, ionList, minAbund, keepIons, doLines, doContinuum, allLines, em, abundance, verbose, timeout)
    249                         else:
    250                             for iTempDen in range(self.NTempDen):
--> 251                                 twoPhoton[iTempDen] += tp['rate'][iTempDen]
    252                 else:
    253                     if 'errorMessage' in sorted(thisIon.Intensity.keys()):

KeyError: 'rate'

Does this happen for you as well?

If you are interested, I could write a couple of automated tests for ChiantiPy, just based on the example codes in the documentation. Would you be interested to integrate them in the project?

Best wishes, Dag

svaberg avatar Jun 15 '19 02:06 svaberg

I was kind of expecting that. I am sure it is due to the problems created by using only numpy arrays internally. I will look at that. mspectrum and bunch probably have similar problems. thanks for letting me know. Ken

kdere avatar Jun 15 '19 14:06 kdere

Yes, if you wanted to write a couple of automated test that would be great. We already have some written by Will Barnes but they are not complete. I usually do a pytest by hand. Travis CI requires that the entire database be downloaded and that often led to a time out.

kdere avatar Jun 16 '19 14:06 kdere