-
Notifications
You must be signed in to change notification settings - Fork 2
[ESSSPECTROSCOPY] Source the BIFROST Bragg peak monitor from the NXmonitor #698
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
base: main
Are you sure you want to change the base?
Changes from all commits
0cabb8d
475730b
4216af2
0dbb973
4b93824
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,13 @@ def detector_wavelength_data( | |
| :func:`ess.reduce.unwrap.detector_wavelength_data` | ||
| for different input types. | ||
| """ | ||
| # A time-dependent detector position (BIFROST's tank rotates, and the Bragg peak | ||
| # monitor is mounted on it) makes ``ltotal`` depend on 'time'. The instrument angle | ||
| # is the only dynamic parameter, so ``group_by_rotation`` has already turned that | ||
| # same 'time' dimension into 'a4'. Rename to match, or the broadcast below rejects | ||
| # ``ltotal`` as having a dimension the data does not. | ||
| if 'time' in ltotal.dims and 'time' not in sample_data.dims: | ||
| ltotal = ltotal.rename_dims(time='a4') | ||
|
Member
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. Is Can we instead compute |
||
| return reduce_unwrap.to_wavelength.detector_wavelength_data( | ||
| detector_data=RawDetector[RunType](sample_data), | ||
| lookup=lookup, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| ) | ||
|
|
||
| from ess.reduce import unwrap as reduce_unwrap | ||
| from ess.reduce.nexus.types import NeXusName | ||
|
|
||
| from ..cutting import group_by_rotation | ||
| from ..io import nexus | ||
|
|
@@ -30,7 +31,7 @@ | |
| _SIMULATION_PROVIDERS = ( | ||
| *nexus.providers, | ||
| *conversion.providers, | ||
| *detector.providers, | ||
| *detector.simulation_providers, | ||
| *q_map.providers, | ||
| *time_of_flight.providers, | ||
| convert_simulated_time_to_event_time_offset, | ||
|
|
@@ -45,6 +46,12 @@ def BifrostBraggPeakMonitorWorkflow() -> sciline.Pipeline: | |
| ) | ||
| # Use the vanilla implementation instead of the indirect geometry one: | ||
| workflow.insert(reduce_unwrap.to_wavelength.detector_wavelength_data) | ||
| # The Bragg peak monitor sees the direct beam, so its flight path is a straight | ||
|
Member
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 does 'direct beam' mean here? It is not the transmitted beam.
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. Meant direct from sample, not going through the analyzer.
Member
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. Can you adjust the comment so that this doesn't get confused with the definition in SANS? |
||
| # line rather than the analyzer-folded path of the inelastic detectors. | ||
| workflow.insert( | ||
| reduce_unwrap.to_wavelength.detector_ltotal_from_straight_line_approximation | ||
| ) | ||
| workflow[NeXusName[ElasticMonitor]] = 'elastic_monitor' | ||
| for provider in _PROVIDERS: | ||
| workflow.insert(provider) | ||
| for key, val in default_parameters().items(): | ||
|
|
@@ -59,6 +66,12 @@ def BifrostSimulationBraggPeakMonitorWorkflow() -> sciline.Pipeline: | |
| ) | ||
| # Use the vanilla implementation instead of the indirect geometry one: | ||
| workflow.insert(reduce_unwrap.to_wavelength.detector_wavelength_data) | ||
| # The Bragg peak monitor sees the direct beam, so its flight path is a straight | ||
| # line rather than the analyzer-folded path of the inelastic detectors. | ||
| workflow.insert( | ||
| reduce_unwrap.to_wavelength.detector_ltotal_from_straight_line_approximation | ||
| ) | ||
| workflow[NeXusName[ElasticMonitor]] = 'elastic_monitor' | ||
| for provider in _SIMULATION_PROVIDERS: | ||
| workflow.insert(provider) | ||
| for key, val in simulation_default_parameters().items(): | ||
|
|
||
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.
'cmb5 doesn't really have a meaning in ESSspectroscopy. Can you mention that it is called 'elastic_monitor' in files?