ChiantiPy icon indicating copy to clipboard operation
ChiantiPy copied to clipboard

FileNotFoundError: klgfb.dat'

Open btessore opened this issue 4 years ago • 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

btessore avatar Apr 04 '21 14:04 btessore

I have fixed the problem on the Github page but have not made a new release.

The easiest thing to do might be to remove the line in ChiantiPy/tools/data.py"

Klgfb = chio.klgfbRead()

the file was removed in the last CHIANTI release

hope this helps, Ken


From: Benjamin Tessore @.> Sent: Sunday, April 4, 2021 10:49 AM To: chianti-atomic/ChiantiPy @.> Cc: Subscribed @.***> Subject: [chianti-atomic/ChiantiPy] FileNotFoundError: klgfb.dat' (#305)

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://secure-web.cisco.com/1LehU5zgdfZAbIis_GeYLR-IA4lxCMx_UJLGHtpvXJiS3f6cVyf1eI4Fxzr_BWc3w0BIekl6KolaJT-tzWHglt0-Vz7MXp42km1bzeXowU0k83epR8-4Ji_pTLf_pUgu78OjuYLo1lmDKzCT5IEkA92mDg2yEUV0Wn26fVaCBxkSGvhstA4pB1khqLWbGTZmIeUrDrxhHAEZ7ONIAkemKee3TUj2h-UuNM7lYh5Xm6YFe2B9jSnb6Kkvn8kjsw67ZIxHLD72PoJc_cjmEQ3lpMsBZN1JqxyUHdg76SDPlwSmkfjz7v-eeLK_eIOYddMA8a7hagf3e2ZDhQvKUZ9W_JiQKeAbewuLbt34tP8BwWZvTTtMAf6ytcLPSo3RisCMBv_uW4pQh1v-IA4vBNdnNZGVCBUQm9jILHwdOtytHIF56cyQzg8gLC72mkS2pLNAN/https%3A%2F%2Fgithub.com%2Fchianti-atomic%2FChiantiPy%2Fissues%2F305, or unsubscribe<https://secure-web.cisco.com/168aZNhK0WPL3sUvBUbiCA8znlFn7BDBG8leeq-me53I9z0JUX6d99I8x4HplXnvd4uRXbqDy0SfQ1MxzCFOrWxteYU_wevQVBuzygHemYnZAK3VegQnJJgik3J60TlqCsakxQfeqQqt_0osf3eGfzuhBR3zX7i6pZxovRjJGrOgIADuw_7aMHY7! %20hka9031bfFc1Ew8sZvjtb0QHQBE8gRIQr2gXyJ_lW3zuP9-LWZsZbpqXXWxAGwf44nKKx5AYIrIvbvYjbwyfPSHPf8yc6h4641GEek7uWXN-DYC0JV6GP_apx-U5OsoXCDLSuLRhkqNfBN07yJt9-IilQnQNrkzR3eL-e3Lp_SydhQnf20Ure6nrCMT9Oa2bTnQeDsKerR02y7JgbK_kfLGmXJfbqEcfRnuOj00-gIOCDsNPtRe-5VfiOI-dJN8mPy0CWYvIu/https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAFUQVQTNRZLO35EWIRSZDTTHB4ATANCNFSM42LPFF4A>.

kdere avatar Apr 04 '21 15:04 kdere

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.

btessore avatar Apr 04 '21 15:04 btessore

HI,

the free bound functions are in a bit of flux as the original klgfb file was incorrect. I will look into this. Ken


From: Benjamin Tessore @.> Sent: Sunday, April 4, 2021 11:37 AM To: chianti-atomic/ChiantiPy @.> Cc: Kenneth P Dere @.>; Comment @.> Subject: Re: [chianti-atomic/ChiantiPy] FileNotFoundError: klgfb.dat' (#305)

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://secure-web.cisco.com/10KW57LPdmINlOvFmxFKZG9-61mZc5a0brenekNVoRAc9NciAzszsWNF6sHl7qiWCEKQPwb8XrD9-TbLLjLh4O6TxAl7O31_y4br-ibVSYQLHvjZ3igxU5KVy-OdWFQzp4lkOr0j0-iaCH4F_Bjoe6qTQOD1VBCnG_UGkHqHdnCuGQddMx_wEnYa99KNzOhIzF8Wm8cfg2DJLcKFIfM46sUpCmGHJRi32CwmwmYkO5lSzLPR1ZDRH-TzwWRhJYWsq84x0vb74_4NPVNqeFaOBwOEm6mt5SYimcgHN3MJkA-Lgw6ZpuyXv6vZ4KXfiEagJKjMQ5GFdPzBG4uOtv2SsbFXeTF73PCw35QzdSLi9maQUkLS_KOVvaKgU9BvioEn8RUmB5Qew82KKHGIkwPuk0kcnO8xgmq8RutEQaTNSN5DacWiazVGJ3--1bpxSaifR/https%3A%2F%2Fgithub.com%2Fchianti-atomic%2FChiantiPy%2Fissues%2F305%23issuecomment-813053833, or unsubscribe<https://secure-web.cisco.com/15WCwABk_euAYTb4l6SVLN16PQ2HRrGot4IB8PLuHXqDgfWDRqVza1Dz-NARHilrYDrwzuRyQiB-A7T_HbwifJTtirzxIOyOYStKYxTZZAu4OBtPa5hBG4xXM1YfRb5d_Hgq80GAFfz33Ns0RtaKTFLjmZDGTZ0vbNFUkSuQtphnpE5YpOx! %206y4R0bpWN6HPIda6Hr2lL6JIQvVFGT48mP5yHmmcLzcUEjsXzVBRE6F4U7WBGsHuAFPVUaiW41EJK7qkGlGhyITj8dz42fz0oG_KOMV3SSZp6qE8RtM9mLtD7rzc9GRwKS6QLtjzY8Enqfc8aVXbZVW-Ex5joHr96FVrlVho-torM29L1V8CPKL51EHfq8XB-Y0acqaU3OY8cHduhrLNG9WkrVeRLMqIjY8DzIFQpTyYKOhEPjpne5gdtj__DP-epNuedWjbXoYlHB/https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAFUQVSTTD2AEKTPLNFSMUTTHCBVHANCNFSM42LPFF4A>.

kdere avatar Apr 04 '21 21:04 kdere

Hi, Thank you very much. Benjamin.

btessore avatar Apr 05 '21 05:04 btessore

I have a new freeBoundLoss that does not need this data and will try to get things sorted out and a new release soon. Ken


From: Benjamin Tessore @.> Sent: Monday, April 5, 2021 1:50 AM To: chianti-atomic/ChiantiPy @.> Cc: Kenneth P Dere @.>; Comment @.> Subject: Re: [chianti-atomic/ChiantiPy] FileNotFoundError: klgfb.dat' (#305)

Hi, Thank you very much. Benjamin.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://secure-web.cisco.com/1IkGHjjdQy8U07x7uQeN4wmDqxWv0V7d1-DnI4PU8S8Szhvd3AgjHw7MjywEe6lUtVLtkpeGBLihtzF1MLhIean_zF0Jjznry5XPCSw_1M3Zm_gcPd7638kO2ww5kqQQ-aNzfOLYF1D4QnrEUFU4DM07o3FVH0jnlOEopLkf1BEJ_tz0wSa_YfEmfKwbuuW4oYWHjgbocDvlq7N1aeufEn0csqx4EHbsNppInxkxlI66BSJKv2jXlZOc7cHeiHsASbO-XEZMO8DHJRedDC4W5DsyVGL8PDh4FqHbGODOo0Cnpx4P_vpNgrAPKibjvXd-AF9KR2WVYHmZp3IGH1AqyCf8f45gMitWFgFZotsOdiJjTvMxYNBLcl3diglik3YPTX43yrBNTcK0glDdOSdp93sckIuiba5qZUHpurVp-ABrqWx-q95F2eHChvLQDd5to/https%3A%2F%2Fgithub.com%2Fchianti-atomic%2FChiantiPy%2Fissues%2F305%23issuecomment-813201458, or unsubscribe<https://secure-web.cisco.com/1IJKEUfC9AK53Ny8iOVbl8F1wn-rsraDJ84ABxwfV6iC3qyXfMKk8A364whrlvrlJH6GpNBXb5OLZLq3z3v2ZCAZ6Ule-mX5hPea8ivk4dV9SopadG2tG4taToCw9UL7QIaHymaVwpneEa91qhgn2coWINOoVSOUL1kWxkwEujFmCBKe9Sz! %20jUSIj5tHKvPhH0NgE_vy6c9b_e6RT3Ijw8ZTD1_viFnd93skUAtm_zW2GNTMYLKFdBaiNGFuj23ZWgPUGtV7mZwEzadEVUa6FgQHZIySyU0feNePkSeyUDT-7Fck2OLpv06lemSdb_BvshfOBmlpTJf4-qHAP8SyPGzibwj1UE-Gl2IbWpxThDLysFR4gqwOZNalBKkuPsiHiZ2oG4V7TOv0tWsaUuNZMeP91vLtStE9OJJfzR4oTMP6Ui6yZpq4zUN_3q3tx-2AXA/https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAFUQVX3N4C5BKVTUJCOL2TTHFFSZANCNFSM42LPFF4A>.

kdere avatar Apr 05 '21 13:04 kdere

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

btessore avatar Apr 06 '21 09:04 btessore

Hi Benjamin, thanks for reporting this and other problems. I will try to sort this out soon. regards, Ken


From: Benjamin Tessore @.> Sent: Tuesday, April 6, 2021 5:21 AM To: chianti-atomic/ChiantiPy @.> Cc: Kenneth P Dere @.>; Comment @.> Subject: Re: [chianti-atomic/ChiantiPy] FileNotFoundError: klgfb.dat' (#305)

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://secure-web.cisco.com/1pcUL9TUnyiylwFeUVnYoltS9DTPQi7Jq2ur-MxVQAL8xHVPTZyskG9VHL-KBCjIhZOiYI2GezBowHjal2591I1l2aROzigf7H3fEioxz_8TQi8vAaQAnOSs8wpkbkDbmSjgpiiBjm3pcIcoHgdp407Z8jLOdHO9fuT_jageQW8WVDDPwLO7XskNaFehoXLj0tFzGOYNNsAVERZvwRB3BU39VF4Rsuw4Eu_AdLgZp_fZf4LDnlW4mxFf9S7_NO52RHQpDwaFhyliZkTilH_sipMzIwxbFKbU2Jb2LLRBYxEiDxQ509Um4NwTmpZkrSLbzDbDy7_xY74mdweRBFT8snRwSo2pHxSGWJ5Ows8JLI92NXXNTRceKFathm0cTVEIhpvJaSkcumla8yUGYnXakuoE7omrCF-1OI2MKwyPEXgKXyRZ9p5dhbrGRLFsta1UT/https%3A%2F%2Fgithub.com%2Fchianti-atomic%2FChiantiPy%2Fissues%2F305%23issuecomment-813969428, or unsubscribe<https://secure-web.cisco.com/1BFm2kwwHJ9_J1Go3-54l0_y9axj30cmjFaxARQxC7NNsMKI5XalhpruBsPjwJGbkemK7873FFKErFl2_qs0GG5cc3evi3zFs0Vue5zgJOvBkf4uTcX0AfE_vcX7tIDWyKd_QbxflUMUXaqlycTr4g3AoFa3hreNG3C4q1Pkb-5_88YXbU5! %20G3srqTqPuv5v5RkJ9HiH5d69j2ZkUEp2Lb88dZDblJstlR9y6go9M1dzCioUXoKqufBzgVBZpxv5NjcMhKv-9JENoNMMwiI91x4DYInAZNqbsR232jxCrT0iSLhg_4D-DtY4kjin5KtK4n16gy-5xbZKDbxPmhlZQTH--xyFrBWFqljak-x0al2mQskPfHqZ4hMR7ToNmpS4pPx80hRJdpDovEtoFDYcjruZ-nO8GWySnLh4PN0y7zHhtnjBWFIxfRohFrJT8ff2Y3/https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAFUQVVRBMXJLONXJKVXU2DTHLG77ANCNFSM42LPFF4A>.

kdere avatar Apr 06 '21 13:04 kdere

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

kdere avatar Apr 06 '21 14:04 kdere

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

btessore avatar Apr 06 '21 14:04 btessore

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

kdere avatar Apr 06 '21 14:04 kdere

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

btessore avatar Apr 06 '21 15:04 btessore

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

btessore avatar Apr 13 '21 06:04 btessore

The units look OK to me. The continuum should not depend on the density. Ken

kdere avatar Apr 13 '21 14:04 kdere