gammapy_plugin.utils package

Submodules

gammapy_plugin.utils.astromodels_functions module

class gammapy_plugin.utils.astromodels_functions.Exp_cutoff_powerlaw_gammapy(**kwargs)[source]

Bases: Function1D

description :

A exp cutoff function.

latex :

$Kleft(frac{x}{piv}right)^{-index}exp{-(lambda x)^alpha}$

parameters :

K :

desc : Normalization initial value : 1e-11 is_normalization : True transformation : log10 min : 1e-30 max : 1e5

piv :

desc : Pivot (keep this fixed) initial value : 1 fix : yes

index :

desc : index initial value : 2.0

lambda_ :

desc : curvature (= 1/xc) initial value : 0.1

alpha :

desc : alpha initial value : 1 fix : yes

evaluate(x, K, piv, index, lambda_, alpha)[source]
static info()
class gammapy_plugin.utils.astromodels_functions.Log_parabola_gammapy(**kwargs)[source]

Bases: Function1D

description :

A log-parabolic function, same parametrization as Gammapy

latex :

$Kleft(frac{x}{piv}right)^{-alpha-betalog{left(frac{x}{piv}right)}}$

parameters :

K :

desc : Normalization initial value : 1e-11 is_normalization : True transformation : log10 min : 1e-30 max : 1e5

piv :

desc : Pivot (keep this fixed) initial value : 1 fix : yes

alpha :

desc : index initial value : 2.0

beta :

desc : curvature initial value : 1.0

evaluate(x, K, piv, alpha, beta)[source]
static info()

gammapy_plugin.utils.gammapy_parser module

gammapy_plugin.utils.gammapy_parser.parameter_to_gammapy_dict(para)[source]

Converts a astromodel parameter to a dict able to be read in as a gammapy parameter.

Parameters:

para (Parameter) – astromodel paramter

Returns:

dict

Return type:

dict

gammapy_plugin.utils.gammapy_parser.parse_gammapy_model(gp_model, dataset_name='empty')[source]

Returns dict of astromodels parameters with all parameters from the passed gammapy model.

Parameters:
  • gp_model (ModelBase) – gammapy model

  • dataset_name (str) – name of the dataset the model is associated to defaults to empty

Return type:

dict

gammapy_plugin.utils.package_data module

gammapy_plugin.utils.package_data.get_path_of_data_dir()[source]

Get the path of the package data directory.

Returns:

Return type:

Path

gammapy_plugin.utils.package_data.get_path_of_data_file(data_file)[source]

Get the path of a data file.

Parameters:

data_file (str) – name of the data file

Returns:

Return type:

Path

Module contents