ctools
2.0.0
|
Public Member Functions | |
def | __init__ |
def | __del__ |
def | __getstate__ |
def | __setstate__ |
def | process |
def | save |
def | publish |
def | spectrum |
def | models |
Private Member Functions | |
def | _get_parameters |
def | _set_ebounds |
def | _log_spectral_binning |
def | _adjust_model_pars |
def | _set_replace_src_spectrum_by_nodes |
def | _set_replace_src_spectrum_by_bins |
def | _select_onoff_obs |
def | _select_obs |
def | _fit_energy_bin |
def | _fit_energy_bins |
def | _fit_model |
def | _profile_logL |
def | _create_fits |
Private Attributes | |
_ebounds | |
_fits | |
_binned_mode | |
_onoff_mode | |
_method | |
_nthreads | |
Generates a spectrum This class implements the generation of a Spectral Energy Distribution (SED) from gamma-ray observations.
def cscripts.csspec.csspec.__init__ | ( | self, | |
argv | |||
) |
def cscripts.csspec.csspec.__getstate__ | ( | self | ) |
Extend ctools.csobservation getstate method to include some members Returns ------- state : dict Pickled instance
Definition at line 67 of file csspec.py.
References cscripts.csspec.csspec._binned_mode, cscripts.csebins.csebins._ebounds, cscripts.csphagen.csphagen._ebounds, cscripts.csspec.csspec._ebounds, cscripts.csobsinfo.csobsinfo._ebounds, cscripts.csiactobs.csiactobs._ebounds, cscripts.cssens.cssens._ebounds, cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._fits, cscripts.csspec.csspec._fits, cscripts.csscs.csscs._fits, cscripts.cssens.cssens._fits, cscripts.csphasecrv.csphasecrv._fits, cscripts.cslightcrv.cslightcrv._fits, cscripts.csspec.csspec._method, cscripts.csscs.csscs._method, cscripts.cspull.cspull._nthreads, cscripts.csscs.csscs._nthreads, cscripts.csspec.csspec._nthreads, cscripts.csphagen.csphagen._nthreads, cscripts.cssens.cssens._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, cscripts.cslightcrv.cslightcrv._nthreads, and cscripts.csspec.csspec._onoff_mode.
def cscripts.csspec.csspec.__setstate__ | ( | self, | |
state | |||
) |
Extend ctools.csobservation setstate method to include some members Parameters ---------- state : dict Pickled instance
Definition at line 88 of file csspec.py.
References cscripts.csspec.csspec._binned_mode, cscripts.csebins.csebins._ebounds, cscripts.csphagen.csphagen._ebounds, cscripts.csspec.csspec._ebounds, cscripts.csobsinfo.csobsinfo._ebounds, cscripts.csiactobs.csiactobs._ebounds, cscripts.cssens.cssens._ebounds, cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._fits, cscripts.csspec.csspec._fits, cscripts.csscs.csscs._fits, cscripts.cssens.cssens._fits, cscripts.csphasecrv.csphasecrv._fits, cscripts.cslightcrv.cslightcrv._fits, cscripts.csspec.csspec._method, cscripts.csscs.csscs._method, cscripts.cspull.cspull._nthreads, cscripts.csscs.csscs._nthreads, cscripts.csspec.csspec._nthreads, cscripts.csphagen.csphagen._nthreads, cscripts.cssens.cssens._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, cscripts.cslightcrv.cslightcrv._nthreads, and cscripts.csspec.csspec._onoff_mode.
|
private |
Adjust model parameters
Definition at line 346 of file csspec.py.
References cscripts.csspec.csspec.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csspec.csspec.process().
|
private |
Create FITS file Parameters ---------- results : list of dict List of result dictionaries
Definition at line 1135 of file csspec.py.
References cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._fits, cscripts.csspec.csspec._fits, cscripts.csscs.csscs._fits, cscripts.cssens.cssens._fits, cscripts.csphasecrv.csphasecrv._fits, cscripts.cslightcrv.cslightcrv._fits, cscripts.csspec.csspec._method, and cscripts.csscs.csscs._method.
Referenced by cscripts.cstsdist.cstsdist.process(), and cscripts.csspec.csspec.process().
|
private |
Fit data for one energy bin Parameters ---------- i : int Energy bin index Returns ------- result : dict Dictionary with fit results
Definition at line 699 of file csspec.py.
References cscripts.csspec.csspec._binned_mode, cscripts.csspec.csspec._onoff_mode, cscripts.csspec.csspec._profile_logL(), cscripts.csspec.csspec._select_obs(), cscripts.csspec.csspec.models(), and cscripts.csspec.csspec.spectrum().
Referenced by cscripts.csspec.csspec._fit_energy_bins().
|
private |
Fit model to energy bins Returns ------- results : list of dict List of dictionaries with fit results
Definition at line 858 of file csspec.py.
References cscripts.csebins.csebins._ebounds, cscripts.csphagen.csphagen._ebounds, cscripts.csspec.csspec._ebounds, cscripts.csobsinfo.csobsinfo._ebounds, cscripts.csiactobs.csiactobs._ebounds, cscripts.cssens.cssens._ebounds, cscripts.csspec.csspec._fit_energy_bin(), cscripts.cspull.cspull._nthreads, cscripts.csscs.csscs._nthreads, cscripts.csspec.csspec._nthreads, cscripts.csphagen.csphagen._nthreads, cscripts.cssens.cssens._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, and cscripts.cslightcrv.cslightcrv._nthreads.
Referenced by cscripts.csspec.csspec.process().
|
private |
Fit model to observations Returns ------- results : list of dict List of dictionaries with fit results
Definition at line 900 of file csspec.py.
References cscripts.csspec.csspec._profile_logL(), cscripts.csspec.csspec.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csspec.csspec.process().
|
private |
Get parameters from parfile and setup the observation
Definition at line 110 of file csspec.py.
References cscripts.csspec.csspec._binned_mode, cscripts.csspec.csspec._method, cscripts.csscs.csscs._method, cscripts.cspull.cspull._nthreads, cscripts.csscs.csscs._nthreads, cscripts.csspec.csspec._nthreads, cscripts.csphagen.csphagen._nthreads, cscripts.cssens.cssens._nthreads, cscripts.csphasecrv.csphasecrv._nthreads, cscripts.cslightcrv.cslightcrv._nthreads, cscripts.csspec.csspec._onoff_mode, cscripts.csebins.csebins._set_ebounds(), cscripts.csspec.csspec._set_ebounds(), cscripts.csspec.csspec.models(), 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(), and cscripts.csspec.csspec.process().
|
private |
Log spectral binning
Definition at line 314 of file csspec.py.
References cscripts.csspec.csspec._binned_mode, cscripts.csspec.csspec._onoff_mode, ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csspec.csspec.process().
|
private |
Computes the delta log-likelihood profile in a single energy bin Parameters ---------- like : `~ctools.ctlike()` ctlike fitter containing prefit model parname : str Name of the spectral parameter to be fit elogmean : `~gammalib.GEnergy()` Energy at which the model is to be evaluated Returns ------- norm_scan : list Normalization values dloglike_scan : list Computed loglikelihood values loglike: float Computed reference log-likelihood for dloglike_scan
Definition at line 1050 of file csspec.py.
References cscripts.csspec.csspec._method, cscripts.csscs.csscs._method, and cscripts.csspec.csspec.models().
Referenced by cscripts.csspec.csspec._fit_energy_bin(), and cscripts.csspec.csspec._fit_model().
|
private |
Select observations for energy interval Parameters ---------- emin : `~gammalib.GEnergy()` Minimum energy emax : `~gammalib.GEnergy()` Maximum energy Returns ------- obs : `~gammalib.GObservations` Observation container
Definition at line 609 of file csspec.py.
References cscripts.csspec.csspec._binned_mode, cscripts.csspec.csspec._onoff_mode, cscripts.csspec.csspec._select_onoff_obs(), cscripts.csspec.csspec.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csspec.csspec._fit_energy_bin().
|
private |
Select an energy interval from one CTA On/Off observation Parameters ---------- obs : `~gammalib.GCTAOnOffObservation` Minimum energy emin : `~gammalib.GEnergy()` Minimum energy emax : `~gammalib.GEnergy()` Maximum energy Returns ------- obs : `~gammalib.GCTAOnOffObservation` CTA On/Off observation
Definition at line 532 of file csspec.py.
Referenced by cscripts.csspec.csspec._select_obs().
|
private |
Set energy boundaries
Definition at line 237 of file csspec.py.
References cscripts.csspec.csspec._binned_mode, cscripts.csebins.csebins._ebounds, cscripts.csphagen.csphagen._ebounds, cscripts.csspec.csspec._ebounds, cscripts.csobsinfo.csobsinfo._ebounds, cscripts.csiactobs.csiactobs._ebounds, cscripts.cssens.cssens._ebounds, cscripts.csspec.csspec._onoff_mode, ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csspec.csspec._get_parameters().
|
private |
Replace source spectrum by bin function
Definition at line 474 of file csspec.py.
References cscripts.csebins.csebins._ebounds, cscripts.csphagen.csphagen._ebounds, cscripts.csspec.csspec._ebounds, cscripts.csobsinfo.csobsinfo._ebounds, cscripts.csiactobs.csiactobs._ebounds, cscripts.cssens.cssens._ebounds, cscripts.csspec.csspec.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csspec.csspec.process().
|
private |
Replace source spectrum by node function
Definition at line 417 of file csspec.py.
References cscripts.csspec.csspec.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csspec.csspec.process().
def cscripts.csspec.csspec.models | ( | self, | |
models | |||
) |
Set model
Definition at line 1384 of file csspec.py.
References ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), and cscripts.csiactobs.csiactobs.obs().
Referenced by cscripts.csspec.csspec._adjust_model_pars(), cscripts.csspec.csspec._fit_energy_bin(), cscripts.csspec.csspec._fit_model(), cscripts.csspec.csspec._get_parameters(), cscripts.csspec.csspec._profile_logL(), cscripts.csspec.csspec._select_obs(), cscripts.csspec.csspec._set_replace_src_spectrum_by_bins(), cscripts.csspec.csspec._set_replace_src_spectrum_by_nodes(), cscripts.cstsdist.cstsdist.process(), and cscripts.csspec.csspec.process().
def cscripts.csspec.csspec.process | ( | self | ) |
Process the script
Definition at line 1258 of file csspec.py.
References cscripts.cslightcrv.cslightcrv._adjust_model_pars(), cscripts.csscs.csscs._adjust_model_pars(), cscripts.csspec.csspec._adjust_model_pars(), cscripts.csphasecrv.csphasecrv._create_fits(), cscripts.cspull.cspull._create_fits(), cscripts.cssens.cssens._create_fits(), cscripts.csspec.csspec._create_fits(), cscripts.csspec.csspec._fit_energy_bins(), cscripts.csspec.csspec._fit_model(), 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.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.csspec.csspec._log_spectral_binning(), cscripts.csspec.csspec._method, cscripts.csscs.csscs._method, cscripts.csspec.csspec._set_replace_src_spectrum_by_bins(), cscripts.csspec.csspec._set_replace_src_spectrum_by_nodes(), cscripts.csspec.csspec.models(), ctobservation.obs(), cscripts.csobsdef.csobsdef.obs(), cscripts.csiactobs.csiactobs.obs(), cscripts.csresmap.csresmap.publish(), cscripts.csphasecrv.csphasecrv.publish(), cscripts.cslightcrv.cslightcrv.publish(), and cscripts.csspec.csspec.publish().
def cscripts.csspec.csspec.publish | ( | self, | |
name = '' |
|||
) |
Publish spectrum Parameters ---------- name : str, optional Name of spectrum
Definition at line 1341 of file csspec.py.
References cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._fits, cscripts.csspec.csspec._fits, cscripts.csscs.csscs._fits, cscripts.cssens.cssens._fits, cscripts.csphasecrv.csphasecrv._fits, and cscripts.cslightcrv.cslightcrv._fits.
Referenced by cscripts.csviscube.csviscube.process(), and cscripts.csspec.csspec.process().
def cscripts.csspec.csspec.save | ( | self | ) |
Save spectrum
Definition at line 1319 of file csspec.py.
References cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._fits, cscripts.csspec.csspec._fits, cscripts.csscs.csscs._fits, cscripts.cssens.cssens._fits, cscripts.csphasecrv.csphasecrv._fits, and cscripts.cslightcrv.cslightcrv._fits.
def cscripts.csspec.csspec.spectrum | ( | self | ) |
Return spectrum FITS file Returns: FITS file containing spectrum
Definition at line 1374 of file csspec.py.
References cscripts.cspull.cspull._fits, cscripts.csresspec.csresspec._fits, cscripts.csspec.csspec._fits, cscripts.csscs.csscs._fits, cscripts.cssens.cssens._fits, cscripts.csphasecrv.csphasecrv._fits, and cscripts.cslightcrv.cslightcrv._fits.
Referenced by cscripts.csspec.csspec._fit_energy_bin().
|
private |
Definition at line 51 of file csspec.py.
Referenced by cscripts.csspec.csspec.__getstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.csspec.csspec._fit_energy_bin(), cscripts.csspec.csspec._get_parameters(), cscripts.csspec.csspec._log_spectral_binning(), cscripts.csspec.csspec._select_obs(), and cscripts.csspec.csspec._set_ebounds().
|
private |
Definition at line 49 of file csspec.py.
Referenced by cscripts.csspec.csspec.__getstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.csspec.csspec._fit_energy_bins(), cscripts.csspec.csspec._set_ebounds(), and cscripts.csspec.csspec._set_replace_src_spectrum_by_bins().
|
private |
Definition at line 50 of file csspec.py.
Referenced by cscripts.cstsdist.cstsdist.__getstate__(), cscripts.csspec.csspec.__getstate__(), cscripts.cstsdist.cstsdist.__setstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.cstsdist.cstsdist._create_fits(), cscripts.csspec.csspec._create_fits(), cscripts.csspec.csspec.publish(), cscripts.cstsdist.cstsdist.save(), cscripts.csspec.csspec.save(), cscripts.csspec.csspec.spectrum(), and cscripts.cstsdist.cstsdist.ts_distribution().
|
private |
Definition at line 53 of file csspec.py.
Referenced by cscripts.csspec.csspec.__getstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.csspec.csspec._create_fits(), cscripts.csspec.csspec._get_parameters(), cscripts.csspec.csspec._profile_logL(), and cscripts.csspec.csspec.process().
|
private |
Definition at line 54 of file csspec.py.
Referenced by cscripts.cstsdist.cstsdist.__getstate__(), cscripts.csspec.csspec.__getstate__(), cscripts.cstsdist.cstsdist.__setstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.csspec.csspec._fit_energy_bins(), cscripts.cstsdist.cstsdist._get_parameters(), cscripts.csspec.csspec._get_parameters(), and cscripts.cstsdist.cstsdist.process().
|
private |
Definition at line 52 of file csspec.py.
Referenced by cscripts.csspec.csspec.__getstate__(), cscripts.csspec.csspec.__setstate__(), cscripts.csspec.csspec._fit_energy_bin(), cscripts.csspec.csspec._get_parameters(), cscripts.csspec.csspec._log_spectral_binning(), cscripts.csspec.csspec._select_obs(), and cscripts.csspec.csspec._set_ebounds().