icecube / skyllh

https://icecube.github.io/skyllh/
GNU General Public License v3.0
11 stars 5 forks source link

Fix `change_source()` method call performance. #205

Closed tomaskontrimas closed 8 months ago

tomaskontrimas commented 8 months ago

Currently calling https://github.com/icecube/skyllh/blob/fce865d4cf65e6b35b735849624687792446ac8e/skyllh/core/analysis.py#L1715 from kdepdf_mcbg_single_ps analysis takes O(80seconds) as change_source calls https://github.com/icecube/skyllh/blob/fce865d4cf65e6b35b735849624687792446ac8e/skyllh/core/analysis.py#L703 which rebuilds self._detsigyield_service.

This seems unnecessary, as the detsigyield is a two dimensional spline of sin(dec) and fit parameter axes, and the change_source call only changes the source position in dec. Without rebuilding self._detsigyield_service, the change_source call takes miliseconds.

Have to make sure that dataset weights are recalculated correctly for analyses using multiple datasets.