HeloiseS / hoki

Bridging the gap between observation and theory
https://heloises.github.io/hoki/intro.html
BSD 3-Clause "New" or "Revised" License
47 stars 8 forks source link

Correct time interval for first bin #24

Closed maxbriel closed 4 years ago

maxbriel commented 4 years ago

The first bin in BPASS_TIME_INTERVALS only ran from 10$^{5.95}$ to 10$^{6.05}$, while it should run from 0 till 10$^{6.05}$. By first transforming the bins into edges in linear space, $t=0.0$ can be included and the proper interval is found for the first bin.

maxbriel commented 4 years ago

Further inspection shows that the tests fail because the model probability distributions have changed with the new binning. The initial bin now contain significantly more years and, therefore, the _apply_time_weighting function of the HRDDiagram weights the first bin heavier than before. Since these are manually tested, this changes is not shown in the test_hrddiagrams. Similarly, the CMD object/calculations are manually tested and therefore the changes in these are also not tested. Although a different weighting scheme is used, the CMD objects probability should also be affected by the change of the initial bin.

Although, it is the correct binning, this makes the first bins probability contribute significantly more than before. It is not enough to overtake the best fitting age in the test cases, but this can be problematic in edge cases. Currently, the weighting of bins is the number of years in each bin. Is this really the correct way to weight the bins?

To make sure this binning is correct, I performed a cross check with the bin intervals calculated by BPASS. These agree with the new bins.

maxbriel commented 4 years ago

After a discussion today, we have decided to keep the bins as they are (equally spaced logarithmically).

While the true initial bin size is the correct version, it causes the probability of the first bin to increase significantly, while in reality the chance for a star to be in the first $10^6$ is small. It overtakes the other ages in probability due to its size. Thus, we fudge the first bin by using the equally spaced log bins. This makes the probability of the initial bin proportional to the other bins. This information should be mentioned in the documentation and an issue has been made for it.