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

Public Member Functions

def __init__
 
def __getstate__
 
def __setstate__
 
def process
 
def save
 
def exclusion_map
 
def fits
 
def flux
 
def flux_error
 
def ts
 
def ulimit
 

Private Member Functions

def _get_onoff_parameters
 
def _get_parameters
 
def _create_map
 
def _adjust_model_pars
 
def _mask_cube
 
def _mask_evlist
 
def _mask_observations
 
def _pixel_analysis
 
def _write_hdu_keywords
 
def _fill_fits
 
def _get_skymap
 

Private Attributes

 _nthreads
 
 _srcnames
 
 _method
 
 _fits
 
 _excl_reg_map
 
 _excl_reg_name
 

Detailed Description

Spectral component separation script

Definition at line 32 of file csscs.py.

Constructor & Destructor Documentation

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

Parameters
----------
argv : list of str
    List of IRAF command line parameter strings of the form
    ``parameter=3``.

Definition at line 38 of file csscs.py.

Member Function Documentation

def cscripts.csscs.csscs._adjust_model_pars (   self)
private
def cscripts.csscs.csscs._create_map (   self)
private
Create a gammalib.GSkyMap object to store the output

Returns
-------
skymap : `~gammalib.GSkyMap`
    Sky map

Definition at line 270 of file csscs.py.

Referenced by cscripts.csscs.csscs._fill_fits(), cscripts.cstsmapsplit.cstsmapsplit._get_parameters(), cscripts.csscs.csscs._pixel_analysis(), and cscripts.csscs.csscs.process().

def cscripts.csscs.csscs._fill_fits (   self,
  results 
)
private
Fill FITS object to store the results

Parameters
----------
result : `dict`
    Results

Returns
-------
fits : `~gammalib.GFits`
    FITS object

Definition at line 679 of file csscs.py.

References cscripts.csscs.csscs._create_map(), cscripts.csscs.csscs._srcnames, and cscripts.csscs.csscs._write_hdu_keywords().

Referenced by cscripts.csscs.csscs.process().

def cscripts.csscs.csscs._get_onoff_parameters (   self)
private
Get On/Off analysis parameters.

This is done here rather than in ctools.is_onoff because the exclusion
map needs to be handled differently as an automatic parameter but
queried only if not already set and we need to verify is not empty.
Also many parameters are already queried for all methods

TODO: verify if this can be made more uniform with other scripts

Definition at line 106 of file csscs.py.

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

Referenced by cscripts.csscs.csscs._get_parameters().

def cscripts.csscs.csscs._get_skymap (   self,
  name,
  quantity 
)
private
Fetches skymap from FITS container

Parameters
----------
name : str
    Source name
quantity : str
    Quantity

Returns
-------
skymap : `~gammalib.GSkyMap`
    Skymap

Raises
------
NameError

Definition at line 739 of file csscs.py.

References cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._fits, cscripts.csscs.csscs._fits, cscripts.csphasecrv.csphasecrv._fits, cscripts.cslightcrv.cslightcrv._fits, and cscripts.csscs.csscs._srcnames.

Referenced by cscripts.csscs.csscs.flux(), cscripts.csscs.csscs.flux_error(), cscripts.csscs.csscs.ts(), and cscripts.csscs.csscs.ulimit().

def cscripts.csscs.csscs._mask_cube (   self,
  obs,
  ra,
  dec,
  rad 
)
private
Mask cube observation

Parameters
----------
obs : `gammalib.GCTAObservation`
    Input observation of type cube
ra : float
    Right Ascension (deg)
dec : float
    Declination (deg)
rad : float
    Radius (deg)

Returns
-------
new_obs : `gammalib.GCTAObservations`
    Output observations with masked cubes

Definition at line 367 of file csscs.py.

Referenced by cscripts.csscs.csscs._mask_observations().

def cscripts.csscs.csscs._mask_evlist (   self,
  obs,
  ra,
  dec,
  rad 
)
private
Mask event list

Parameters
----------
obs : `gammalib.GCTAObservations`
    Input observations of type event list
ra : float
    Right Ascension (deg)
dec : float
    Declination (deg)
rad : float
    Radius (deg)

Returns
-------
new_obs : `gammalib.GCTAObservations`
    Output observations with masked event lists

Definition at line 410 of file csscs.py.

Referenced by cscripts.csscs.csscs._mask_observations().

def cscripts.csscs.csscs._mask_observations (   self,
  ra,
  dec,
  rad 
)
private
Create observations restricted to circular ROI

Parameters
----------
ra : float
    Right Ascension (deg)
dec : float
    Declination (deg)
rad : float
    Radius (deg)

Returns
-------
new_obs : `~gammalib.GObservations`
    Observations in circular ROI

Definition at line 455 of file csscs.py.

References cscripts.csscs.csscs._mask_cube(), cscripts.csscs.csscs._mask_evlist(), cscripts.csscs.csscs._method, cscripts.csscs.csscs._srcnames, ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().

Referenced by cscripts.csscs.csscs._pixel_analysis().

def cscripts.csscs.csscs._pixel_analysis (   self,
  inx 
)
private
Performs analysis over the region of interest corresponding to a
single pixel of output map

Parameters
----------
inx : int
    Pixel index

Returns
-------
result : dict
    Results

Definition at line 487 of file csscs.py.

References cscripts.csscs.csscs._create_map(), cscripts.csscs.csscs._mask_observations(), cscripts.csscs.csscs._srcnames, and cscripts.csscs.csscs.flux().

Referenced by cscripts.csscs.csscs.process().

def cscripts.csscs.csscs._write_hdu_keywords (   self,
  hdu,
  is_flux = False 
)
private
Append cards to HDU

Parameters
----------
hdu : `~gammalib.GFitsHDU`
    HDU

Definition at line 638 of file csscs.py.

References cscripts.csscs.csscs._excl_reg_name, and cscripts.csscs.csscs._method.

Referenced by cscripts.csscs.csscs._fill_fits().

def cscripts.csscs.csscs.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 860 of file csscs.py.

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

def cscripts.csscs.csscs.fits (   self)
Return copy of the fits container

Returns
-------
fits : `~gammalib.GFits`
    FITS file containing the maps

Definition at line 881 of file csscs.py.

def cscripts.csscs.csscs.flux (   self,
  name 
)
Return flux skymap

Parameters
----------
name : str
    Source name

Returns
-------
skymap : `~gammalib.GSkyMap`
    Flux skymap

Definition at line 893 of file csscs.py.

References cscripts.csscs.csscs._get_skymap().

Referenced by cscripts.csscs.csscs._pixel_analysis().

def cscripts.csscs.csscs.flux_error (   self,
  name 
)
Return flux error skymap

Parameters
----------
name : str
    Source name

Returns
-------
skymap : `~gammalib.GSkyMap`
    Flux error skymap

Definition at line 913 of file csscs.py.

References cscripts.csscs.csscs._get_skymap().

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

Definition at line 794 of file csscs.py.

References cscripts.cslightcrv.cslightcrv._adjust_model_pars(), cscripts.csscs.csscs._adjust_model_pars(), cscripts.csscs.csscs._create_map(), cscripts.csscs.csscs._fill_fits(), cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._fits, cscripts.csscs.csscs._fits, cscripts.csphasecrv.csphasecrv._fits, cscripts.cslightcrv.cslightcrv._fits, 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.csphasecrv.csphasecrv._get_parameters(), cscripts.cslightcrv.cslightcrv._get_parameters(), cscripts.csscs.csscs._get_parameters(), cscripts.csphagen.csphagen._get_parameters(), cscripts.cspull.cspull._nthreads, cscripts.csscs.csscs._nthreads, cscripts.csphagen.csphagen._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, cscripts.cslightcrv.cslightcrv._nthreads, cscripts.csscs.csscs._pixel_analysis(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().

def cscripts.csscs.csscs.save (   self)
def cscripts.csscs.csscs.ts (   self,
  name 
)
Return TS skymap

Parameters
----------
name : str
    Source name

Returns
-------
skymap : `~gammalib.GSkyMap`
    TS skymap

Definition at line 933 of file csscs.py.

References cscripts.csscs.csscs._get_skymap().

def cscripts.csscs.csscs.ulimit (   self,
  name 
)
Return flux upper limit skymap

Parameters
----------
name : str
    Source name

Returns
-------
skymap : `~gammalib.GSkyMap`
    Flux upper limit skymap

Definition at line 960 of file csscs.py.

References cscripts.csscs.csscs._get_skymap().

Member Data Documentation


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