ctools  2.0.0
 All Classes Namespaces Files Functions Variables Macros Pages
cscripts.csspec.csspec Class Reference
Inheritance diagram for cscripts.csspec.csspec:

Public Member Functions

def __init__
 
def __del__
 
def __getstate__
 
def __setstate__
 
def process
 
def save
 
def publish
 
def spectrum
 
def models
 

Private Member Functions

def _get_parameters
 
def _set_ebounds
 
def _log_spectral_binning
 
def _adjust_model_pars
 
def _set_replace_src_spectrum_by_nodes
 
def _set_replace_src_spectrum_by_bins
 
def _select_onoff_obs
 
def _select_obs
 
def _fit_energy_bin
 
def _fit_energy_bins
 
def _fit_model
 
def _profile_logL
 
def _create_fits
 

Private Attributes

 _ebounds
 
 _fits
 
 _binned_mode
 
 _onoff_mode
 
 _method
 
 _nthreads
 

Detailed Description

Generates a spectrum

This class implements the generation of a Spectral Energy Distribution
(SED) from gamma-ray observations.

Definition at line 32 of file csspec.py.

Constructor & Destructor Documentation

def cscripts.csspec.csspec.__init__ (   self,
  argv 
)
Constructor

Definition at line 41 of file csspec.py.

def cscripts.csspec.csspec.__del__ (   self)
Destructor

Definition at line 59 of file csspec.py.

Member Function Documentation

def cscripts.csspec.csspec._adjust_model_pars (   self)
private
def cscripts.csspec.csspec._create_fits (   self,
  results 
)
private
def cscripts.csspec.csspec._fit_energy_bin (   self,
  i 
)
private
Fit data for one energy bin

Parameters
----------
i : int
    Energy bin index

Returns
-------
result : dict
    Dictionary with fit results

Definition at line 699 of file csspec.py.

References cscripts.csspec.csspec._binned_mode, cscripts.csspec.csspec._onoff_mode, cscripts.csspec.csspec._profile_logL(), cscripts.csspec.csspec._select_obs(), cscripts.csspec.csspec.models(), and cscripts.csspec.csspec.spectrum().

Referenced by cscripts.csspec.csspec._fit_energy_bins().

def cscripts.csspec.csspec._fit_model (   self)
private
Fit model to observations

Returns
-------
results : list of dict
    List of dictionaries with fit results

Definition at line 900 of file csspec.py.

References cscripts.csspec.csspec._profile_logL(), cscripts.csspec.csspec.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().

Referenced by cscripts.csspec.csspec.process().

def cscripts.csspec.csspec._log_spectral_binning (   self)
private
def cscripts.csspec.csspec._profile_logL (   self,
  like,
  parname,
  elogmean 
)
private
Computes the delta log-likelihood profile in a single energy bin

Parameters
----------
like : `~ctools.ctlike()`
    ctlike fitter containing prefit model
parname : str
    Name of the spectral parameter to be fit
elogmean : `~gammalib.GEnergy()`
    Energy at which the model is to be evaluated

Returns
-------
norm_scan : list
    Normalization values 
dloglike_scan : list
    Computed loglikelihood values
loglike: float
    Computed reference log-likelihood for dloglike_scan

Definition at line 1050 of file csspec.py.

References cscripts.csspec.csspec._method, cscripts.csscs.csscs._method, and cscripts.csspec.csspec.models().

Referenced by cscripts.csspec.csspec._fit_energy_bin(), and cscripts.csspec.csspec._fit_model().

def cscripts.csspec.csspec._select_obs (   self,
  emin,
  emax 
)
private
Select observations for energy interval

Parameters
----------
emin : `~gammalib.GEnergy()`
    Minimum energy
emax : `~gammalib.GEnergy()`
    Maximum energy

Returns
-------
obs : `~gammalib.GObservations`
    Observation container

Definition at line 609 of file csspec.py.

References cscripts.csspec.csspec._binned_mode, cscripts.csspec.csspec._onoff_mode, cscripts.csspec.csspec._select_onoff_obs(), cscripts.csspec.csspec.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().

Referenced by cscripts.csspec.csspec._fit_energy_bin().

def cscripts.csspec.csspec._select_onoff_obs (   self,
  obs,
  emin,
  emax 
)
private
Select an energy interval from one CTA On/Off observation

Parameters
----------
obs : `~gammalib.GCTAOnOffObservation`
    Minimum energy
emin : `~gammalib.GEnergy()`
    Minimum energy
emax : `~gammalib.GEnergy()`
    Maximum energy

Returns
-------
obs : `~gammalib.GCTAOnOffObservation`
    CTA On/Off observation

Definition at line 532 of file csspec.py.

Referenced by cscripts.csspec.csspec._select_obs().

def cscripts.csspec.csspec._set_replace_src_spectrum_by_nodes (   self)
private
Replace source spectrum by node function

Definition at line 417 of file csspec.py.

References cscripts.csspec.csspec.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().

Referenced by cscripts.csspec.csspec.process().

def cscripts.csspec.csspec.process (   self)
Process the script

Definition at line 1258 of file csspec.py.

References cscripts.cslightcrv.cslightcrv._adjust_model_pars(), cscripts.csscs.csscs._adjust_model_pars(), cscripts.csspec.csspec._adjust_model_pars(), cscripts.csphasecrv.csphasecrv._create_fits(), cscripts.cspull.cspull._create_fits(), cscripts.cssens.cssens._create_fits(), cscripts.csspec.csspec._create_fits(), cscripts.csspec.csspec._fit_energy_bins(), cscripts.csspec.csspec._fit_model(), cscripts.csobsselect.csobsselect._get_parameters(), cscripts.csadd2caldb.csadd2caldb._get_parameters(), cscripts.csebins.csebins._get_parameters(), cscripts.csmodelselect.csmodelselect._get_parameters(), cscripts.csroot2caldb.csroot2caldb._get_parameters(), cscripts.csresmap.csresmap._get_parameters(), cscripts.csresspec.csresspec._get_parameters(), cscripts.csmodelinfo.csmodelinfo._get_parameters(), cscripts.csmodelmerge.csmodelmerge._get_parameters(), cscripts.csobsinfo.csobsinfo._get_parameters(), cscripts.csfindobs.csfindobs._get_parameters(), cscripts.csiactdata.csiactdata._get_parameters(), cscripts.csiactcopy.csiactcopy._get_parameters(), cscripts.cscaldb.cscaldb._get_parameters(), cscripts.csmodelsois.csmodelsois._get_parameters(), cscripts.csobs2caldb.csobs2caldb._get_parameters(), cscripts.csbkgmodel.csbkgmodel._get_parameters(), cscripts.cspull.cspull._get_parameters(), cscripts.csfootprint.csfootprint._get_parameters(), cscripts.csiactobs.csiactobs._get_parameters(), cscripts.csobsdef.csobsdef._get_parameters(), cscripts.csspec.csspec._get_parameters(), cscripts.cssens.cssens._get_parameters(), cscripts.csphasecrv.csphasecrv._get_parameters(), cscripts.cslightcrv.cslightcrv._get_parameters(), cscripts.csscs.csscs._get_parameters(), cscripts.csphagen.csphagen._get_parameters(), cscripts.csspec.csspec._log_spectral_binning(), cscripts.csspec.csspec._method, cscripts.csscs.csscs._method, cscripts.csspec.csspec._set_replace_src_spectrum_by_bins(), cscripts.csspec.csspec._set_replace_src_spectrum_by_nodes(), cscripts.csspec.csspec.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), cscripts.csiactobs.csiactobs.obs(), cscripts.csresmap.csresmap.publish(), cscripts.csphasecrv.csphasecrv.publish(), cscripts.cslightcrv.cslightcrv.publish(), and cscripts.csspec.csspec.publish().

def cscripts.csspec.csspec.publish (   self,
  name = '' 
)
def cscripts.csspec.csspec.spectrum (   self)

Member Data Documentation


The documentation for this class was generated from the following file: