Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rebin does not conserve counts for factor < 1 #122

Open
fzeiser opened this issue Apr 15, 2020 · 1 comment
Open

rebin does not conserve counts for factor < 1 #122

fzeiser opened this issue Apr 15, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@fzeiser
Copy link
Collaborator

fzeiser commented Apr 15, 2020

rebin does not conserve counts for factor < 1

>>> a = om.Vector(values=[2,3], E=[4,5])
>>> b = a.rebin(factor=1/4, inplace=False)
>>> a.values.sum()
5.0
>>> b.values.sum()
2.8571428571428648

whereas it works as expected for factor > 1:

>>> c = b.rebin(factor=4, inplace=False)
>>> c.values.sum()
2.857142857142864
@fzeiser fzeiser added the bug Something isn't working label Apr 15, 2020
@fzeiser
Copy link
Collaborator Author

fzeiser commented Apr 15, 2020

I don't think that this is ever used in the code as it is right now, but should be fixed for later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant