Analysis

class gammapy.scripts.Analysis(config=None)[source]

Bases: object

Config-driven high-level analysis interface.

It is initialized by default with a set of configuration parameters and values declared in an internal configuration schema YAML file, though the user can also provide configuration parameters passed as a nested dictionary at the moment of instantiation. In that case these parameters will overwrite the default values of those present in the configuration file.

For more info see scripts - High-level interface.

Parameters:
config : dict or AnalysisConfig

Configuration options following AnalysisConfig schema

Attributes Summary

config Analysis configuration (AnalysisConfig)
settings Configuration settings for the analysis session.

Methods Summary

get_datasets(self) Produce reduced datasets.
get_flux_points(self[, source]) Calculate flux points for a specific model component.
get_observations(self) Fetch observations from the data store according to criteria defined in the configuration.
run_fit(self[, optimize_opts]) Fitting reduced datasets to model.
set_model(self[, model, filename]) Read the model from dict or filename and attach it to datasets.

Attributes Documentation

config

Analysis configuration (AnalysisConfig)

settings

Configuration settings for the analysis session.

Methods Documentation

get_datasets(self)[source]

Produce reduced datasets.

get_flux_points(self, source='source')[source]

Calculate flux points for a specific model component.

Parameters:
source : string

Name of the model component where to calculate the flux points.

get_observations(self)[source]

Fetch observations from the data store according to criteria defined in the configuration.

run_fit(self, optimize_opts=None)[source]

Fitting reduced datasets to model.

set_model(self, model=None, filename='')[source]

Read the model from dict or filename and attach it to datasets.

Parameters:
model: dict or string

Dictionary or string in YAML format with the serialized model.

filename : string

Name of the model YAML file describing the model.