ctools 2.1.0
Loading...
Searching...
No Matches
cscripts.cssrcdetect.cssrcdetect Class Reference
Inheritance diagram for cscripts.cssrcdetect.cssrcdetect:

Public Member Functions

 __init__ (self, *argv)
 
 process (self)
 
 save (self)
 
 models (self)
 

Protected Member Functions

 _get_parameters (self)
 
 _detect_sources (self, counts)
 
 _find_maximum (self, skymap)
 
 _remove_maximum (self, skymap, pos, value=0.0, radius=0.1)
 
 _map_moments (self, skymap, radius)
 
 _add_model (self, pos, name)
 
 _set_bkg (self, modeltype)
 
 _set_ptsrc (self, pos)
 
 _smooth_skymap (self, skymap)
 
 _load_skymap (self)
 
 _cache_map_dirs (self, skymap)
 

Protected Attributes

 _map
 
 _models
 
 _map_dirs
 
 _clobber
 

Detailed Description

Detects sources in a sky map

Definition at line 31 of file cssrcdetect.py.

Constructor & Destructor Documentation

◆ __init__()

cscripts.cssrcdetect.cssrcdetect.__init__ ( self,
* argv )
Constructor

Definition at line 37 of file cssrcdetect.py.

Member Function Documentation

◆ _add_model()

◆ _cache_map_dirs()

cscripts.cssrcdetect.cssrcdetect._cache_map_dirs ( self,
skymap )
protected
Cache map pixel positions to save some computation time

Definition at line 413 of file cssrcdetect.py.

References cscripts.cssrcdetect.cssrcdetect._map_dirs.

Referenced by cscripts.cssrcdetect.cssrcdetect.process().

◆ _detect_sources()

cscripts.cssrcdetect.cssrcdetect._detect_sources ( self,
counts )
protected

◆ _find_maximum()

cscripts.cssrcdetect.cssrcdetect._find_maximum ( self,
skymap )
protected
Find maximum in a sky map

Parameters
----------
skymap : `~gammalib.GSkyMap()`
    Sky map

Returns
-------
value, pos : tuple of float and `~gammalib.GSkyDir()`
    Maximum sky map value and corresponding sky direction

Definition at line 150 of file cssrcdetect.py.

References cscripts.cssrcdetect.cssrcdetect._map_dirs.

Referenced by cscripts.cssrcdetect.cssrcdetect._detect_sources().

◆ _get_parameters()

cscripts.cssrcdetect.cssrcdetect._get_parameters ( self)
protected
Get parameters from parfile

Definition at line 62 of file cssrcdetect.py.

References cscripts.cssrcdetect.cssrcdetect._map, and cscripts.cstsmapsplit.cstsmapsplit._map.

Referenced by cscripts.csadd2caldb.csadd2caldb.process(), cscripts.csbkgmodel.csbkgmodel.process(), cscripts.cscaldb.cscaldb.process(), cscripts.csebins.csebins.process(), cscripts.csfindobs.csfindobs.process(), cscripts.csfootprint.csfootprint.process(), cscripts.csiactcopy.csiactcopy.process(), cscripts.csiactdata.csiactdata.process(), cscripts.csiactobs.csiactobs.process(), cscripts.cslightcrv.cslightcrv.process(), cscripts.csmodelinfo.csmodelinfo.process(), cscripts.csmodelmerge.csmodelmerge.process(), cscripts.csmodelselect.csmodelselect.process(), cscripts.csmodelsois.csmodelsois.process(), cscripts.csobs2caldb.csobs2caldb.process(), cscripts.csobsdef.csobsdef.process(), cscripts.csobsinfo.csobsinfo.process(), cscripts.csobsselect.csobsselect.process(), cscripts.csphagen.csphagen.process(), cscripts.csphasecrv.csphasecrv.process(), cscripts.cspull.cspull.process(), cscripts.csresmap.csresmap.process(), cscripts.csresspec.csresspec.process(), cscripts.csroot2caldb.csroot2caldb.process(), cscripts.csscs.csscs.process(), cscripts.cssens.cssens.process(), cscripts.csspec.csspec.process(), cscripts.cssrcdetect.cssrcdetect.process(), cscripts.cstsdist.cstsdist.process(), cscripts.cstsmapmerge.cstsmapmerge.process(), cscripts.cstsmapsplit.cstsmapsplit.process(), cscripts.csviscube.csviscube.process(), and cscripts.csworkflow.csworkflow.process().

◆ _load_skymap()

cscripts.cssrcdetect.cssrcdetect._load_skymap ( self)
protected
Load sky map

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

Definition at line 388 of file cssrcdetect.py.

Referenced by cscripts.cssrcdetect.cssrcdetect.process().

◆ _map_moments()

cscripts.cssrcdetect.cssrcdetect._map_moments ( self,
skymap,
radius )
protected
Determine moments of sky map pixels

Parameters
----------
skymap : `~gammalib.GSkyMap()`
    Sky map
radius : float
    radius (deg) for pixel consideration

Returns
-------
mean, std : tuple of GSkyMap
    Mean and standard deviation of pixel values within a given radius

Definition at line 212 of file cssrcdetect.py.

Referenced by cscripts.cssrcdetect.cssrcdetect._detect_sources().

◆ _remove_maximum()

cscripts.cssrcdetect.cssrcdetect._remove_maximum ( self,
skymap,
pos,
value = 0.0,
radius = 0.1 )
protected
Remove maximum from sky map by replacing pixels with a given value

Parameters
----------
skymap : `~gammalib.GSkyMap()`
    Sky map
pos : `~gammalib.GSkyDir()`
    Sky direction of maximum
value : float, optional
    Replacement value
radius : float, optional
    Radius within which pixel values are replaced

Returns
-------
skymap : `~gammalib.GSkyMap()`
    Sky map with maximum removed

Definition at line 177 of file cssrcdetect.py.

References cscripts.cssrcdetect.cssrcdetect._map_dirs.

Referenced by cscripts.cssrcdetect.cssrcdetect._detect_sources().

◆ _set_bkg()

cscripts.cssrcdetect.cssrcdetect._set_bkg ( self,
modeltype )
protected
Set background model

Parameters
----------
modeltype : str
    Model type ('IRF', 'AEFF', 'CUBE' or 'RACC')

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

Definition at line 281 of file cssrcdetect.py.

Referenced by cscripts.cssrcdetect.cssrcdetect.process().

◆ _set_ptsrc()

cscripts.cssrcdetect.cssrcdetect._set_ptsrc ( self,
pos )
protected
Set point source model

Parameters
----------
pos : `~gammalib.GSkyDir()`
    Sky direction of model

Returns
-------
model : `~gammalib.GModelSky()`
    Point source model

Definition at line 322 of file cssrcdetect.py.

Referenced by cscripts.cssrcdetect.cssrcdetect._add_model().

◆ _smooth_skymap()

cscripts.cssrcdetect.cssrcdetect._smooth_skymap ( self,
skymap )
protected
Smooth the input sky map if a valid kernel was supplied

Parameters
----------
skymap : `~gammalib.GSkyMap()`
    Sky map

Definition at line 364 of file cssrcdetect.py.

Referenced by cscripts.cssrcdetect.cssrcdetect.process().

◆ models()

◆ process()

cscripts.cssrcdetect.cssrcdetect.process ( self)
Process the script

Definition at line 425 of file cssrcdetect.py.

References cscripts.cssrcdetect.cssrcdetect._cache_map_dirs(), cscripts.cssrcdetect.cssrcdetect._detect_sources(), cscripts.csadd2caldb.csadd2caldb._get_parameters(), cscripts.csbkgmodel.csbkgmodel._get_parameters(), cscripts.cscaldb.cscaldb._get_parameters(), cscripts.csebins.csebins._get_parameters(), cscripts.csfindobs.csfindobs._get_parameters(), cscripts.csfootprint.csfootprint._get_parameters(), cscripts.csiactcopy.csiactcopy._get_parameters(), cscripts.csiactdata.csiactdata._get_parameters(), cscripts.csiactobs.csiactobs._get_parameters(), cscripts.cslightcrv.cslightcrv._get_parameters(), cscripts.csmodelinfo.csmodelinfo._get_parameters(), cscripts.csmodelmerge.csmodelmerge._get_parameters(), cscripts.csmodelselect.csmodelselect._get_parameters(), cscripts.csmodelsois.csmodelsois._get_parameters(), cscripts.csobs2caldb.csobs2caldb._get_parameters(), cscripts.csobsdef.csobsdef._get_parameters(), cscripts.csobsinfo.csobsinfo._get_parameters(), cscripts.csobsselect.csobsselect._get_parameters(), cscripts.csphagen.csphagen._get_parameters(), cscripts.csphasecrv.csphasecrv._get_parameters(), cscripts.cspull.cspull._get_parameters(), cscripts.csresmap.csresmap._get_parameters(), cscripts.csresspec.csresspec._get_parameters(), cscripts.csroot2caldb.csroot2caldb._get_parameters(), cscripts.csscs.csscs._get_parameters(), cscripts.cssens.cssens._get_parameters(), cscripts.csspec.csspec._get_parameters(), cscripts.cssrcdetect.cssrcdetect._get_parameters(), cscripts.cstsdist.cstsdist._get_parameters(), cscripts.cstsmapmerge.cstsmapmerge._get_parameters(), cscripts.cstsmapsplit.cstsmapsplit._get_parameters(), cscripts.csviscube.csviscube._get_parameters(), cscripts.csworkflow.csworkflow._get_parameters(), cscripts.cssrcdetect.cssrcdetect._load_skymap(), cscripts.cssrcdetect.cssrcdetect._map, cscripts.cstsmapsplit.cstsmapsplit._map, cscripts.csbkgmodel.csbkgmodel._models, cscripts.csiactobs.csiactobs._models, cscripts.csmodelinfo.csmodelinfo._models, cscripts.csmodelmerge.csmodelmerge._models, cscripts.csmodelselect.csmodelselect._models, cscripts.csmodelsois.csmodelsois._models, cscripts.csphagen.csphagen._models, cscripts.cssens.cssens._models, cscripts.cssrcdetect.cssrcdetect._models, cscripts.cssrcdetect.cssrcdetect._set_bkg(), and cscripts.cssrcdetect.cssrcdetect._smooth_skymap().

◆ save()

cscripts.cssrcdetect.cssrcdetect.save ( self)
Save sources into model definition XML file and ds9 file

Definition at line 473 of file cssrcdetect.py.

Member Data Documentation

◆ _clobber

◆ _map

◆ _map_dirs

◆ _models

cscripts.cssrcdetect.cssrcdetect._models
protected

Definition at line 52 of file cssrcdetect.py.

Referenced by cscripts.csbkgmodel.csbkgmodel.__getstate__(), cscripts.csphagen.csphagen.__getstate__(), cscripts.cssens.cssens.__getstate__(), cscripts.csbkgmodel.csbkgmodel.__setstate__(), cscripts.csphagen.csphagen.__setstate__(), cscripts.cssens.cssens.__setstate__(), cscripts.cssrcdetect.cssrcdetect._add_model(), cscripts.csiactobs.csiactobs._append_inmodels(), cscripts.cssens.cssens._e_bin(), cscripts.csmodelsois.csmodelsois._gen_cubemodel(), cscripts.csbkgmodel.csbkgmodel._generate_runwise_bkg(), cscripts.csmodelinfo.csmodelinfo._get_parameters(), cscripts.csmodelselect.csmodelselect._get_parameters(), cscripts.csphagen.csphagen._get_parameters(), cscripts.csphagen.csphagen._get_parameters_bkgmethod_custom(), cscripts.csphagen.csphagen._get_parameters_bkgmethod_off(), cscripts.csphagen.csphagen._process_observation(), cscripts.csphagen.csphagen._set_models(), cscripts.csbkgmodel.csbkgmodel.models(), cscripts.csmodelsois.csmodelsois.models(), cscripts.cssrcdetect.cssrcdetect.models(), cscripts.csiactobs.csiactobs.obs(), cscripts.csbkgmodel.csbkgmodel.process(), cscripts.csiactobs.csiactobs.process(), cscripts.csmodelinfo.csmodelinfo.process(), cscripts.csmodelmerge.csmodelmerge.process(), cscripts.csmodelselect.csmodelselect.process(), cscripts.cssens.cssens.process(), cscripts.cssrcdetect.cssrcdetect.process(), cscripts.csbkgmodel.csbkgmodel.save(), cscripts.csiactobs.csiactobs.save(), cscripts.csmodelinfo.csmodelinfo.save(), cscripts.csmodelmerge.csmodelmerge.save(), and cscripts.csmodelsois.csmodelsois.save().


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