ctools
2.0.0
|
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 | |
def cscripts.csscs.csscs.__init__ | ( | self, | |
argv | |||
) |
def cscripts.csscs.csscs.__getstate__ | ( | self | ) |
Extend ctools.csobservation __getstate__ method Returns ------- state : dict Pickled instance
Definition at line 63 of file csscs.py.
References cscripts.csscs.csscs._excl_reg_map, cscripts.csphasecrv.csphasecrv._excl_reg_map, cscripts.cslightcrv.cslightcrv._excl_reg_map, cscripts.csscs.csscs._excl_reg_name, cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._fits, cscripts.csscs.csscs._fits, cscripts.csphasecrv.csphasecrv._fits, cscripts.cslightcrv.cslightcrv._fits, cscripts.csscs.csscs._method, cscripts.cspull.cspull._nthreads, cscripts.csscs.csscs._nthreads, cscripts.csphagen.csphagen._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, cscripts.cslightcrv.cslightcrv._nthreads, and cscripts.csscs.csscs._srcnames.
def cscripts.csscs.csscs.__setstate__ | ( | self, | |
state | |||
) |
Extend ctools.csobservation __setstate__ method Parameters ---------- state : dict Pickled instance
Definition at line 84 of file csscs.py.
References cscripts.csscs.csscs._excl_reg_map, cscripts.csphasecrv.csphasecrv._excl_reg_map, cscripts.cslightcrv.cslightcrv._excl_reg_map, cscripts.csscs.csscs._excl_reg_name, cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._fits, cscripts.csscs.csscs._fits, cscripts.csphasecrv.csphasecrv._fits, cscripts.cslightcrv.cslightcrv._fits, cscripts.csscs.csscs._method, cscripts.cspull.cspull._nthreads, cscripts.csscs.csscs._nthreads, cscripts.csphagen.csphagen._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, cscripts.cslightcrv.cslightcrv._nthreads, and cscripts.csscs.csscs._srcnames.
|
private |
Adjust model parameters
Definition at line 289 of file csscs.py.
References cscripts.csscs.csscs._method, cscripts.csscs.csscs._srcnames, ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csscs.csscs.process(), and cscripts.csspec.csspec.process().
|
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().
|
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().
|
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().
|
private |
Get parameters from parfile
Definition at line 141 of file csscs.py.
References cscripts.csscs.csscs._get_onoff_parameters(), cscripts.csscs.csscs._method, cscripts.cspull.cspull._nthreads, cscripts.csscs.csscs._nthreads, cscripts.csphagen.csphagen._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, cscripts.cslightcrv.cslightcrv._nthreads, cscripts.csscs.csscs._srcnames, ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscript_base.cscript_base.process(), cscript_like.cscript_like.process(), cscript_obs.cscript_obs.process(), cscripts.cstsmapsplit.cstsmapsplit.process(), cscripts.cstsmapmerge.cstsmapmerge.process(), cscripts.csworkflow.csworkflow.process(), cscripts.cstsdist.cstsdist.process(), cscripts.cssrcdetect.cssrcdetect.process(), cscripts.csviscube.csviscube.process(), cscripts.csscs.csscs.process(), cscripts.cssens.cssens.process(), and cscripts.csspec.csspec.process().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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 | ) |
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 | ) |
Save maps to Fits flie
Definition at line 839 of file csscs.py.
References cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._fits, cscripts.csscs.csscs._fits, cscripts.csphasecrv.csphasecrv._fits, and cscripts.cslightcrv.cslightcrv._fits.
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().
|
private |
Definition at line 56 of file csscs.py.
Referenced by cscripts.csscs.csscs.__getstate__(), cscripts.csscs.csscs.__setstate__(), cscripts.csscs.csscs._get_onoff_parameters(), and cscripts.csscs.csscs.exclusion_map().
|
private |
Definition at line 57 of file csscs.py.
Referenced by cscripts.csscs.csscs.__getstate__(), cscripts.csscs.csscs.__setstate__(), cscripts.csscs.csscs._get_onoff_parameters(), and cscripts.csscs.csscs._write_hdu_keywords().
|
private |
Definition at line 55 of file csscs.py.
Referenced by cscripts.cstsdist.cstsdist.__getstate__(), cscripts.csscs.csscs.__getstate__(), cscripts.csspec.csspec.__getstate__(), cscripts.cssens.cssens.__getstate__(), cscripts.cstsdist.cstsdist.__setstate__(), cscripts.csscs.csscs.__setstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.cssens.cssens.__setstate__(), cscripts.cstsdist.cstsdist._create_fits(), cscripts.cssens.cssens._create_fits(), cscripts.csspec.csspec._create_fits(), cscripts.csscs.csscs._get_skymap(), cscripts.csscs.csscs.process(), cscripts.csspec.csspec.publish(), cscripts.cstsdist.cstsdist.save(), cscripts.csscs.csscs.save(), cscripts.cssens.cssens.save(), cscripts.csspec.csspec.save(), cscripts.cssens.cssens.sensitivity(), cscripts.csspec.csspec.spectrum(), and cscripts.cstsdist.cstsdist.ts_distribution().
|
private |
Definition at line 54 of file csscs.py.
Referenced by cscripts.csscs.csscs.__getstate__(), cscripts.csspec.csspec.__getstate__(), cscripts.csscs.csscs.__setstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.csscs.csscs._adjust_model_pars(), cscripts.csspec.csspec._create_fits(), cscripts.csspec.csspec._get_parameters(), cscripts.csscs.csscs._get_parameters(), cscripts.csscs.csscs._mask_observations(), cscripts.csspec.csspec._profile_logL(), cscripts.csscs.csscs._write_hdu_keywords(), and cscripts.csspec.csspec.process().
|
private |
Definition at line 52 of file csscs.py.
Referenced by cscripts.cstsdist.cstsdist.__getstate__(), cscripts.csscs.csscs.__getstate__(), cscripts.csspec.csspec.__getstate__(), cscripts.cssens.cssens.__getstate__(), cscripts.cstsdist.cstsdist.__setstate__(), cscripts.csscs.csscs.__setstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.cssens.cssens.__setstate__(), cscripts.csspec.csspec._fit_energy_bins(), cscripts.cstsdist.cstsdist._get_parameters(), cscripts.csspec.csspec._get_parameters(), cscripts.cssens.cssens._get_parameters(), cscripts.csscs.csscs._get_parameters(), cscripts.cstsdist.cstsdist.process(), cscripts.csscs.csscs.process(), and cscripts.cssens.cssens.process().
|
private |
Definition at line 53 of file csscs.py.
Referenced by cscripts.csscs.csscs.__getstate__(), cscripts.csscs.csscs.__setstate__(), cscripts.csscs.csscs._adjust_model_pars(), cscripts.csscs.csscs._fill_fits(), cscripts.csscs.csscs._get_parameters(), cscripts.csscs.csscs._get_skymap(), cscripts.csscs.csscs._mask_observations(), and cscripts.csscs.csscs._pixel_analysis().