add_factor_prior#
- gammapy.astro.darkmatter.add_factor_prior(model, sigma, mu=1.0)[source]#
Attach a Gaussian nuisance prior on
scalefor J/D-factor uncertainty.The J/D-factor is kept fixed at its nominal value; the associated uncertainty is instead expressed as an equivalent prior on
scale, since the predicted flux depends only on the productscale * jfactor. Placing the prior directly on a second parameter (e.g.log10_jfactor) would make it perfectly degenerate withscale. This reparametrisation is a pure shift, so the prior retains the same shape andsigma, centered atscale = 1instead of at the nominal log10(J).- Parameters:
- model
DarkMatterAnnihilationSpectralModelorDarkMatterDecaySpectralModel Model whose
scaleparameter will get the prior attached.scaleis unfrozen as part of this call.- sigmafloat
Uncertainty on log10(J) (or log10(D)), in dex.
- mufloat, optional
Center of the prior, in units of
scale. Default is 1.0, i.e. the nominal J/D-factor value.
- model
- Returns:
- model
DarkMatterAnnihilationSpectralModelorDarkMatterDecaySpectralModel The same model instance, with the prior attached, for chaining.
- model