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

Attempt to fix up the GUI #765

Merged
merged 6 commits into from
Jul 14, 2017
Merged

Attempt to fix up the GUI #765

merged 6 commits into from
Jul 14, 2017

Conversation

ssim
Copy link
Contributor

@ssim ssim commented Jul 13, 2017

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.

ssim added 2 commits July 13, 2017 11:43
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.
Copy link
Contributor

@unoebauer unoebauer left a 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.

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]]

Copy link
Contributor

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

@unoebauer
Copy link
Contributor

I'll try to submit a PR with a proper masking

@unoebauer
Copy link
Contributor

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)
@unoebauer unoebauer requested a review from wkerzendorf July 14, 2017 09:58
@ssim
Copy link
Contributor Author

ssim commented Jul 14, 2017

This is of relevance to #690 and replaces #720.

@wkerzendorf
Copy link
Member

@ssim @unoebauer - great work!

@wkerzendorf wkerzendorf merged commit bf0f34d into tardis-sn:master Jul 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants