Closed quantumsteve closed 8 years ago
@Andrei, @quantumsteve. I have some questions. Is this blocking the move to newer ParaView in any way? Secondly, yes as steve suggests, we can customise MDHistoWorkspace::displayNormalization(). Rather than trying to parse history looking for MDNorm, should we set this property appropriately as part of MDNorm ?
@OwenArnold This is NOT blocking our move to newer ParaView. At the same time, this needs to be addressed before it affects a substantial number of users.
@quantumsteve , @OwenArnold I like the idea of setting the flag as part of MDNorm. Then the default should be none. ConvertToMD should check in the inelastic case if you start from a workspace2D (NumEventsNormalization) or events (NoNormalization)
@AndreiSavici. Ok sounds like a plan. When I get this done I'll assign you as the tester.
@quantumsteve I'll up the priority of this. I'm working on another critical issue at the moment, but I'll put this next in line.
@AndreiSavici. Could you please clarify the rules for this?
> NumEventsNormalization should only be used if the instrument is inelastic
Is this really technique dependent?
> and there is no MDNorm algorithm in the history
Are we just trying to determine if Normalization has already been applied?
@OwenArnold NumEventsNormalization was the only way to get S(Q,w) for inelastic scattering, and it relies on the matrix workspace going into ConvertToMD to be a Workspace2D histogrammed in energy transfer. The number of events in this case is not neutron events, but number of histogram bins corresponding to scattering in a particular Q,w MDBox. If you do diffraction, you measure only S(Q), so no energy transfer. If you use events in the ConvertToMD, the number of events normalization yields always 1 (unless you weighted the events). On a regular grid, the MDNorm algorithms correctly calculate the normalization, so you can measure your S(Q,w) with events (not carry around a lot of empty bins). Even if one measures with histograms in w, the MDNorm yields a similar number to number of events normalization, so you should not normalize twice.
In ConvertToMD:
In the MDNorm Normalization algorithms. Overwrite Normalization type to be None. Already accounts for number of events.
In ConvertToMD check first if the mode is elastic. If yes, set to volume normalization (so you can see Bragg peaks in diffraction). If no, check if input is Workspace2D. If yes, set to # events normalization, else set to no normalization. MDNorm is OK
@andrei. Regarding what you've said above. For diffraction volume normalization is a good idea when you have an MDEventWorkspace (box size varies). When you bin your diffraction workspace to a regular grid MDHistoWorkspace, then volume normalization has no effect other than to uniformly scale the data.
Also, for MDEventWorkspaces shouldn't we always be normalizing by volume? It seems wrong not to take the volume of each voxel into account.
Sorry to be a pain about this, but I want to make sure we agree on the rules for the default.
Steps to complete:
The next task would then be to make the SliceViewer query the displayNormalization of input workspaces and use it to set the default normalization (probably a separate ticket).
Setting NumEventsNormalization for diffraction returns an incorrect result. @AndreiSavici suggests that for MDHistoWorkspace, NumEventsNormalization should only be used if the instrument is inelastic and there is no MDNorm algorithm in the history.
I think the best place to implement this logic is in MDHistoWorkspace::displayNormalization().