From 0d5e3ee89a373402cfa8f61edde664b3c0ddc817 Mon Sep 17 00:00:00 2001 From: ldivenere Date: Fri, 7 Apr 2017 15:27:22 +0200 Subject: [PATCH] added documentation and cleaned up code --- doc/source/users/reference_manual/ctprob.rst | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ doc/source/users/reference_manual/index.rst | 1 + src/ctprob/ctprob.cpp | 10 +++++----- src/ctprob/ctprob.hpp | 13 ------------- 4 files changed, 91 insertions(+), 18 deletions(-) create mode 100644 doc/source/users/reference_manual/ctprob.rst diff --git a/doc/source/users/reference_manual/ctprob.rst b/doc/source/users/reference_manual/ctprob.rst new file mode 100644 index 0000000..2d3c626 --- /dev/null +++ b/doc/source/users/reference_manual/ctprob.rst @@ -0,0 +1,85 @@ + .. _ctprob: + +ctprob +======== + +Compute event probability for a given model. + + +Synopsis +-------- + +This tool takes an event list file (or an XML observation file) and a source +model as input. For each event, it evalutes the probability for that event +to come from each of the source in the model. This probability is obtained +evaluating the differential expected counts for each source at the event +direction and energy and normalizing it to the total differential expected +counts for the given model. If only one source is provided in the model, +the probability is set to 1 for each photon. +A column for each source in the model is added to the event list in order to +store these values. The name of each column is made by the source name with +the prefix "PROB_". + + +General parameters +------------------ + +``inobs [file]`` + Input event list or observation definition XML file + +``outobs [file]`` + Output event list or observation definition XML file. + +``(prefix = "prob_") [string]`` + Prefix for output event lists in observation definition file. + +``inmodel [string]`` + Input model XML file. + +``caldb [string]`` + Calibration database. + +``irf [string]`` + Instrument response function. + +``(edisp = no) [boolean]`` + Apply energy dispersion to response computation. + + +Standard parameters +------------------- + +``(publish = no) [boolean]`` + Specifies whether the event list(s) should be published on VO Hub. + +``(chatter = 2) [integer]`` + Verbosity of the executable: + chatter = 0: no information will be logged + + chatter = 1: only errors will be logged + + chatter = 2: errors and actions will be logged + + chatter = 3: report about the task execution + + chatter = 4: detailed report about the task execution + +``(clobber = yes) [boolean]`` + Specifies whether existing output files should be overwritten. + +``(debug = no) [boolean]`` + Enables debug mode. In debug mode the executable will dump any log file output to the console. + +``(mode = ql) [string]`` + Mode of automatic parameters (default is "ql", i.e. "query and learn"). + +``(logfile = ctlike.log) [string]`` + Name of log file. + + +Related tools or scripts +------------------------ + +:doc:`ctphase` +:doc:`csphasecrv` + diff --git a/doc/source/users/reference_manual/index.rst b/doc/source/users/reference_manual/index.rst index 332e84b..a67845e 100644 --- a/doc/source/users/reference_manual/index.rst +++ b/doc/source/users/reference_manual/index.rst @@ -31,6 +31,7 @@ ctools ctskymap --- Generates sky map cttsmap --- Generates Test Statistic map ctulimit --- Calculates upper limit + ctprob --- Computes event probability for a given model cscripts diff --git a/src/ctprob/ctprob.cpp b/src/ctprob/ctprob.cpp index 3502ada..b574601 100644 --- a/src/ctprob/ctprob.cpp +++ b/src/ctprob/ctprob.cpp @@ -673,11 +673,11 @@ void ctprob::get_obs(void) * * * For each event from the input event file evaluates the probability that - * the event comes from any of the source in the input model. This is done - * by evaluating differential expected counts for the event direction and - * energy and normalizing it to the total differential expected counts for - * given model. If only one source is provided in the model, the probability - * is set to 1. for each photon. + * the event comes from any of the source in the input model. This is done + * by evaluating the differential expected counts for each source at the event + * direction and energy and normalizing it to the total differential expected + * counts for the given model. If only one source is provided in the model, + * the probability is set to 1 for each photon. * * A FITS column for each source in the model is created and added to * the event list. The name of each column is made by the source name with diff --git a/src/ctprob/ctprob.hpp b/src/ctprob/ctprob.hpp index eb59f26..bdf2dcf 100644 --- a/src/ctprob/ctprob.hpp +++ b/src/ctprob/ctprob.hpp @@ -87,14 +87,6 @@ protected: // User parameters std::string m_outobs; //!< Output event list or XML file std::string m_prefix; //!< Prefix for multiple event lists - // bool m_usepnt; //!< Use pointing instead of RA/DEC parameters - //GCTARoi m_roi; //!< RoI selection - //double m_tmin; //!< Start time - //double m_tmax; //!< Stop time - //double m_emin; //!< Lower energy - //double m_emax; //!< Upper energy - //std::string m_expr; //!< Selection expression - //std::string m_usethres; //!< Energy threshold type bool m_apply_edisp; //!< Apply energy dispersion? bool m_publish; //!< Publish model cube? GChatter m_chatter; //!< Chattiness @@ -103,11 +95,6 @@ protected: std::vector m_infiles; //!< Input event filenames std::vector m_evtname; //!< Event extension names std::vector m_gtiname; //!< GTI extension names - //GTime m_timemin; //!< Earliest time - //GTime m_timemax; //!< Latest time - //bool m_select_energy; //!< Perform energy selection - //bool m_select_roi; //!< Perform RoI selection - //bool m_select_time; //!< Perform time selection }; -- libgit2 0.21.4