make classprop
"metadata": {},
"source": [
"Normed spectral models are a special class of Spectral Models, which have a dimension-less normalisation. These spectral models feature a norm parameter instead\n",
- "of amplitude and are named using the ``NormSpectralModel`` suffix. They **must** be used along with another spectral model, as a multiplicative correction factor according to their spectral shape. They can be typically used for adjusting template based models, or adding a EBL correction to some analytic model. "
+ "of amplitude and are named using the ``NormSpectralModel`` suffix. They **must** be used along with another spectral model, as a multiplicative correction factor according to their spectral shape. They can be typically used for adjusting template based models, or adding a EBL correction to some analytic model. \n",
+ "\n",
+ "To check if a given `SpectralModel` is a norm model, you can simply look at the `is_norm_spectral_model` property"
]
},
{
"source": [
"# To see the available norm models shipped with gammapy:\n",
"for model in SPECTRAL_MODEL_REGISTRY:\n",
- " if str(model)[-19:-2] == \"NormSpectralModel\":\n",
+ " if model.is_norm_spectral_model:\n",
" print(model)"
]
},
"pwl_norm(energy)"
]
},
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# To check if a Norm model\n",
- "print(pwl_norm.is_norm_spectral_model) # this is a norm model\n",
- "print(pwl.is_norm_spectral_model) # this is not a norm model"
- ]
- },
{
"cell_type": "markdown",
"metadata": {},
" \"\"\"Evaluation radius (`~astropy.coordinates.Angle`).\"\"\"\n",
" return 5 * np.max([self.sigma_1TeV.value, self.sigma_10TeV.value]) * u.deg"
]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
}
],
"metadata": {
