-
Notifications
You must be signed in to change notification settings - Fork 275
Open
Labels
Description
Describe the bug
I want to soon implement support arbitrary shaped shower distributions, and noticed this when looking at the data: the histogram is returned as a float32 array from TableLoader.read_simulation_distrubution() which could lead to a wrong flux if not careful. Note that so far, what is used in the code to date is not affected, but this could cause errors in the future if updates are made.
To Reproduce
Steps to reproduce the behavior:
print("A:", int(dist["histogram"].sum()))
print("B:", dist["n_entries"].sum())
print("C:", dist["histogram"].astype(np.int64).sum())A: 17773303808
B: 17774000000
C: 17774000000
As can be seen, case A gives he wrong answer, which could lead to an incorrect flux measurement. In th currnt code we use case B.
Expected behavior
histogram entries should be stored as integers, and summing should work as expected with no floating point rounding errors.