-
Notifications
You must be signed in to change notification settings - Fork 3
Small fixes to DiskChopper.from_nexus #649
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
75e9485
use rotation setpoint if available, fix docs link, handle data array …
nvaytet 4351b9d
add method to convert chopper to a dict, making it easy to create a D…
nvaytet 431d180
Merge branch 'main' into chopper-from-nexus
nvaytet be3bbfd
remove use of setpoint and rename 1d to 0d
nvaytet 391913d
Merge branch 'main' into chopper-from-nexus
nvaytet f38aaab
use setpoint, and delay if phase is not present
nvaytet 3df3643
allow both rotation_speed and rotation_speed_setpoint
nvaytet d823a3c
add comment
nvaytet bd22186
add phase tests
nvaytet de80682
Merge branch 'main' into chopper-from-nexus
nvaytet 01340d4
update processing choppers notebook in docs
nvaytet 85f3d42
Merge branch 'main' into chopper-from-nexus
nvaytet 95f8093
Merge branch 'main' into chopper-from-nexus
nvaytet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
So do we trust that whenever there is a setpoint in the file, the rotation speed is constant?
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 guess it depends what we want to use a
DiskChopperfor.If we want to use the logs to filter out events where the choppers were out of phase or something like that, then we want to keep the entire log.
If we want to know thw chopper parameters (e.g. find which tof LUT we want to load) then we just want static parameters.
I had assumed the use case was the latter but maybe that was wrong.
How do we support both in a good way?
Do we need to construct the
DiskChopperif we are doing event filtering, or can we do it by just looking at the NXlogs?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 think it comes down to the domain types in a workflow.
DiskChopperis the actual implementation which should support both use cases. But the workflow has to ensure that the conversion fromRawChopperstoDiskChoppersdoes the right thing. We could clarify this by using a type likeDiskChopperParameterswhich uses the setpoint fromRawChoppers. And we can haveDiskChopperLogsto contain time series for event filtering.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.
But in 'Build DiskChopper', you are not keeping the logs, you are extracting a meaningful frequency from a log a frequencies.
So the
DiskChopperdoesn't support both, it just wants a single value (it even raises an error if the variable has more than 0 dimensions).I guess that's probably what you meant by
Instead of having an automatic conversion where we take the setpoint if available, we leave it to individual workflows to decide how they want to convert from
RawChoppers?I magined comparing chopper setting with the ones in the lookup table would be part of the
GenericTofWorkflow. This would mean that each technique would have to patch the generic workflow with a provider that converts theRawChoppers?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 can be part of the generic workflow. We can have a provider that uses the setpoint by default but can be replaced when necessary.
I wrote the docs long before we had the lut based approach. So this may need to be changed.
Right, then we should use the data group (
RawChoppers) for filtering if that is enough. Or we changeDiskChopperto be more flexible.Uh oh!
There was an error while loading. Please reload this page.
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.
Fine by me. This PR was not addressing filtering, it just wants to construct a chopper from a nexus group.
If a setpoint is present in the group, we use that. If it isn't, we use the rotation_speed and assume/hope that some pre-processing was done beforehand so that it is now a scalar value instead of a log.
If it isn't a scalar, the constructor raises.
Also, maybe
_get_1d_variableshould be renamed to_get_0d_variable?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 agree that filtering is out of scope here. But I don't like a function called
from_nexusto decide internally what data to use. I would expect it to only convert the input data to a new representation. Also, I don't like that it decides whether to use a measured value or a user input. We should be explicit about what we use.Can you add a new function or rename this one to something like
from_nexus_setpoint? And then only look at the setpoint instead of deciding automatically?Makes sense.
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 could. But I also don't like the method that is called
from_nexusthat actually can't read in a nexus group, the rotation speed and the phase need to be pre-processed.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.
Conclusion from in-person discussion: we leave the
rotation_speedas is for now (we don't use the setpoint), until we have more info from ECDC. We may need to do some processing for the phase also as there will not be aphase_setpoint. So we may need a more automatic way of making choppers from nexus logs.I will rename
_get_1d_variableto_get_0d_variable.