-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use time-of-flight workflow in Dream data reduction #125
Merged
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
fa91262
incorporate tof computation in dream reduction workflow
nvaytet 6ec89f9
start making a wrapper provider
nvaytet ad70023
use the tof workflow in the dream reduction
nvaytet 4f2ef80
start fixing tests
nvaytet 0b57f54
mask zero counts in monitors to avoid infinite values everywhere in d…
nvaytet 85f984d
use nanmin as bin edges can be nan after tof lookup
nvaytet 6b34a2c
update more tests
nvaytet 5d4c819
fix last tests
nvaytet 3150b42
update essreduce version and add tof to deps
nvaytet 2c5aa16
add tof to nightly deps
nvaytet 9a83342
update deps
nvaytet 3bdb149
fix language in notebook
nvaytet 3f83797
add dummy tof provider for powgen to skip the tof workflow step
nvaytet e214f05
fix powgen tests
nvaytet 3c7e826
fix dream notebook
nvaytet 5927e57
add tof where it was missing
nvaytet 7b145e1
make tof a runtime dependency
nvaytet 0164cf9
explain better in assemble data and make it robust to more pulses
nvaytet 5ff4ec8
merge NaN step in workflow and remove dummy provider in powgen
nvaytet f245f0e
remove left over providers from __init__
nvaytet e87d443
fix workflow by removing DetectorData
nvaytet d7c8ec0
start using new version of tof workflow after update
nvaytet e8a3267
use correct choppers and make Ltotal separate for detectors and monitors
nvaytet 95147fb
static analysis
nvaytet ebcefaa
switch to using a filename parameter instead of having to load the ta…
nvaytet a274a34
fix dream geant4 tests
nvaytet b55f608
bump essreduce version
nvaytet bbabb72
merge main branch and update deps to get latest essreduce
nvaytet 6ebbd44
fix init file
nvaytet 7a814df
fix workflow widgets notebook
nvaytet 579d87b
fix metadata stuff from new scippneutron
nvaytet 1e36615
fix orcid_id in tests
nvaytet 55ec664
update type in POWGEN notebook
nvaytet a9bc401
Merge branch 'main' into tof-workflow
nvaytet 017d31c
fix dependency files
nvaytet ead136d
Merge branch 'main' into tof-workflow
nvaytet f2e9894
move notebook to create tof lookup table and add comment about how ta…
nvaytet b134104
Apply suggestions from code review
nvaytet 85597b8
Merge branch 'tof-workflow' of github.com:scipp/essdiffraction into t…
nvaytet 5c4b3f8
Apply automatic formatting
pre-commit-ci-lite[bot] 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 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 |
---|---|---|
|
@@ -262,13 +262,16 @@ def assemble_detector_data( | |
da.bins.coords["tof"] = da.bins.coords["tof"].to(unit="us") | ||
|
||
period = (1.0 / sc.scalar(14.0, unit="Hz")).to(unit="us") | ||
# Bin the data into bins with a 71ms period | ||
da = da.bin(tof=sc.arange("tof", 3) * period) | ||
# Bin the data into bins with a 71ms period. | ||
npulses = int((da.bins.coords["tof"].max() / period).value) | ||
da = da.bin(tof=sc.arange("tof", npulses + 1) * period) | ||
# Add a event_time_zero coord for each bin, but not as bin edges, | ||
# as all events in the same pulse have the same event_time_zero, hence the `[:2]` | ||
# We need to pick a start time. The actual value does not matter. We chose the | ||
# random date of Friday, November 1, 2024 8:40:34.078 | ||
da.coords["event_time_zero"] = ( | ||
sc.scalar(1730450434078980000, unit="ns").to(unit="us") + da.coords["tof"] | ||
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. What is this number? 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. It's a random date in the past. The actual value does not matter. |
||
)[:2] | ||
)[:npulses] | ||
# Remove the meaningless tof coord at the top level | ||
del da.coords["tof"] | ||
da = da.rename_dims(tof="event_time_zero") | ||
|
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 that
npulses
actually is the number of pulses. Without this, I think[:npulses]
below is incorrect.