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

Public Member Functions

def __init__
 
def __getstate__
 
def __setstate__
 
def process
 
def save
 
def publish
 
def lightcurve
 
def models
 
def exclusion_map
 

Private Member Functions

def _get_parameters
 
def _create_tbounds
 
def _get_free_par_names
 
def _adjust_model_pars
 
def _create_fits_table
 
def _compute_ulimit
 
def _timebin
 

Private Attributes

 _srcname
 
 _tbins
 
 _onoff
 
 _stacked
 
 _fits
 
 _nthreads
 
 _excl_reg_map
 

Detailed Description

Generates a lightcurve

The cslightcrv class generates a light curve for Imaging Air Cherenkov
Telescope event data by performing a maximum likelihood fit using
ctlike in a series of time bins. The time bins can be either
specified in an ASCII file, as an interval divided into equally
sized time bins, or can be taken from the Good Time Intervals of the
observation(s).

The format of the ASCII file is one row per time bin, each specifying
the start of stop value of the bin, separated by a whitespace. The
times are given in Modified Julian Days (MJD). 

Examples:
        >>> lcrv = cslightcrv()
        >>> lcrv.run()
        >>> ... (querying for parameters) ...
        >>> fits = lcrv.lightcurve()
            Generates a light curve and retrieves the results in
            a FITS file.

        >>> lcrv = cslightcrv()
        >>> lcrv.execute()
        >>> ... (querying for parameters) ...
            Generates a light curve and saves results in a FITS file.

        >>> lcrv = cslightcrv(obs)
        >>> lcrv.execute()
        >>> ... (querying for parameters) ...
            Generates a light curve from the observations in an
            observation container and saves results in a FITS file.

Definition at line 33 of file cslightcrv.py.

Constructor & Destructor Documentation

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

Definition at line 69 of file cslightcrv.py.

Member Function Documentation

def cscripts.cslightcrv.cslightcrv.__getstate__ (   self)
def cscripts.cslightcrv.cslightcrv.__setstate__ (   self,
  state 
)
def cscripts.cslightcrv.cslightcrv._adjust_model_pars (   self)
private
def cscripts.cslightcrv.cslightcrv._compute_ulimit (   self,
  obs 
)
private
Computes upper limit

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

Returns
-------
ul_diff, ul_flux, ul_eflux : tuple of float
    Upper limits, -1.0 of not computed

Definition at line 359 of file cslightcrv.py.

References cscripts.cslightcrv.cslightcrv._srcname.

Referenced by cscripts.cslightcrv.cslightcrv._timebin().

def cscripts.cslightcrv.cslightcrv._create_fits_table (   self,
  results 
)
private
Creates FITS binary table containing light curve results

Parameters
----------
results : list of dict
    List of result dictionaries

Returns
-------
table : `~gammalib.GFitsBinTable`
    FITS binary table containing light curve

Definition at line 315 of file cslightcrv.py.

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

Referenced by cscripts.csphasecrv.csphasecrv._create_fits(), and cscripts.cslightcrv.cslightcrv.process().

def cscripts.cslightcrv.cslightcrv._create_tbounds (   self)
private
Creates light curve time bins

Returns
-------
gti : `~gammalib.GGti`
    Light curve bins in form of Good Time Intervals

Definition at line 182 of file cslightcrv.py.

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

Referenced by cscripts.csphasecrv.csphasecrv._get_parameters(), and cscripts.cslightcrv.cslightcrv._get_parameters().

def cscripts.cslightcrv.cslightcrv._get_free_par_names (   self)
private
Return list of free parameter names

Returns
-------
names : list of str
    List of free parameter names.

Definition at line 255 of file cslightcrv.py.

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

Referenced by cscripts.csphasecrv.csphasecrv._create_fits(), and cscripts.cslightcrv.cslightcrv._timebin().

def cscripts.cslightcrv.cslightcrv._get_parameters (   self)
private
Get parameters from parfile

Definition at line 133 of file cslightcrv.py.

References cscripts.cslightcrv.cslightcrv._create_tbounds(), cscripts.cslightcrv.cslightcrv._nthreads, cscripts.cslightcrv.cslightcrv._onoff, cscripts.cslightcrv.cslightcrv._srcname, cscripts.cslightcrv.cslightcrv._stacked, cscripts.cslightcrv.cslightcrv._tbins, cscripts.cslightcrv.cslightcrv.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().

Referenced by cscripts.csmodelinfo.csmodelinfo.process(), cscripts.csobsinfo.csobsinfo.process(), cscript_base.cscript_base.process(), cscript_like.cscript_like.process(), cscript_obs.cscript_obs.process(), cscripts.csmodelmerge.csmodelmerge.process(), cscripts.cstsmapsplit.cstsmapsplit.process(), cscripts.csresmap.csresmap.process(), cscripts.csmodelsois.csmodelsois.process(), cscripts.csobsdef.csobsdef.process(), cscripts.csmodelselect.csmodelselect.process(), cscripts.cstsmapmerge.cstsmapmerge.process(), cscripts.csobsselect.csobsselect.process(), cscripts.csworkflow.csworkflow.process(), cscripts.csobs2caldb.csobs2caldb.process(), cscripts.cstsdist.cstsdist.process(), cscripts.cssrcdetect.cssrcdetect.process(), cscripts.cspull.cspull.process(), cscripts.csphasecrv.csphasecrv.process(), cscripts.cslightcrv.cslightcrv.process(), cscripts.csviscube.csviscube.process(), cscripts.csresspec.csresspec.process(), cscripts.csscs.csscs.process(), cscripts.csphagen.csphagen.process(), cscripts.cssens.cssens.process(), cscripts.csspec.csspec.process(), and cscripts.csroot2caldb.csroot2caldb.process().

def cscripts.cslightcrv.cslightcrv._timebin (   self,
  i 
)
private
def cscripts.cslightcrv.cslightcrv.exclusion_map (   self,
  object = None 
)
Return and optionally set the exclusion regions map

Parameters
----------
object : `~gammalib.GSkyRegion` or `~gammalib.GSkyMap` or `~gammalib.GFilename`
    Exclusion regions object

Returns
-------
region : `~gammalib.GSkyRegionMap`
    Exclusion regions map

Definition at line 763 of file cslightcrv.py.

References cscripts.cslightcrv.cslightcrv._excl_reg_map.

def cscripts.cslightcrv.cslightcrv.lightcurve (   self)
Return light curve FITS file

Returns
-------
fits : `~gammalib.GFits()`
    FITS file containing light curve

Definition at line 736 of file cslightcrv.py.

References cscripts.cslightcrv.cslightcrv._fits.

def cscripts.cslightcrv.cslightcrv.publish (   self,
  name = '' 
)
Publish light curve

Parameters
----------
name : str, optional
    Name of light curve

Definition at line 706 of file cslightcrv.py.

Referenced by cscripts.csresmap.csresmap.process(), cscripts.csphasecrv.csphasecrv.process(), cscripts.cslightcrv.cslightcrv.process(), cscripts.csviscube.csviscube.process(), and cscripts.csspec.csspec.process().

def cscripts.cslightcrv.cslightcrv.save (   self)
Save light curve

Definition at line 684 of file cslightcrv.py.

References cscripts.csmodelmerge.csmodelmerge._clobber.

Member Data Documentation

cscripts.cslightcrv.cslightcrv._srcname
private

Definition at line 77 of file cslightcrv.py.

Referenced by cscripts.cstsdist.cstsdist.__getstate__(), cscripts.csphagen.csphagen.__getstate__(), cscripts.cssens.cssens.__getstate__(), cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.cslightcrv.cslightcrv.__getstate__(), cscripts.cstsdist.cstsdist.__setstate__(), cscripts.cssens.cssens.__setstate__(), cscripts.csphagen.csphagen.__setstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.cslightcrv.cslightcrv.__setstate__(), cscripts.cslightcrv.cslightcrv._adjust_model_pars(), cscripts.cstsmapsplit.cstsmapsplit._compute_null_hypothesis(), cscripts.cslightcrv.cslightcrv._compute_ulimit(), cscripts.csphasecrv.csphasecrv._create_fits(), cscripts.cssens.cssens._create_fits(), cscripts.csphasecrv.csphasecrv._create_fits_table(), cscripts.cslightcrv.cslightcrv._create_fits_table(), cscripts.csphasecrv.csphasecrv._get_free_par_names(), cscripts.cslightcrv.cslightcrv._get_free_par_names(), cscripts.cstsmapsplit.cstsmapsplit._get_parameters(), cscripts.cstsdist.cstsdist._get_parameters(), cscripts.csphasecrv.csphasecrv._get_parameters(), cscripts.cslightcrv.cslightcrv._get_parameters(), cscripts.csphagen.csphagen._get_parameters(), cscripts.cssens.cssens._get_sensitivity(), cscripts.csphagen.csphagen._process_observation(), cscripts.cssens.cssens._set_source(), cscripts.cssens.cssens._set_src_prefactor(), cscripts.cssens.cssens._sim_evt_excess(), cscripts.cslightcrv.cslightcrv._timebin(), cscripts.cstsdist.cstsdist._trial(), cscripts.cstsmapsplit.cstsmapsplit.process(), cscripts.cstsdist.cstsdist.process(), and cscripts.cssens.cssens.process().


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