aluque / bolos

An open source solver for the Boltzmann equation
45 stars 26 forks source link

Problem reading LXcat data #5

Open Leebre opened 3 years ago

Leebre commented 3 years ago

Hi, I am going through the tutorial for BOLOS here: https://bolos.readthedocs.io/en/latest/tutorial.html

However, it seems to not be reading in the data from LXcat correctly. I have downloaded a zip file from LXcat, which contains a .txt file and a .xml. If I try to use the .txt file with parser.parse, I get the following error:

>>> processes = parser.parse(fp)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sandbox/.local/lib/python3.8/site-packages/bolos/parser.py", line 48, in parse
    d = fread(fp)
  File "/home/sandbox/.local/lib/python3.8/site-packages/bolos/parser.py", line 108, in _read_excitation
    lhs, rhs = [s.strip() for s in RE_ARROW.split(target)]
ValueError: not enough values to unpack (expected 2, got 1)

If I try to parse in the .xml file, no error is reported; however, when I go to do boltzmann.target['N2'].density = 0.8, I get the following:

>>> boltzmann.target['N2'].density = 0.8
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'N2'

also, if I type processes, it just reports empty brackets - [ ].

It seems the data parsing is not working? I am doing something wrong?

arichar6 commented 2 years ago

It is hard to know exactly what is going wrong without knowing which files you downloaded from LXcat. The error that you mentioned (KeyError: 'N2') could occur if the dataset that you downloaded does not contain any cross sections for nitrogen.