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

Public Member Functions

def __init__
 
def process
 
def save
 
def runlist
 
def ebounds
 
def obs
 

Private Member Functions

def _get_parameters
 
def _background_spectrum
 
def _iact_background
 
def _append_inmodels
 
def _write_summary
 
def _get_filename
 
def _is_present
 

Private Attributes

 _obs
 
 _ebounds
 
 _datapath
 
 _prodname
 
 _xml
 
 _models
 
 _runlist
 
 _runlistfile
 
 _bkgpars
 
 _master_indx
 
 _use_bkg_scale
 
 _ev_hiera
 
 _aeff_hiera
 
 _psf_hiera
 
 _bkg_hiera
 
 _edisp_hiera
 
 _bkg_mod_hiera
 
 _bkg_gauss_norm
 
 _bkg_gauss_index
 
 _bkg_gauss_sigma
 
 _bkg_aeff_index
 
 _bkg_aeff_norm
 
 _bkg_range_factor
 
 _hdu_index
 
 _obs_index
 
 _subdir
 
 _debug
 
 _xml_obslist
 

Detailed Description

Generates an IACT observation definition XML file

This class implements the creation of a observation xml file for IACT
data analysis. This class is dedicated for use inside a IACT
Collaboration, i.e. it can only be used if you have access to IACT data
in FITS format. The FITS data has to be structured and in the format
described here:
http://gamma-astro-data-formats.readthedocs.org/en/latest/

Definition at line 31 of file csiactobs.py.

Constructor & Destructor Documentation

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

Definition at line 44 of file csiactobs.py.

Member Function Documentation

def cscripts.csiactobs.csiactobs._append_inmodels (   self)
private
Append input models

Definition at line 428 of file csiactobs.py.

Referenced by cscripts.csiactobs.csiactobs.process().

def cscripts.csiactobs.csiactobs._background_spectrum (   self,
  prefactor,
  index,
  emin = 0.01,
  emax = 100.0 
)
private
Create a background spectrum model dependent on user parameters

Parameters
----------
prefactor : float
    Power law prefactor of spectral model
index : float
    Power law index of spectral model
emin : float
    Minimum energy (in case a spectral node function is required)
emax : float
    Maximum energy (in case a spectral node function is required)

Returns
-------
spec : `~gammalib.GModelSpectral()`
    Spectral model for the background shape     

Definition at line 245 of file csiactobs.py.

References cscripts.csiactobs.csiactobs._bkg_range_factor, cscripts.csiactobs.csiactobs._bkgpars, and cscripts.csiactobs.csiactobs._iact_background().

Referenced by cscripts.csiactobs.csiactobs._iact_background().

def cscripts.csiactobs.csiactobs._get_filename (   self,
  hdu,
  hierarchy,
  formats 
)
private
Retrieves a filename from a hdu index

Parameters
----------
hdu : `~gammalib.GFitsTable`
    HDU FITS table
hierarchy : list of str
    List of strings containing the hierarchy how to look for files
formats : list of str
    File formats available for this observation

Returns
-------
filename : str
    Filename of requested file

Definition at line 476 of file csiactobs.py.

References cscripts.csiactobs.csiactobs._subdir.

Referenced by cscripts.csiactobs.csiactobs.process().

def cscripts.csiactobs.csiactobs._get_parameters (   self)
private
Get parameters from parfile and setup the observation

Definition at line 93 of file csiactobs.py.

References cscripts.csiactobs.csiactobs._aeff_hiera, cscripts.csiactobs.csiactobs._bkg_aeff_index, cscripts.csiactobs.csiactobs._bkg_aeff_norm, cscripts.csiactobs.csiactobs._bkg_gauss_index, cscripts.csiactobs.csiactobs._bkg_gauss_norm, cscripts.csiactobs.csiactobs._bkg_gauss_sigma, cscripts.csiactobs.csiactobs._bkg_hiera, cscripts.csiactobs.csiactobs._bkg_mod_hiera, cscripts.csiactobs.csiactobs._bkg_range_factor, cscripts.csiactobs.csiactobs._bkgpars, cscripts.csfindobs.csfindobs._datapath, cscripts.csiactcopy.csiactcopy._datapath, cscripts.csiactdata.csiactdata._datapath, cscripts.csiactobs.csiactobs._datapath, cscripts.csiactobs.csiactobs._debug, cscripts.csiactobs.csiactobs._edisp_hiera, cscripts.csiactobs.csiactobs._ev_hiera, cscripts.csiactobs.csiactobs._hdu_index, cscripts.csiactdata.csiactdata._master_indx, cscripts.csiactobs.csiactobs._master_indx, cscripts.csfindobs.csfindobs._obs_index, cscripts.csiactobs.csiactobs._obs_index, cscripts.csfindobs.csfindobs._prodname, cscripts.csiactcopy.csiactcopy._prodname, cscripts.csiactobs.csiactobs._prodname, cscripts.csiactobs.csiactobs._psf_hiera, cscripts.csiactcopy.csiactcopy._runlist, cscripts.csiactobs.csiactobs._runlist, cscripts.csiactobs.csiactobs._runlistfile, cscripts.csiactobs.csiactobs._subdir, and cscripts.csiactobs.csiactobs._use_bkg_scale.

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.csiactobs.csiactobs.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.csiactobs.csiactobs._iact_background (   self,
  telescope,
  obs_id,
  bkg_scale,
  bkgtype,
  emin = 0.01,
  emax = 100 
)
private
Create an IACT background model

Parameters
----------
telescope : str
    Name of telescope
obs_id : str
    Observation ID
bkg_scale : float
    Background scaling factor
bkgtype : str
    Type of background (irf,aeff, or gauss)

Returns
-------
model : `~gammalib.GModelData()`
    Background model for IACT observation

Definition at line 347 of file csiactobs.py.

References cscripts.csiactobs.csiactobs._background_spectrum(), cscripts.csiactobs.csiactobs._bkg_aeff_index, cscripts.csiactobs.csiactobs._bkg_aeff_norm, cscripts.csiactobs.csiactobs._bkg_gauss_index, cscripts.csiactobs.csiactobs._bkg_gauss_norm, and cscripts.csiactobs.csiactobs._bkg_gauss_sigma.

Referenced by cscripts.csiactobs.csiactobs._background_spectrum(), and cscripts.csiactobs.csiactobs.process().

def cscripts.csiactobs.csiactobs._is_present (   self,
  filename,
  obs_id,
  filetype 
)
private
Checks if a filename is present

Parameters
----------
filename : str
    Filename
obs_id : int
    Observation ID
filetype : str
    Type of file

Returns
-------
present : bool
    True if filename is present, False otherwise

Definition at line 523 of file csiactobs.py.

Referenced by cscripts.csiactobs.csiactobs.process().

def cscripts.csiactobs.csiactobs._write_summary (   self)
private
Write observation summary

Definition at line 455 of file csiactobs.py.

Referenced by cscripts.csiactobs.csiactobs.process().

def cscripts.csiactobs.csiactobs.ebounds (   self)
Return runlist energy boundaries

Definition at line 840 of file csiactobs.py.

References cscripts.csebins.csebins._ebounds, and cscripts.csiactobs.csiactobs._ebounds.

def cscripts.csiactobs.csiactobs.obs (   self)
Return observations container

Definition at line 847 of file csiactobs.py.

References cscripts.csbkgmodel.csbkgmodel._models, cscripts.csiactobs.csiactobs._models, cscripts.csiactobs.csiactobs._obs, and cscripts.csiactobs.csiactobs._xml.

Referenced by cscripts.cslightcrv.cslightcrv._adjust_model_pars(), cscripts.csscs.csscs._adjust_model_pars(), cscripts.csspec.csspec._adjust_model_pars(), cscripts.cstsmapsplit.cstsmapsplit._compute_null_hypothesis(), cscripts.csphasecrv.csphasecrv._create_fits_table(), cscripts.cslightcrv.cslightcrv._create_fits_table(), cscripts.cslightcrv.cslightcrv._create_tbounds(), cscripts.csspec.csspec._fit_model(), cscripts.csbkgmodel.csbkgmodel._generate_runwise_bkg(), cscripts.csphasecrv.csphasecrv._get_free_par_names(), cscripts.cslightcrv.cslightcrv._get_free_par_names(), cscripts.csbkgmodel.csbkgmodel._get_instrument(), cscripts.csobsselect.csobsselect._get_parameters(), cscripts.csebins.csebins._get_parameters(), cscripts.csmodelselect.csmodelselect._get_parameters(), cscripts.csresmap.csresmap._get_parameters(), cscripts.csresspec.csresspec._get_parameters(), cscripts.csobsinfo.csobsinfo._get_parameters(), cscripts.cstsmapsplit.cstsmapsplit._get_parameters(), cscripts.csobs2caldb.csobs2caldb._get_parameters(), cscripts.csbkgmodel.csbkgmodel._get_parameters(), cscripts.cspull.cspull._get_parameters(), cscripts.cstsdist.cstsdist._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.csphagen.csphagen._get_parameters_bkgmethod_custom(), cscripts.csphagen.csphagen._get_parameters_bkgmethod_off(), cscripts.cssens.cssens._get_sensitivity(), cscripts.csspec.csspec._log_spectral_binning(), cscripts.csscs.csscs._mask_observations(), cscripts.csphasecrv.csphasecrv._phase_bin(), cscripts.csphagen.csphagen._process_observation(), cscripts.csspec.csspec._select_obs(), cscripts.csspec.csspec._set_ebounds(), cscripts.cssens.cssens._set_obs_ebounds(), cscripts.csspec.csspec._set_replace_src_spectrum_by_bins(), cscripts.csspec.csspec._set_replace_src_spectrum_by_nodes(), cscripts.cssens.cssens._set_source(), cscripts.cssens.cssens._set_src_prefactor(), cscripts.cstsdist.cstsdist._sim(), cscripts.cssens.cssens._sim_evt_excess(), cscripts.cslightcrv.cslightcrv._timebin(), cscripts.cspull.cspull._trial(), cscripts.csresmap.csresmap.models(), cscripts.cstsdist.cstsdist.models(), cscripts.cspull.cspull.models(), cscripts.cslightcrv.cslightcrv.models(), cscripts.csspec.csspec.models(), cscripts.csobsinfo.csobsinfo.process(), cscripts.cstsmapsplit.cstsmapsplit.process(), cscripts.csresmap.csresmap.process(), cscripts.csmodelselect.csmodelselect.process(), cscripts.csebins.csebins.process(), cscripts.csobsselect.csobsselect.process(), cscripts.cstsdist.cstsdist.process(), cscripts.cspull.cspull.process(), cscripts.csbkgmodel.csbkgmodel.process(), cscripts.csphasecrv.csphasecrv.process(), cscripts.cslightcrv.cslightcrv.process(), cscripts.csresspec.csresspec.process(), cscripts.csscs.csscs.process(), cscripts.csphagen.csphagen.process(), cscripts.cssens.cssens.process(), cscripts.csspec.csspec.process(), cscripts.csobsselect.csobsselect.save(), and cscripts.csphagen.csphagen.save().

def cscripts.csiactobs.csiactobs.runlist (   self,
  runlist 
)
Set runlist

Parameters
----------
runlist : list
    List of observation IDs

Raises
------
RuntimeError
    Input runlist is not a Python list

Definition at line 814 of file csiactobs.py.

References cscripts.csiactcopy.csiactcopy._runlist, and cscripts.csiactobs.csiactobs._runlist.

def cscripts.csiactobs.csiactobs.save (   self)
Save observation definition and model definition XML file

Definition at line 786 of file csiactobs.py.

Member Data Documentation

cscripts.csiactobs.csiactobs._aeff_hiera
private
cscripts.csiactobs.csiactobs._bkg_aeff_index
private
cscripts.csiactobs.csiactobs._bkg_aeff_norm
private
cscripts.csiactobs.csiactobs._bkg_gauss_index
private
cscripts.csiactobs.csiactobs._bkg_gauss_norm
private
cscripts.csiactobs.csiactobs._bkg_gauss_sigma
private
cscripts.csiactobs.csiactobs._bkg_hiera
private
cscripts.csiactobs.csiactobs._bkg_mod_hiera
private
cscripts.csiactobs.csiactobs._bkg_range_factor
private
cscripts.csiactobs.csiactobs._bkgpars
private
cscripts.csiactobs.csiactobs._datapath
private

Definition at line 54 of file csiactobs.py.

Referenced by cscripts.csiactobs.csiactobs._get_parameters().

cscripts.csiactobs.csiactobs._debug
private

Definition at line 78 of file csiactobs.py.

Referenced by cscripts.csiactobs.csiactobs._get_parameters().

cscripts.csiactobs.csiactobs._edisp_hiera
private
cscripts.csiactobs.csiactobs._ev_hiera
private
cscripts.csiactobs.csiactobs._hdu_index
private
cscripts.csiactobs.csiactobs._master_indx
private

Definition at line 61 of file csiactobs.py.

Referenced by cscripts.csiactobs.csiactobs._get_parameters().

cscripts.csiactobs.csiactobs._obs
private
cscripts.csiactobs.csiactobs._obs_index
private
cscripts.csiactobs.csiactobs._prodname
private

Definition at line 55 of file csiactobs.py.

Referenced by cscripts.csiactobs.csiactobs._get_parameters().

cscripts.csiactobs.csiactobs._psf_hiera
private
cscripts.csiactobs.csiactobs._runlist
private
cscripts.csiactobs.csiactobs._runlistfile
private

Definition at line 59 of file csiactobs.py.

Referenced by cscripts.csiactobs.csiactobs._get_parameters().

cscripts.csiactobs.csiactobs._subdir
private
cscripts.csiactobs.csiactobs._use_bkg_scale
private
cscripts.csiactobs.csiactobs._xml
private

Definition at line 56 of file csiactobs.py.

Referenced by cscripts.csiactobs.csiactobs.obs().

cscripts.csiactobs.csiactobs._xml_obslist
private

Definition at line 86 of file csiactobs.py.


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