ctools
2.0.0
|
Public Member Functions | |
def | __init__ |
def | __getstate__ |
def | __setstate__ |
def | process |
def | save |
def | publish |
def | phasecurve |
def | exclusion_map |
Private Member Functions | |
def | _get_parameters |
def | _create_tbounds |
def | _get_free_par_names |
def | _create_fits_table |
def | _create_fits |
def | _save_fits |
def | _save_xml |
def | _phase_bin |
Private Attributes | |
_srcname | |
_phbins | |
_onoff | |
_stacked | |
_fits | |
_fitmodels | |
_nthreads | |
_excl_reg_map | |
Generates spectra in phase bins This script computes spectra by performing a maximum likelihood fit using :doc:`ctlike` in a series of phase bins for pulsars. The phase bins can be either specified in an ASCII file or as an interval divided into equally sized phase bins. Examples: >>> phcrv = csphasecrv() >>> phcrv.run() >>> ... (querying for parameters) ... >>> phcrv = phrv.phasecrv() Generates phase fits and retrieves dictionary with best fit models. >>> phcrv = csphasecrv(obs) >>> phcrv.execute() >>> ... (querying for parameters) ... Generates phase fits from the observations and saves results in XML files.
Definition at line 32 of file csphasecrv.py.
def cscripts.csphasecrv.csphasecrv.__init__ | ( | self, | |
argv | |||
) |
Constructor
Definition at line 56 of file csphasecrv.py.
def cscripts.csphasecrv.csphasecrv.__getstate__ | ( | self | ) |
Extend ctools.csobservation getstate method to include some members Returns ------- state : dict Pickled instance
Definition at line 78 of file csphasecrv.py.
References cscripts.csphasecrv.csphasecrv._excl_reg_map, cscripts.cslightcrv.cslightcrv._excl_reg_map, cscripts.csphasecrv.csphasecrv._fitmodels, cscripts.csphasecrv.csphasecrv._fits, cscripts.cslightcrv.cslightcrv._fits, cscripts.csphagen.csphagen._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, cscripts.cslightcrv.cslightcrv._nthreads, cscripts.csphasecrv.csphasecrv._onoff, cscripts.cslightcrv.cslightcrv._onoff, cscripts.csphasecrv.csphasecrv._phbins, cscripts.csphagen.csphagen._srcname, cscripts.csphasecrv.csphasecrv._srcname, cscripts.cslightcrv.cslightcrv._srcname, cscripts.csphasecrv.csphasecrv._stacked, and cscripts.cslightcrv.cslightcrv._stacked.
def cscripts.csphasecrv.csphasecrv.__setstate__ | ( | self, | |
state | |||
) |
Extend ctools.csobservation setstate method to include some members Parameters ---------- state : dict Pickled instance
Definition at line 101 of file csphasecrv.py.
References cscripts.csphasecrv.csphasecrv._excl_reg_map, cscripts.cslightcrv.cslightcrv._excl_reg_map, cscripts.csphasecrv.csphasecrv._fitmodels, cscripts.csphasecrv.csphasecrv._fits, cscripts.cslightcrv.cslightcrv._fits, cscripts.csphagen.csphagen._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, cscripts.cslightcrv.cslightcrv._nthreads, cscripts.csphasecrv.csphasecrv._onoff, cscripts.cslightcrv.cslightcrv._onoff, cscripts.csphasecrv.csphasecrv._phbins, cscripts.csphagen.csphagen._srcname, cscripts.csphasecrv.csphasecrv._srcname, cscripts.cslightcrv.cslightcrv._srcname, cscripts.csphasecrv.csphasecrv._stacked, and cscripts.cslightcrv.cslightcrv._stacked.
|
private |
Create FITS file object from fit results
Definition at line 272 of file csphasecrv.py.
References cscripts.csphasecrv.csphasecrv._create_fits_table(), cscripts.cslightcrv.cslightcrv._create_fits_table(), cscripts.csphasecrv.csphasecrv._fitmodels, cscripts.csphasecrv.csphasecrv._fits, cscripts.cslightcrv.cslightcrv._fits, cscripts.csphasecrv.csphasecrv._get_free_par_names(), cscripts.cslightcrv.cslightcrv._get_free_par_names(), cscripts.csphasecrv.csphasecrv._phbins, cscripts.csphagen.csphagen._srcname, cscripts.csphasecrv.csphasecrv._srcname, and cscripts.cslightcrv.cslightcrv._srcname.
Referenced by cscripts.csphasecrv.csphasecrv._save_fits(), cscripts.cstsdist.cstsdist.process(), cscripts.cspull.cspull.process(), cscripts.csphasecrv.csphasecrv.process(), cscripts.cssens.cssens.process(), and cscripts.csspec.csspec.process().
|
private |
Creates FITS binary table containing phase curve results Parameters ---------- results : list of dict List of result dictionaries Returns ------- table : `~gammalib.GFitsBinTable` FITS binary table containing phase curve
Definition at line 240 of file csphasecrv.py.
References cscripts.csphagen.csphagen._srcname, cscripts.csphasecrv.csphasecrv._srcname, cscripts.cslightcrv.cslightcrv._srcname, ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csphasecrv.csphasecrv._create_fits().
|
private |
Creates phase bins Returns ------- phbins : `[]` List of phase bins
Definition at line 169 of file csphasecrv.py.
Referenced by cscripts.csphasecrv.csphasecrv._get_parameters().
|
private |
Return list of free parameter names Returns ------- names : list of str List of free parameter names.
Definition at line 220 of file csphasecrv.py.
References cscripts.csphagen.csphagen._srcname, cscripts.csphasecrv.csphasecrv._srcname, cscripts.cslightcrv.cslightcrv._srcname, ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csphasecrv.csphasecrv._create_fits().
|
private |
Get parameters from parfile
Definition at line 124 of file csphasecrv.py.
References cscripts.csphasecrv.csphasecrv._create_tbounds(), cscripts.cslightcrv.cslightcrv._create_tbounds(), cscripts.csphagen.csphagen._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, cscripts.cslightcrv.cslightcrv._nthreads, cscripts.csphasecrv.csphasecrv._onoff, cscripts.cslightcrv.cslightcrv._onoff, cscripts.csphasecrv.csphasecrv._phbins, cscripts.csphagen.csphagen._srcname, cscripts.csphasecrv.csphasecrv._srcname, cscripts.cslightcrv.cslightcrv._srcname, cscripts.csphasecrv.csphasecrv._stacked, cscripts.cslightcrv.cslightcrv._stacked, 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.csresmap.csresmap.process(), cscripts.cstsmapmerge.cstsmapmerge.process(), cscripts.csworkflow.csworkflow.process(), cscripts.cstsdist.cstsdist.process(), cscripts.cssrcdetect.cssrcdetect.process(), cscripts.cspull.cspull.process(), cscripts.csphasecrv.csphasecrv.process(), cscripts.csviscube.csviscube.process(), cscripts.csresspec.csresspec.process(), cscripts.csscs.csscs.process(), cscripts.cssens.cssens.process(), cscripts.csspec.csspec.process(), and cscripts.csroot2caldb.csroot2caldb.process().
|
private |
Analyse one phase bin Parameters ---------- phbin : list of float Phase bin limits
Definition at line 378 of file csphasecrv.py.
References cscripts.csphasecrv.csphasecrv._onoff, cscripts.cslightcrv.cslightcrv._onoff, cscripts.csphasecrv.csphasecrv._stacked, cscripts.cslightcrv.cslightcrv._stacked, ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csphasecrv.csphasecrv.process().
|
private |
Saved phase fit results into a fits file
Definition at line 327 of file csphasecrv.py.
References cscripts.csmodelmerge.csmodelmerge._clobber, and cscripts.csphasecrv.csphasecrv._create_fits().
Referenced by cscripts.csphasecrv.csphasecrv.save().
|
private |
Save phase fit results into one XML model each bin
Definition at line 349 of file csphasecrv.py.
References cscripts.csphasecrv.csphasecrv._fitmodels, cscripts.csphasecrv.csphasecrv._phbins, and cscripts.csphasecrv.csphasecrv.save().
Referenced by cscripts.csphasecrv.csphasecrv.save().
def cscripts.csphasecrv.csphasecrv.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 558 of file csphasecrv.py.
References cscripts.csphasecrv.csphasecrv._excl_reg_map, and cscripts.cslightcrv.cslightcrv._excl_reg_map.
def cscripts.csphasecrv.csphasecrv.phasecurve | ( | self | ) |
Return dictionary with best fit models
Definition at line 551 of file csphasecrv.py.
References cscripts.csphasecrv.csphasecrv._fitmodels.
def cscripts.csphasecrv.csphasecrv.process | ( | self | ) |
Process the script
Definition at line 464 of file csphasecrv.py.
References cscripts.csphasecrv.csphasecrv._create_fits(), cscripts.csphasecrv.csphasecrv._fitmodels, cscripts.csobsselect.csobsselect._get_parameters(), cscripts.csadd2caldb.csadd2caldb._get_parameters(), cscripts.csebins.csebins._get_parameters(), cscripts.csmodelselect.csmodelselect._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.csmodelsois.csmodelsois._get_parameters(), cscripts.cscaldb.cscaldb._get_parameters(), cscripts.csobs2caldb.csobs2caldb._get_parameters(), cscripts.csbkgmodel.csbkgmodel._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.csphagen.csphagen._get_parameters(), cscripts.csphagen.csphagen._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, cscripts.cslightcrv.cslightcrv._nthreads, cscripts.csphasecrv.csphasecrv._phase_bin(), cscripts.csphasecrv.csphasecrv._phbins, ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), cscripts.csiactobs.csiactobs.obs(), cscripts.csphasecrv.csphasecrv.publish(), and cscripts.cslightcrv.cslightcrv.publish().
def cscripts.csphasecrv.csphasecrv.publish | ( | self, | |
name = '' |
|||
) |
Publish phase curve Parameters ---------- name : str, optional Name of phase curve
Definition at line 521 of file csphasecrv.py.
Referenced by cscripts.csresmap.csresmap.process(), cscripts.csphasecrv.csphasecrv.process(), cscripts.csviscube.csviscube.process(), and cscripts.csspec.csspec.process().
def cscripts.csphasecrv.csphasecrv.save | ( | self | ) |
Saves results to fits and XML
Definition at line 508 of file csphasecrv.py.
References cscripts.csphasecrv.csphasecrv._save_fits(), and cscripts.csphasecrv.csphasecrv._save_xml().
Referenced by cscripts.csphasecrv.csphasecrv._save_xml().
|
private |
Definition at line 72 of file csphasecrv.py.
Referenced by cscripts.csscs.csscs.__getstate__(), cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.csscs.csscs.__setstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.csscs.csscs._get_onoff_parameters(), cscripts.csphasecrv.csphasecrv.exclusion_map(), and cscripts.csscs.csscs.exclusion_map().
|
private |
Definition at line 70 of file csphasecrv.py.
Referenced by cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.csphasecrv.csphasecrv._create_fits(), cscripts.csphasecrv.csphasecrv._save_xml(), cscripts.csphasecrv.csphasecrv.phasecurve(), and cscripts.csphasecrv.csphasecrv.process().
|
private |
Definition at line 69 of file csphasecrv.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.cspull.cspull.__setstate__(), cscripts.cstsdist.cstsdist.__setstate__(), cscripts.csscs.csscs.__setstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.cssens.cssens.__setstate__(), cscripts.csphasecrv.csphasecrv.__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.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 71 of file csphasecrv.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.cspull.cspull.__setstate__(), cscripts.cstsdist.cstsdist.__setstate__(), cscripts.csscs.csscs.__setstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.cssens.cssens.__setstate__(), cscripts.csphasecrv.csphasecrv.__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.csscs.csscs._get_parameters(), cscripts.cstsdist.cstsdist.process(), cscripts.cspull.cspull.process(), cscripts.csphasecrv.csphasecrv.process(), cscripts.csscs.csscs.process(), and cscripts.cssens.cssens.process().
|
private |
Definition at line 67 of file csphasecrv.py.
Referenced by cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.csphasecrv.csphasecrv._get_parameters(), and cscripts.csphasecrv.csphasecrv._phase_bin().
|
private |
Definition at line 66 of file csphasecrv.py.
Referenced by cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.csphasecrv.csphasecrv._create_fits(), cscripts.csphasecrv.csphasecrv._get_parameters(), cscripts.csphasecrv.csphasecrv._save_xml(), and cscripts.csphasecrv.csphasecrv.process().
|
private |
Definition at line 65 of file csphasecrv.py.
Referenced by cscripts.cstsdist.cstsdist.__getstate__(), cscripts.cssens.cssens.__getstate__(), cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.cstsdist.cstsdist.__setstate__(), cscripts.cssens.cssens.__setstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.cstsmapsplit.cstsmapsplit._compute_null_hypothesis(), cscripts.csphasecrv.csphasecrv._create_fits(), cscripts.cssens.cssens._create_fits(), cscripts.csphasecrv.csphasecrv._create_fits_table(), cscripts.csphasecrv.csphasecrv._get_free_par_names(), cscripts.cstsmapsplit.cstsmapsplit._get_parameters(), cscripts.cstsdist.cstsdist._get_parameters(), cscripts.csphasecrv.csphasecrv._get_parameters(), cscripts.cssens.cssens._get_sensitivity(), cscripts.cssens.cssens._set_source(), cscripts.cssens.cssens._set_src_prefactor(), cscripts.cssens.cssens._sim_evt_excess(), cscripts.cstsdist.cstsdist._trial(), cscripts.cstsmapsplit.cstsmapsplit.process(), cscripts.cstsdist.cstsdist.process(), and cscripts.cssens.cssens.process().
|
private |
Definition at line 68 of file csphasecrv.py.
Referenced by cscripts.csphasecrv.csphasecrv.__getstate__(), cscripts.csphasecrv.csphasecrv.__setstate__(), cscripts.csphasecrv.csphasecrv._get_parameters(), and cscripts.csphasecrv.csphasecrv._phase_bin().