Closed SimonHeybrock closed 1 year ago
Maybe the main question may be plotting: If we do not store variances, users would not see error bars in their plots. Unless @nvaytet thinks that we could change plopp
(or provide a convenient option) to automatically show errors for data with unit "counts".
I think having special handling of counts units is not a good idea, that's how we ended up doing strange things with the resampling mechanism. As you say, the variances on counts are just something we set by hand, when loading the counts data, it is not there in the data file. And they can be computed later.
Someone, not in neutron science, might want to have counts without variances, why should they suddenly see errorbars on their plot? Which is probably why you mention a convenience method, but I think the convenience method should just be
data.variances = data.data
Probably something like this could work:
da.hist(x=1000) \
.set_uncertainties() \
.plot()
?
I think for now we should move the decision to a higher level: scippnexus should not create variance. Instead loaders in scippneutron or ess
may choose to do so, if this is considered more convenient by users.
After scipp/scipp#2895, broadcasting of variances will no longer be supported. This implies that the "standard" paradigm of handling uncertainties will not be feasible any more. This further implies that there is limited use to carrying uncertainties of "counts", since uncertainties can simply be computed later on.
We should therefore consider avoiding the overhead of creating variances for the weights when an
NXdetector
withNXevent_data
is loaded. This would save both memory and compute resources.