Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last interaction info missing #790

Closed
pfreddy opened this issue Sep 28, 2017 · 4 comments · Fixed by #791
Closed

Last interaction info missing #790

pfreddy opened this issue Sep 28, 2017 · 4 comments · Fixed by #791

Comments

@pfreddy
Copy link
Contributor

pfreddy commented Sep 28, 2017

Hi,
a new error appeared with the latest development version: the GUI starts well, but the widget with the last interaction information doesn't open. Error message is attached below.
There was a similar bug earlier, which is connected to the change from model refrence from Simulation model reference (Issue 690 & 691 & 720), but this error message seems somehow different.

...
File "/home/barna/anaconda3/envs/tardis2/lib/python2.7/site-packages/tardis/analysis.py", line 104, in update_last_interaction_filter
'level_number_upper']].ix[last_line_in_count.index]
...
KeyError: "['atomic_number' 'ion_number' 'level_number_lower' 'level_number_upper'] not in index"

@yeganer
Copy link
Contributor

yeganer commented Oct 1, 2017

@pfreddy I'll have a look next week.

@unoebauer
Copy link
Contributor

Hi @pfreddy. I am currently looking at this problem since also @ssim noticed that the gui is again broken.

The reason seems to be a change in the data frame structure of the line data. While in the old days, the line list had one index, the line_id it now has a multi index, consisting of atomic_number, ion_number, level_number_lower, level_number_upper. This also means, that these values do not appear as data columns in the data frame. However, the gui script expects this.

Note below the change is structure:

Old version, only one index

In [5]: mdl.plasma.atomic_data.lines.iloc[0]
Out[5]: 
wavelength            6.677200e+01
atomic_number         1.400000e+01
ion_number            5.000000e+00
f_ul                  2.703017e-02
f_lu                  4.054525e-02
level_number_lower    0.000000e+00
level_number_upper    3.600000e+01
nu                    4.489793e+16
B_lu                  4.545377e+07
B_ul                  3.030251e+07
A_ul                  4.043917e+10
wavelength_cm         6.677200e-07
Name: 8, dtype: float64

Current version, multi-index

In [53]: mdl.plasma.atomic_data.lines.iloc[0]
Out[53]: 
line_id          6.781300e+04
wavelength       6.677200e+01
f_ul             2.703017e-02
f_lu             4.054525e-02
nu               4.489793e+16
B_lu             4.545377e+07
B_ul             3.030251e+07
A_ul             4.043917e+10
wavelength_cm    6.677200e-07
Name: (14, 5, 0, 36), dtype: float64

@unoebauer
Copy link
Contributor

Update: @wkerzendorf and I will try to fix this tomorrow during our Tardis sprint.

@yeganer
Copy link
Contributor

yeganer commented Oct 6, 2017

@wkerzendorf @unoebauer Sorry for the delay. You are right, the problem arises because of the change in the indexing of atom_data.lines which I did as part of merging the carsus atomic database. The goal was to remove constant re-indexing and to provide a 'standard' format for indexes within tardis.

As I am the one who broke it I'm happy to help you fix it or fix it myself. I think I have most issues fixed in a local branch but I need haven't done any tests because I have to figure out how to start the GUI first :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants