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

Public Member Functions

def __init__
 
def __getstate__
 
def __setstate__
 
def process
 
def save
 
def publish
 
def phasecurve
 
def exclusion_map
 

Private Member Functions

def _get_parameters
 
def _create_tbounds
 
def _get_free_par_names
 
def _create_fits_table
 
def _create_fits
 
def _save_fits
 
def _save_xml
 
def _phase_bin
 

Private Attributes

 _srcname
 
 _phbins
 
 _onoff
 
 _stacked
 
 _fits
 
 _fitmodels
 
 _nthreads
 
 _excl_reg_map
 

Detailed Description

Generates spectra in phase bins

This script computes spectra by performing a maximum likelihood fit
using :doc:`ctlike` in a series of phase bins for pulsars. The phase bins
can be either specified in an ASCII file or as an interval divided into
equally sized phase bins.

Examples:
        >>> phcrv = csphasecrv()
        >>> phcrv.run()
        >>> ... (querying for parameters) ...
        >>> phcrv = phrv.phasecrv()
            Generates phase fits and retrieves dictionary with best fit models.

        >>> phcrv = csphasecrv(obs)
        >>> phcrv.execute()
        >>> ... (querying for parameters) ...
            Generates phase fits from the observations 
            and saves results in XML files.

Definition at line 32 of file csphasecrv.py.

Constructor & Destructor Documentation

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

Definition at line 56 of file csphasecrv.py.

Member Function Documentation

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

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

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

Definition at line 240 of file csphasecrv.py.

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

Referenced by cscripts.csphasecrv.csphasecrv._create_fits().

def cscripts.csphasecrv.csphasecrv._create_tbounds (   self)
private
Creates phase bins

Returns
-------
phbins : `[]`
    List of phase bins

Definition at line 169 of file csphasecrv.py.

Referenced by cscripts.csphasecrv.csphasecrv._get_parameters().

def cscripts.csphasecrv.csphasecrv._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 220 of file csphasecrv.py.

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

Referenced by cscripts.csphasecrv.csphasecrv._create_fits().

def cscripts.csphasecrv.csphasecrv._phase_bin (   self,
  phbin 
)
private
def cscripts.csphasecrv.csphasecrv._save_fits (   self)
private
Saved phase fit results into a fits file

Definition at line 327 of file csphasecrv.py.

References cscripts.csmodelmerge.csmodelmerge._clobber, and cscripts.csphasecrv.csphasecrv._create_fits().

Referenced by cscripts.csphasecrv.csphasecrv.save().

def cscripts.csphasecrv.csphasecrv._save_xml (   self)
private
Save phase fit results into one XML model each bin

Definition at line 349 of file csphasecrv.py.

References cscripts.csphasecrv.csphasecrv._fitmodels, cscripts.csphasecrv.csphasecrv._phbins, and cscripts.csphasecrv.csphasecrv.save().

Referenced by cscripts.csphasecrv.csphasecrv.save().

def cscripts.csphasecrv.csphasecrv.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 558 of file csphasecrv.py.

References cscripts.csphasecrv.csphasecrv._excl_reg_map, and cscripts.cslightcrv.cslightcrv._excl_reg_map.

def cscripts.csphasecrv.csphasecrv.phasecurve (   self)
Return dictionary with best fit models

Definition at line 551 of file csphasecrv.py.

References cscripts.csphasecrv.csphasecrv._fitmodels.

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

Definition at line 464 of file csphasecrv.py.

References cscripts.csphasecrv.csphasecrv._create_fits(), cscripts.csphasecrv.csphasecrv._fitmodels, cscripts.csobsselect.csobsselect._get_parameters(), cscripts.csadd2caldb.csadd2caldb._get_parameters(), cscripts.csebins.csebins._get_parameters(), cscripts.csmodelselect.csmodelselect._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.csmodelsois.csmodelsois._get_parameters(), cscripts.cscaldb.cscaldb._get_parameters(), cscripts.csobs2caldb.csobs2caldb._get_parameters(), cscripts.csbkgmodel.csbkgmodel._get_parameters(), cscripts.csfootprint.csfootprint._get_parameters(), cscripts.csiactobs.csiactobs._get_parameters(), cscripts.csobsdef.csobsdef._get_parameters(), cscripts.csphasecrv.csphasecrv._get_parameters(), cscripts.cslightcrv.cslightcrv._get_parameters(), cscripts.csphagen.csphagen._get_parameters(), cscripts.csphagen.csphagen._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, cscripts.cslightcrv.cslightcrv._nthreads, cscripts.csphasecrv.csphasecrv._phase_bin(), cscripts.csphasecrv.csphasecrv._phbins, ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), cscripts.csiactobs.csiactobs.obs(), cscripts.csphasecrv.csphasecrv.publish(), and cscripts.cslightcrv.cslightcrv.publish().

def cscripts.csphasecrv.csphasecrv.publish (   self,
  name = '' 
)
Publish phase curve

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

Definition at line 521 of file csphasecrv.py.

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

def cscripts.csphasecrv.csphasecrv.save (   self)
Saves results to fits and XML

Definition at line 508 of file csphasecrv.py.

References cscripts.csphasecrv.csphasecrv._save_fits(), and cscripts.csphasecrv.csphasecrv._save_xml().

Referenced by cscripts.csphasecrv.csphasecrv._save_xml().

Member Data Documentation


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