-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Attempt to fix up the GUI #765
Conversation
Much of the work here done by Mark Magee, some by Stuart Sim. Beware: pragmatism and empirical approaches used in several places: functionality may appear to be restored but some minor alterations may have occurred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the selection of the wavelength window which is investigated is based on self.last_line_interaction_angstrom
, we have to assign to it the LF wavelength of packets after the last interaction. Thus, we have to use output_nus
However, we also have to apply some additional masking, since all packet diagnostic arrays contain the information of all packets in the current Tardis version. This means in particular, that packet which are backscattered or never interaction contribute to the query.
tardis/analysis.py
Outdated
self.last_line_in = self.lines.ix[self.last_line_interaction_in_id[packet_filter]] | ||
self.last_line_out = self.lines.ix[self.last_line_interaction_out_id[packet_filter]] | ||
self.last_line_in = self.lines.iloc[self.last_line_interaction_in_id[packet_filter]] | ||
self.last_line_out = self.lines.iloc[self.last_line_interaction_out_id[packet_filter]] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we have to use ix
since we want to get the line with a certain ID back and the lines dataframe is indexed by these IDs. The reason why in your trials idx
did not work but iloc
did is because you did not properly mask out the non-interacting or purely e-scattering packets. Thus, many packets have a -1
as line ID (which simply means no line interaction performed). ix
fails in this case, since there is no line with ID -1 in the data frame. iloc
simply returns the last element in the data frame (some line with a very long wavelength). But of course, this is not a line which contributes to the wavelength window in question.
Once a proper masking is implemented, ix
can be safely used again
I'll try to submit a PR with a proper masking |
I've made changes to the GUI to mask out non-line interacting packets. I've tested the GUI with my changes on tardis_example and it works. |
Introduce proper masking for GUI (addition to PR tardis-sn#765)
@ssim @unoebauer - great work! |
This is an attempt to fix up the GUI to work with the current TARDIS version.
Much of the work here was done by Mark Magee, with SAS helping.
The approach to getting things working has been empirical / pragmatic - an attempt to replace cases where information has been moved around. In some cases this may have led to small changes in functionality.
@unoebauer @chvogl It would be appreciated if someone can check how the "lines" objects are been accessed (via iloc) - it appears to work but the indexing was not completely obvious.