SiLab-Bonn / beam_telescope_analysis

Beam Telescope Analysis (BTA) is a testbeam analysis software written in Python (and C++)
MIT License
5 stars 1 forks source link

BUG: Wrong use of np.resize #28

Closed lschall closed 1 year ago

lschall commented 1 year ago

With commit 9e2289adb14123c3d265935436ec3c9ea110c748 a wrong use of np.resize was implemented. np.resize fills additionally added entries in the new array by repeating elements of the original one (see here). This can lead to wrong histograms in the final step of the analysis. The correct way of resizing in this case is array.resize(shape) as this method complements the original array with zeros (if needed).

leloup314 commented 1 year ago

Nice find!

YannickDieter commented 1 year ago

Thanks for finding this huge bug! I will revert the commit.

YannickDieter commented 1 year ago

Fixed with 7238363. I also decreased the chun ksize during unit testing (f712492) such that this is also now covered by unit tests ;)