I merge the following data (experiment 20211529):
files 8662 and 8674
Just by looking visually, the error bars are much larger after merging, while obviously they should get smaller when increasing the statistics...
*Created by: rsibille-psi*
I merge the following data (experiment 20211529):
files 8662 and 8674
Just by looking visually, the error bars are much larger after merging, while obviously they should get smaller when increasing the statistics...
@rsibille-psi , true, there is an error in the code (a missing divider), however, thinking a bit more about how the calculation of average in this case should be done properly, it might not be as trivial. Probably, there is a simple way to calculate statistics for neutron counts I'm just not aware of.
After the fix of that issue we would use an average for the number of counts (counts1 + counts2 + ...) / N and sqrt(sigma1^2 + sigma2^2 + ...) / N for the error of that average (currently, dividing by N is missing for sigma). However, for the situation with different sigma values for the same measurement, the direct averaging might not be the most right approach, see for example https://physics.stackexchange.com/a/452809
*Created by: ivan-usov*
@rsibille-psi , true, there is an error in the code (a missing divider), however, thinking a bit more about how the calculation of average in this case should be done properly, it might not be as trivial. Probably, there is a simple way to calculate statistics for neutron counts I'm just not aware of.
After the fix of that issue we would use an average for the number of counts `(counts1 + counts2 + ...) / N` and `sqrt(sigma1^2 + sigma2^2 + ...) / N` for the error of that average (currently, dividing by `N` is missing for `sigma`). However, for the situation with different `sigma` values for the same measurement, the direct averaging might not be the most right approach, see for example https://physics.stackexchange.com/a/452809
thanks!
In our case, we assume (and it's correct unless there is a problem with the instrument motors or temperature etc) that the error is purely statistical on counting, not related to uncertainties.
Therefore we should simply have
counts = (counts1 + counts2 + ...)/N
error = sqrt((counts1 + counts2 + ...)/N)
*Created by: rsibille-psi*
thanks!
In our case, we assume (and it's correct unless there is a problem with the instrument motors or temperature etc) that the error is purely statistical on counting, not related to uncertainties.
Therefore we should simply have
counts = (counts1 + counts2 + ...)/N
error = sqrt((counts1 + counts2 + ...)/N)
OK, but if I understood it correctly, this way will not lead to a statistic improvement. For example, assume we have 2 measurements at the same motor position, both with 100 counts. Each individual measurement will have an error = sqrt(100) = 10, at the same time, based on your formula, their average error = sqrt((100+100)/2) = 10. And this will be true for any number of averaged measurements. Does it make sense to implement it this way?
*Created by: ivan-usov*
OK, but if I understood it correctly, this way will not lead to a statistic improvement. For example, assume we have 2 measurements at the same motor position, both with 100 counts. Each individual measurement will have an `error = sqrt(100) = 10`, at the same time, based on your formula, their `average error = sqrt((100+100)/2) = 10`. And this will be true for any number of averaged measurements. Does it make sense to implement it this way?
I just checked merging exactly the same scans with our old tool "fit", and the results are now exactly the same.
So I think this fix can also go on the main server.
Thank you!
*Created by: rsibille-psi*
I just checked merging exactly the same scans with our old tool "fit", and the results are now exactly the same.
So I think this fix can also go on the main server.
Thank you!
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Created by: rsibille-psi
I merge the following data (experiment 20211529):
files 8662 and 8674
Just by looking visually, the error bars are much larger after merging, while obviously they should get smaller when increasing the statistics...
Created by: ivan-usov
@rsibille-psi , true, there is an error in the code (a missing divider), however, thinking a bit more about how the calculation of average in this case should be done properly, it might not be as trivial. Probably, there is a simple way to calculate statistics for neutron counts I'm just not aware of.
After the fix of that issue we would use an average for the number of counts
(counts1 + counts2 + ...) / Nandsqrt(sigma1^2 + sigma2^2 + ...) / Nfor the error of that average (currently, dividing byNis missing forsigma). However, for the situation with differentsigmavalues for the same measurement, the direct averaging might not be the most right approach, see for example https://physics.stackexchange.com/a/452809Created by: rsibille-psi
thanks!
In our case, we assume (and it's correct unless there is a problem with the instrument motors or temperature etc) that the error is purely statistical on counting, not related to uncertainties.
Therefore we should simply have
counts = (counts1 + counts2 + ...)/N
error = sqrt((counts1 + counts2 + ...)/N)
Created by: ivan-usov
OK, but if I understood it correctly, this way will not lead to a statistic improvement. For example, assume we have 2 measurements at the same motor position, both with 100 counts. Each individual measurement will have an
error = sqrt(100) = 10, at the same time, based on your formula, theiraverage error = sqrt((100+100)/2) = 10. And this will be true for any number of averaged measurements. Does it make sense to implement it this way?Created by: rsibille-psi
sorry.... I positioned the parenthesis wrongly.
it should be:
counts = (counts1 + counts2 + ...)/N
error = sqrt((counts1 + counts2 + ...))/N
Created by: ivan-usov
pyzebra test server is restarted with the fix
Created by: rsibille-psi
thank you Ivan !
Created by: rsibille-psi
I just checked merging exactly the same scans with our old tool "fit", and the results are now exactly the same.
So I think this fix can also go on the main server.
Thank you!
Created by: ivan-usov
The main server is updated and restarted