ctools
2.0.0
|
Public Member Functions | |
def | __init__ |
def | __getstate__ |
def | __setstate__ |
def | process |
def | save |
def | publish |
def | lightcurve |
def | models |
def | exclusion_map |
Private Member Functions | |
def | _get_parameters |
def | _create_tbounds |
def | _get_free_par_names |
def | _adjust_model_pars |
def | _create_fits_table |
def | _compute_ulimit |
def | _timebin |
Private Attributes | |
_srcname | |
_tbins | |
_onoff | |
_stacked | |
_fits | |
_nthreads | |
_excl_reg_map | |
Generates a lightcurve The cslightcrv class generates a light curve for Imaging Air Cherenkov Telescope event data by performing a maximum likelihood fit using ctlike in a series of time bins. The time bins can be either specified in an ASCII file, as an interval divided into equally sized time bins, or can be taken from the Good Time Intervals of the observation(s). The format of the ASCII file is one row per time bin, each specifying the start of stop value of the bin, separated by a whitespace. The times are given in Modified Julian Days (MJD). Examples: >>> lcrv = cslightcrv() >>> lcrv.run() >>> ... (querying for parameters) ... >>> fits = lcrv.lightcurve() Generates a light curve and retrieves the results in a FITS file. >>> lcrv = cslightcrv() >>> lcrv.execute() >>> ... (querying for parameters) ... Generates a light curve and saves results in a FITS file. >>> lcrv = cslightcrv(obs) >>> lcrv.execute() >>> ... (querying for parameters) ... Generates a light curve from the observations in an observation container and saves results in a FITS file.
Definition at line 33 of file cslightcrv.py.
def cscripts.cslightcrv.cslightcrv.__init__ | ( | self, | |
argv | |||
) |
Constructor
Definition at line 69 of file cslightcrv.py.
def cscripts.cslightcrv.cslightcrv.__getstate__ | ( | self | ) |
Extend ctools.csobservation getstate method to include some members Returns ------- state : dict Pickled instance
Definition at line 89 of file cslightcrv.py.
References cscripts.cslightcrv.cslightcrv._excl_reg_map, cscripts.cslightcrv.cslightcrv._fits, cscripts.cslightcrv.cslightcrv._nthreads, cscripts.cslightcrv.cslightcrv._onoff, cscripts.cslightcrv.cslightcrv._srcname, cscripts.cslightcrv.cslightcrv._stacked, and cscripts.cslightcrv.cslightcrv._tbins.
def cscripts.cslightcrv.cslightcrv.__setstate__ | ( | self, | |
state | |||
) |
Extend ctools.csobservation setstate method to include some members Parameters ---------- state : dict Pickled instance
Definition at line 111 of file cslightcrv.py.
References cscripts.cslightcrv.cslightcrv._excl_reg_map, cscripts.cslightcrv.cslightcrv._fits, cscripts.cslightcrv.cslightcrv._nthreads, cscripts.cslightcrv.cslightcrv._onoff, cscripts.cslightcrv.cslightcrv._srcname, cscripts.cslightcrv.cslightcrv._stacked, and cscripts.cslightcrv.cslightcrv._tbins.
|
private |
Adjust model parameters dependent on user parameters
Definition at line 275 of file cslightcrv.py.
References cscripts.cslightcrv.cslightcrv._srcname, cscripts.cslightcrv.cslightcrv.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.cslightcrv.cslightcrv.process(), cscripts.csscs.csscs.process(), and cscripts.csspec.csspec.process().
|
private |
Computes upper limit Parameters ---------- obs : `~gammalib.GObservations` Observation container Returns ------- ul_diff, ul_flux, ul_eflux : tuple of float Upper limits, -1.0 of not computed
Definition at line 359 of file cslightcrv.py.
References cscripts.cslightcrv.cslightcrv._srcname.
Referenced by cscripts.cslightcrv.cslightcrv._timebin().
|
private |
Creates FITS binary table containing light curve results Parameters ---------- results : list of dict List of result dictionaries Returns ------- table : `~gammalib.GFitsBinTable` FITS binary table containing light curve
Definition at line 315 of file cslightcrv.py.
References cscripts.cslightcrv.cslightcrv._srcname, cscripts.cslightcrv.cslightcrv.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csphasecrv.csphasecrv._create_fits(), and cscripts.cslightcrv.cslightcrv.process().
|
private |
Creates light curve time bins Returns ------- gti : `~gammalib.GGti` Light curve bins in form of Good Time Intervals
Definition at line 182 of file cslightcrv.py.
References ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csphasecrv.csphasecrv._get_parameters(), and cscripts.cslightcrv.cslightcrv._get_parameters().
|
private |
Return list of free parameter names Returns ------- names : list of str List of free parameter names.
Definition at line 255 of file cslightcrv.py.
References cscripts.cslightcrv.cslightcrv._srcname, cscripts.cslightcrv.cslightcrv.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csphasecrv.csphasecrv._create_fits(), and cscripts.cslightcrv.cslightcrv._timebin().
|
private |
Get parameters from parfile
Definition at line 133 of file cslightcrv.py.
References cscripts.cslightcrv.cslightcrv._create_tbounds(), cscripts.cslightcrv.cslightcrv._nthreads, cscripts.cslightcrv.cslightcrv._onoff, cscripts.cslightcrv.cslightcrv._srcname, cscripts.cslightcrv.cslightcrv._stacked, cscripts.cslightcrv.cslightcrv._tbins, cscripts.cslightcrv.cslightcrv.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
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.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().
|
private |
Run likelihood analysis in one time bin Parameters ---------- i : int time bin number Returns ------- result : dict Results of the likelihood analysis
Definition at line 421 of file cslightcrv.py.
References cscripts.cslightcrv.cslightcrv._compute_ulimit(), cscripts.cslightcrv.cslightcrv._get_free_par_names(), cscripts.cslightcrv.cslightcrv._onoff, cscripts.cslightcrv.cslightcrv._srcname, cscripts.cslightcrv.cslightcrv._stacked, cscripts.cslightcrv.cslightcrv.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.cslightcrv.cslightcrv.process().
def cscripts.cslightcrv.cslightcrv.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 763 of file cslightcrv.py.
References cscripts.cslightcrv.cslightcrv._excl_reg_map.
def cscripts.cslightcrv.cslightcrv.lightcurve | ( | self | ) |
Return light curve FITS file Returns ------- fits : `~gammalib.GFits()` FITS file containing light curve
Definition at line 736 of file cslightcrv.py.
References cscripts.cslightcrv.cslightcrv._fits.
def cscripts.cslightcrv.cslightcrv.models | ( | self, | |
models | |||
) |
Set model Parameters ---------- models : `~gammalib.GModels()` Set model container
Definition at line 748 of file cslightcrv.py.
References ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.cslightcrv.cslightcrv._adjust_model_pars(), cscripts.cslightcrv.cslightcrv._create_fits_table(), cscripts.cslightcrv.cslightcrv._get_free_par_names(), cscripts.cslightcrv.cslightcrv._get_parameters(), cscripts.cslightcrv.cslightcrv._timebin(), and cscripts.cstsdist.cstsdist.process().
def cscripts.cslightcrv.cslightcrv.process | ( | self | ) |
Process the script
Definition at line 608 of file cslightcrv.py.
References cscripts.cslightcrv.cslightcrv._adjust_model_pars(), cscripts.cslightcrv.cslightcrv._create_fits_table(), cscripts.cslightcrv.cslightcrv._fits, cscripts.csadd2caldb.csadd2caldb._get_parameters(), cscripts.csebins.csebins._get_parameters(), cscripts.csfindobs.csfindobs._get_parameters(), cscripts.csiactdata.csiactdata._get_parameters(), cscripts.csiactcopy.csiactcopy._get_parameters(), cscripts.cscaldb.cscaldb._get_parameters(), cscripts.csbkgmodel.csbkgmodel._get_parameters(), cscripts.csfootprint.csfootprint._get_parameters(), cscripts.csiactobs.csiactobs._get_parameters(), cscripts.cslightcrv.cslightcrv._get_parameters(), cscripts.cslightcrv.cslightcrv._nthreads, cscripts.cslightcrv.cslightcrv._timebin(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), cscripts.csiactobs.csiactobs.obs(), and cscripts.cslightcrv.cslightcrv.publish().
def cscripts.cslightcrv.cslightcrv.publish | ( | self, | |
name = '' |
|||
) |
Publish light curve Parameters ---------- name : str, optional Name of light curve
Definition at line 706 of file cslightcrv.py.
Referenced by cscripts.csresmap.csresmap.process(), cscripts.csphasecrv.csphasecrv.process(), cscripts.cslightcrv.cslightcrv.process(), cscripts.csviscube.csviscube.process(), and cscripts.csspec.csspec.process().
def cscripts.cslightcrv.cslightcrv.save | ( | self | ) |
Save light curve
Definition at line 684 of file cslightcrv.py.
References cscripts.csmodelmerge.csmodelmerge._clobber.
|
private |
Definition at line 83 of file cslightcrv.py.
Referenced by cscripts.csscs.csscs.__getstate__(), cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.cslightcrv.cslightcrv.__getstate__(), cscripts.csscs.csscs.__setstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.cslightcrv.cslightcrv.__setstate__(), cscripts.csscs.csscs._get_onoff_parameters(), cscripts.csphasecrv.csphasecrv.exclusion_map(), cscripts.cslightcrv.cslightcrv.exclusion_map(), and cscripts.csscs.csscs.exclusion_map().
|
private |
Definition at line 81 of file cslightcrv.py.
Referenced by cscripts.cspull.cspull.__getstate__(), cscripts.cstsdist.cstsdist.__getstate__(), cscripts.csscs.csscs.__getstate__(), cscripts.csspec.csspec.__getstate__(), cscripts.cssens.cssens.__getstate__(), cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.cslightcrv.cslightcrv.__getstate__(), cscripts.cspull.cspull.__setstate__(), cscripts.cstsdist.cstsdist.__setstate__(), cscripts.csscs.csscs.__setstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.cssens.cssens.__setstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.cslightcrv.cslightcrv.__setstate__(), cscripts.csphasecrv.csphasecrv._create_fits(), cscripts.cstsdist.cstsdist._create_fits(), cscripts.cspull.cspull._create_fits(), cscripts.cssens.cssens._create_fits(), cscripts.csspec.csspec._create_fits(), cscripts.csscs.csscs._get_skymap(), cscripts.cslightcrv.cslightcrv.lightcurve(), cscripts.cslightcrv.cslightcrv.process(), cscripts.csresspec.csresspec.process(), cscripts.csscs.csscs.process(), cscripts.csspec.csspec.publish(), cscripts.cspull.cspull.pull_distribution(), cscripts.csresspec.csresspec.resspec(), cscripts.cstsdist.cstsdist.save(), cscripts.cspull.cspull.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 82 of file cslightcrv.py.
Referenced by cscripts.cspull.cspull.__getstate__(), cscripts.cstsdist.cstsdist.__getstate__(), cscripts.csscs.csscs.__getstate__(), cscripts.csspec.csspec.__getstate__(), cscripts.csphagen.csphagen.__getstate__(), cscripts.cssens.cssens.__getstate__(), cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.cslightcrv.cslightcrv.__getstate__(), cscripts.cspull.cspull.__setstate__(), cscripts.cstsdist.cstsdist.__setstate__(), cscripts.csscs.csscs.__setstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.cssens.cssens.__setstate__(), cscripts.csphagen.csphagen.__setstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.cslightcrv.cslightcrv.__setstate__(), cscripts.csspec.csspec._fit_energy_bins(), 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.cstsdist.cstsdist.process(), cscripts.cspull.cspull.process(), cscripts.csphasecrv.csphasecrv.process(), cscripts.cslightcrv.cslightcrv.process(), cscripts.csscs.csscs.process(), cscripts.csphagen.csphagen.process(), and cscripts.cssens.cssens.process().
|
private |
Definition at line 79 of file cslightcrv.py.
Referenced by cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.cslightcrv.cslightcrv.__getstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.cslightcrv.cslightcrv.__setstate__(), cscripts.csphasecrv.csphasecrv._get_parameters(), cscripts.cslightcrv.cslightcrv._get_parameters(), cscripts.csphasecrv.csphasecrv._phase_bin(), and cscripts.cslightcrv.cslightcrv._timebin().
|
private |
Definition at line 77 of file cslightcrv.py.
Referenced by cscripts.cstsdist.cstsdist.__getstate__(), cscripts.csphagen.csphagen.__getstate__(), cscripts.cssens.cssens.__getstate__(), cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.cslightcrv.cslightcrv.__getstate__(), cscripts.cstsdist.cstsdist.__setstate__(), cscripts.cssens.cssens.__setstate__(), cscripts.csphagen.csphagen.__setstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.cslightcrv.cslightcrv.__setstate__(), cscripts.cslightcrv.cslightcrv._adjust_model_pars(), cscripts.cstsmapsplit.cstsmapsplit._compute_null_hypothesis(), cscripts.cslightcrv.cslightcrv._compute_ulimit(), cscripts.csphasecrv.csphasecrv._create_fits(), cscripts.cssens.cssens._create_fits(), cscripts.csphasecrv.csphasecrv._create_fits_table(), cscripts.cslightcrv.cslightcrv._create_fits_table(), cscripts.csphasecrv.csphasecrv._get_free_par_names(), cscripts.cslightcrv.cslightcrv._get_free_par_names(), cscripts.cstsmapsplit.cstsmapsplit._get_parameters(), cscripts.cstsdist.cstsdist._get_parameters(), cscripts.csphasecrv.csphasecrv._get_parameters(), cscripts.cslightcrv.cslightcrv._get_parameters(), cscripts.csphagen.csphagen._get_parameters(), cscripts.cssens.cssens._get_sensitivity(), cscripts.csphagen.csphagen._process_observation(), cscripts.cssens.cssens._set_source(), cscripts.cssens.cssens._set_src_prefactor(), cscripts.cssens.cssens._sim_evt_excess(), cscripts.cslightcrv.cslightcrv._timebin(), cscripts.cstsdist.cstsdist._trial(), cscripts.cstsmapsplit.cstsmapsplit.process(), cscripts.cstsdist.cstsdist.process(), and cscripts.cssens.cssens.process().
|
private |
Definition at line 80 of file cslightcrv.py.
Referenced by cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.cslightcrv.cslightcrv.__getstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.cslightcrv.cslightcrv.__setstate__(), cscripts.csphasecrv.csphasecrv._get_parameters(), cscripts.cslightcrv.cslightcrv._get_parameters(), cscripts.csphasecrv.csphasecrv._phase_bin(), and cscripts.cslightcrv.cslightcrv._timebin().
|
private |
Definition at line 78 of file cslightcrv.py.
Referenced by cscripts.cslightcrv.cslightcrv.__getstate__(), cscripts.cslightcrv.cslightcrv.__setstate__(), and cscripts.cslightcrv.cslightcrv._get_parameters().