-
Notifications
You must be signed in to change notification settings - Fork 17
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
Lo L1A Direct Event Refactor #971
Lo L1A Direct Event Refactor #971
Conversation
# The DE index for the entire pointing | ||
pointing_de = 0 | ||
# for each direct event packet in the pointing | ||
for pkt_idx, de_count in enumerate(dataset["count"].values): |
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.
I would prefer for this section to be in a different method - mainly for documentation. Overall it's pretty clear what's happening here, though! Is it possible to loop through the values of DATA_BITS
rather than writing them all out here? You have a lot of dataset["{val}"] = parse_de_bin(dataset, pkt_idx, bit_pos, {val}
that could reduce duplication. The last set of if statements can probably work the same way.
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.
If you do greatly simplify this for loop then it's fine in this method
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.
Agreed. I'll clean this up
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.
LGTM thanks for tidying!
@maxinelasp Thanks! I also just used your looping through the data bits fields idea and it's cleaned up even more now. Thanks for the comment! |
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.
This all looks really good to me.
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.
Really nice tests! Great job generating fake data that you can use for testing in a very deterministic way.
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.
Thanks!
Change Summary
Overview
This PR refactors the Lo L1A Direct Event algorithm from a data class to a function to later make use of the
packets_to_dataset()
. To reduce the PR size, the algorithm isn't yet called by thelo_l1a.py
script. That will be done in a separate PR.Closes #862