Repository navigation
Conversation
SimonHeybrock
left a comment
There was a problem hiding this comment.
- Can you explain why this fix is instrument specific? Does it work already for the generic workflow, i.e., is it due to a provider this workflow overrides?
- Is
NormalizationMonitorWavelengthBinsto specific? Should there be a singleWavelengthBinsfor all wavelength bins in the workflow? Looking at SANS for example, we want to use the same for monitor and other terms, as they all get combined.
|
| # We should make this function public or move the normalization to ESSreduce. | ||
| from ess.reduce.normalization import _mask_detector_for_norm | ||
|
|
||
| if monitor_wavelength_bins is not None: |
There was a problem hiding this comment.
Please use .is_binned because .bins is None is supposed to get deprecated.
|
But the detectors being normalized doesn't typically have wavelength bins? I mean, the monitor normalization is applied using |
Right. Then I vote for a generic type like in your latest commit. |
| class WavelengthBins(sl.Scope[MonitorType, sc.Variable], sc.Variable): | ||
| """Optional wavelength bin edges for a monitor, shared across run types. |
There was a problem hiding this comment.
Have you checked if this is interoperable with the WavelengthBins used in ess.sans? We should not have two.
There was a problem hiding this comment.
It's not interoperable, as the failing CI showed. I've renamed the generic bins type to MonitorWavelengthBins. It's a bit of a mouthful, but I weren't able to find a good way to re-use the generic WavelengthBins in esssans without it feeling like a hack.
One option would be to rename the sans local type to NormalizationWavelengthBins or similar, that would be more precise anyway, and then we could keep the less precise WavelengthBins name for the generic type. But it would be a breaking change in the esssans package.
There was a problem hiding this comment.
But I'd think the same binning should be used for both, right? If the workflow support using two different binnings then things may go awry.
There was a problem hiding this comment.
I don't see why, can you clarify?
There was a problem hiding this comment.
Because otherwise the monitor would need rebinning, which creates all kinds of weird effects, so unless there is a reason for it, we'd rather avoid it.
| """Monitor data with wavelength coordinate.""" | ||
|
|
||
|
|
||
| class MonitorWavelengthBins(sl.Scope[MonitorType, sc.Variable], sc.Variable): |
There was a problem hiding this comment.
You could also use
| class MonitorWavelengthBins(sl.Scope[MonitorType, sc.Variable], sc.Variable): | |
| class WavelengthBins(sl.Scope[Component, sc.Variable], sc.Variable): |
That would allow any monitor type and detector.
There was a problem hiding this comment.
WavelengthBins collides with a type already defined in esssans, but we can use Component instead of MonitorType
There was a problem hiding this comment.
I'd rather change the more specialised type to use a longer name as that has a smaller impact than the generic name.
There was a problem hiding this comment.
Typically I agree about that. But that would be a breaking change.
There was a problem hiding this comment.
See above, I don't think we should have different wavelength binnings in a workflow, unless there is a clear motivation for it.
Fixes #832