Implement CutoffPowerLaw Fluxes with public data#242
Conversation
…inheriting from PL model leads to wrong signal event distributions
|
Seems like there is an error in the integration when the cutoff is too low. Not sure where it is breaking yet. Full traceback: It occurs on the public data with the source: |
|
Thanks Steve. I don't think this is related to the integration, but to the values used to create the interpolated signal energy PDF. The PChipInterpolator is quite peaky with the input values it can take. I have run into this issue already in the past, and it might already be fixed in the new data release branch. I'll have a look today |
|
Good news. I have found that the issue is related to the quad integration failing for very small values of the integral skyllh/skyllh/core/flux_model.py Lines 816 to 817 in 14b5485 Possibly easily solved by replacing that integration with something like numpy.trapz on log energies (using log energies should also improve numerical stability since we're moving across 7 orders of magnitude) |
chiarabellenghi
left a comment
There was a problem hiding this comment.
This looks good after the flux integral fix and can be merged.
|
Thanks Chiara. Looks good from me too. Should I merge now or wait for someone else to do so? |
|
Go ahead and merge @ssclafani949 :) |
This pull request allows for the use of the cutoff power law function with public data. The major fix is the implementation of the
get_integralmethod in the flux_model. This uses the default implementation. It could be sped up by implementing an analytic form.The second update is to edit the create_analysis script so that if you give a cutoff value it will set the analysis up using the CutoffPowerLawEnergyFluxProfile, otherwise it will default to the power law implementation.