ctools
2.0.0
|
Public Member Functions | |
def | __init__ |
def | process |
def | save |
def | resspec |
Private Member Functions | |
def | _get_parameters |
def | _bin_evlist |
def | _masked_cube |
def | _cube_to_spectrum |
def | _residuals_table |
def | _append_column |
def | _results2table |
def | _stack_results |
def | _residuals_3D |
def | _residuals_OnOff |
Private Attributes | |
_use_maps | |
_stack | |
_mask | |
_fits | |
Generates a residual spectrum
Definition at line 30 of file csresspec.py.
def cscripts.csresspec.csresspec.__init__ | ( | self, | |
argv | |||
) |
Constructor
Definition at line 35 of file csresspec.py.
|
private |
Append optional column to residual table Parameters ---------- table : `~gammalib.GFitsBinTable' FITS binary table name : str Column name data : float Data to be filled into new column Returns ------- table : `~gammalib.GFitsBinTable' FITS binary table
Definition at line 413 of file csresspec.py.
Referenced by cscripts.csresspec.csresspec._results2table().
|
private |
Turn single event list into counts cube Parameters ---------- obs : `~gammalib.GObservations` Observation container with single event list Returns ------- obs, info : `~gammalib.GObservations`, dict Binned observation container and dictionary with event list ROI and energy range information
Definition at line 183 of file csresspec.py.
References cscripts.csresspec.csresspec._masked_cube().
Referenced by cscripts.csresspec.csresspec._residuals_3D().
|
private |
Derive from event cube a count spectrum If data come from event list use only the ROI and energy range of the original data. Apply user defined mask if requested. Parameters ---------- cube : `~gammalib.GCTAEventCube` Event cube evlist_info : dict Dictionary with information on original event list Returns ------- array : `~gammalib.GNdarray' Counts spectrum
Definition at line 303 of file csresspec.py.
References cscripts.csresspec.csresspec._mask, and cscripts.csresspec.csresspec._masked_cube().
Referenced by cscripts.csresspec.csresspec._residuals_3D().
|
private |
Get parameters from parfile and setup the observation
Definition at line 53 of file csresspec.py.
References cscripts.csresspec.csresspec._mask, cscripts.csresspec.csresspec._stack, cscripts.csresspec.csresspec._use_maps, cscripts.csresmap.csresmap._use_maps, 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.csresspec.csresspec.process(), cscripts.csscs.csscs.process(), cscripts.cssens.cssens.process(), cscripts.csspec.csspec.process(), and cscripts.csroot2caldb.csroot2caldb.process().
|
private |
Mask an event cube and returns the masked cube Parameters ---------- cube : `~gammalib.GCTAEventCube` Event cube ra : float (str 'INDEF' for no selection on direction) Right Ascension (deg) dec : float (str 'INDEF' for no selection on direction) Declination (deg) rad : float (str 'INDEF' for no selection on direction) Radius (deg) emin : float (str 'INDEF' for no selection on energy) Minimum energy (TeV) emax : float (str 'INDEF' for no selection on energy) Maximum energy (TeV) Returns ------- cube : `~gammalib.GCTAEventCube` Event cube
Definition at line 256 of file csresspec.py.
Referenced by cscripts.csresspec.csresspec._bin_evlist(), and cscripts.csresspec.csresspec._cube_to_spectrum().
|
private |
Calculate residuals for 3D observation Parameters ---------- obs : `~gammalib.GCTAObservation` CTA observation models : `~gammalib.GModels` Models obs_id : str Observation ID ccube : `~gammalib.GCTAEventCube', optional Count cube with stacked events lists Returns ------- result : dict Residual result dictionary
Definition at line 539 of file csresspec.py.
References cscripts.csresspec.csresspec._bin_evlist(), cscripts.csresspec.csresspec._cube_to_spectrum(), cscripts.csresspec.csresspec._use_maps, and cscripts.csresmap.csresmap._use_maps.
Referenced by cscripts.csresspec.csresspec.process().
|
private |
Calculate residual for OnOff observation Parameters ---------- obs : `~gammalib.GOnOffObservation` OnOff observation models : `~gammalib.GModels` Models obs_id : str Observation ID Returns ------- result : dict Residual result dictionary
Definition at line 651 of file csresspec.py.
Referenced by cscripts.csresspec.csresspec.process().
|
private |
Create a Fits Table and store counts, model, and residuals Parameters ---------- obs_id : str Observation id ebounds : `~gammalib.GEbounds' Energy boundaries counts : `~gammalib.GNdarray' Counts spectrum model : `~gammalib.GNdarray' Model spectrum residuals : `~gammalib.GNdarray' Residual spectrum Returns ------- table : `~gammalib.GFitsBinTable' Residual spectrum as FITS binary table
Definition at line 355 of file csresspec.py.
Referenced by cscripts.csresspec.csresspec._results2table().
|
private |
Turn results into FITS table Parameters ---------- result : dict Result dictionary Returns ------- table : `~gammalib.GFitsBinTable` FITS binary table
Definition at line 450 of file csresspec.py.
References cscripts.csresspec.csresspec._append_column(), and cscripts.csresspec.csresspec._residuals_table().
Referenced by cscripts.csresspec.csresspec.process().
|
private |
Stack results Parameters ---------- results : list of dict Residual spectra results Returns ------- results : list of dict Stacked result
Definition at line 496 of file csresspec.py.
Referenced by cscripts.csresspec.csresspec.process().
def cscripts.csresspec.csresspec.process | ( | self | ) |
Process the script
Definition at line 750 of file csresspec.py.
References cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._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.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.csphagen.csphagen._get_parameters(), cscripts.csresspec.csresspec._residuals_3D(), cscripts.csresspec.csresspec._residuals_OnOff(), cscripts.csresspec.csresspec._results2table(), cscripts.csresspec.csresspec._stack, cscripts.csresspec.csresspec._stack_results(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
def cscripts.csresspec.csresspec.resspec | ( | self | ) |
Return residual FITS file Returns ------- fits : `~gammalib.GFits' FITS file containing residuals
Definition at line 830 of file csresspec.py.
References cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._fits, cscripts.csphasecrv.csphasecrv._fits, and cscripts.cslightcrv.cslightcrv._fits.
def cscripts.csresspec.csresspec.save | ( | self | ) |
Save residuals
Definition at line 811 of file csresspec.py.
|
private |
Definition at line 47 of file csresspec.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.csresspec.csresspec.process(), cscripts.csscs.csscs.process(), cscripts.csspec.csspec.publish(), cscripts.csresspec.csresspec.resspec(), 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 46 of file csresspec.py.
Referenced by cscripts.csresspec.csresspec._cube_to_spectrum(), and cscripts.csresspec.csresspec._get_parameters().
|
private |
Definition at line 45 of file csresspec.py.
Referenced by cscripts.csresspec.csresspec._get_parameters(), and cscripts.csresspec.csresspec.process().
|
private |
Definition at line 44 of file csresspec.py.
Referenced by cscripts.csresspec.csresspec._get_parameters(), and cscripts.csresspec.csresspec._residuals_3D().