-
Notifications
You must be signed in to change notification settings - Fork 1
Move the tof lookup table error threshold to the GenericTofWorkflow #313
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
Open
nvaytet
wants to merge
9
commits into
main
Choose a base branch
from
lut-error-threshold
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
42f7a63
move threshold from lut workflow to tof workflow
nvaytet d8b0df4
static analysis
nvaytet bd3bd67
remove error threshold param from lut workflow
nvaytet c2f68fb
remove threshold param from lut workflow test
nvaytet e8145e7
also update workflows in unwrap and wfm tests
nvaytet 2baee4a
fix workflow tests and remove error_threshold also in legacy format
nvaytet e597276
cleanup
nvaytet acc645a
fix docstring
nvaytet e009edc
remove commente code
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,33 +7,34 @@ | |
|
|
||
| from ..nexus import GenericNeXusWorkflow | ||
| from . import eto_to_tof | ||
| from .types import PulseStrideOffset, TofLookupTable, TofLookupTableFilename | ||
| from .types import ( | ||
| LookupTableRelativeErrorThreshold, | ||
| PulseStrideOffset, | ||
| TofLookupTable, | ||
| TofLookupTableFilename, | ||
| ) | ||
|
|
||
|
|
||
| def load_tof_lookup_table( | ||
| filename: TofLookupTableFilename, | ||
| ) -> TofLookupTable: | ||
| def load_tof_lookup_table(filename: TofLookupTableFilename) -> TofLookupTable: | ||
| """Load a time-of-flight lookup table from an HDF5 file.""" | ||
| table = sc.io.load_hdf5(filename) | ||
|
|
||
| # Support old format where the metadata were stored as coordinates of the DataArray. | ||
| # Note that no chopper info was saved in the old format. | ||
| if isinstance(table, sc.DataArray): | ||
| to_be_dropped = { | ||
| "pulse_period", | ||
| "pulse_stride", | ||
| "distance_resolution", | ||
| "time_resolution", | ||
| "error_threshold", | ||
| } & set(table.coords) | ||
| table = { | ||
| "array": table.drop_coords( | ||
| [ | ||
| "pulse_period", | ||
| "pulse_stride", | ||
| "distance_resolution", | ||
| "time_resolution", | ||
| "error_threshold", | ||
| ] | ||
| ), | ||
| "array": table.drop_coords(to_be_dropped), | ||
| "pulse_period": table.coords["pulse_period"], | ||
| "pulse_stride": table.coords["pulse_stride"].value, | ||
| "distance_resolution": table.coords["distance_resolution"], | ||
| "time_resolution": table.coords["time_resolution"], | ||
| "error_threshold": table.coords["error_threshold"].value, | ||
| } | ||
|
|
||
| return TofLookupTable(**table) | ||
|
|
@@ -87,5 +88,6 @@ def GenericTofWorkflow( | |
|
|
||
| # Default parameters | ||
| wf[PulseStrideOffset] = None | ||
| wf[LookupTableRelativeErrorThreshold] = 1.0 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the default be something like |
||
|
|
||
| return wf | ||
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.
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.
Note that the table may or may not have a
error_thresholdcoord. If it does not, trying to remove it usingdrop_coordswould raise. So we filter it out here.