Skip to content

Conversation

@jl-wynen
Copy link
Member

Requires scipp/essreduce#286
Fixes #167

Copy link
Member

@SimonHeybrock SimonHeybrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linked issue also talkes about vanadium binning and data binning not matching. As far as I can tell this is not being prevent here, right? Especially for the (typical?) case of scientists wanting to store and reuse processed vanadium from a file.

return {
KeepEvents[SampleRun]: KeepEvents[SampleRun](True),
KeepEvents[VanadiumRun]: KeepEvents[VanadiumRun](False),
KeepEvents[VanadiumRun]: KeepEvents[VanadiumRun](True),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this now required to fix the bug? Does one have to use event mode in both or neither for correct results?

Copy link
Member Author

@jl-wynen jl-wynen Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not required. The fixup PR I made in ESSreduce addresses the histogram mode here. But using a histogram is less precise. In this case, we use lookup to get the monitor values with the bin centres of the detector. If the monitor has a finer binning than the detector, that will lead to ignoring many monitor bins.

Comment on lines 304 to +306
def convert_monitor_to_wavelength(
monitor: TofMonitor[RunType, MonitorType],
graph: MonitorCoordTransformGraph[RunType],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering why we have the graph as a separate provider instead of lining? Seems simple and flexible enough?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we do the same with the detector graph. I figured it's ultimately simplest to keep it symmetric.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it exposes implementation details (using transform_coords) in the compute graph.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that a problem? We seem to be fine with it for the detectors. And it gives a customisation point if we need it.

@jl-wynen
Copy link
Member Author

jl-wynen commented Dec 8, 2025

The linked issue also talkes about vanadium binning and data binning not matching. As far as I can tell this is not being prevent here, right? Especially for the (typical?) case of scientists wanting to store and reuse processed vanadium from a file.

Not the issue I linked. That only mentions monitor bins. Are you referring to #168 ? There are tests in ESSreduce that check that the result is independent of the monitor binning.

@SimonHeybrock
Copy link
Member

The linked issue also talkes about vanadium binning and data binning not matching. As far as I can tell this is not being prevent here, right? Especially for the (typical?) case of scientists wanting to store and reuse processed vanadium from a file.

Not the issue I linked. That only mentions monitor bins. Are you referring to #168 ? There are tests in ESSreduce that check that the result is independent of the monitor binning.

I mean this:

if it is ensured that (1) the vanadium reduction uses the same monitor bin size

Is the new approach addressing this, since it is now not sensitive to the monitor bin size (assuming bin size is reasonable)?

@jl-wynen
Copy link
Member Author

jl-wynen commented Dec 8, 2025

The linked issue also talkes about vanadium binning and data binning not matching. As far as I can tell this is not being prevent here, right? Especially for the (typical?) case of scientists wanting to store and reuse processed vanadium from a file.

Not the issue I linked. That only mentions monitor bins. Are you referring to #168 ? There are tests in ESSreduce that check that the result is independent of the monitor binning.

I mean this:

if it is ensured that (1) the vanadium reduction uses the same monitor bin size

Is the new approach addressing this, since it is now not sensitive to the monitor bin size (assuming bin size is reasonable)?

Correct. The implementation this uses is not sensitive to the monitor binning assuming a sensible binning.

The choppers are now included in the table.
@jl-wynen jl-wynen merged commit dc18103 into main Dec 8, 2025
4 checks passed
@jl-wynen jl-wynen deleted the use-common-monitor-norm branch December 8, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalization by monitor histogram introduces arbitrary scale factors, unless vanadium used same monitor bin size

3 participants