Commit 0d5e3ee89a373402cfa8f61edde664b3c0ddc817
1 parent
41d52614
added documentation and cleaned up code
Showing
4 changed files
with
91 additions
and
18 deletions
doc/source/users/reference_manual/ctprob.rst
0 → 100644
| 1 | + .. _ctprob: | ||
| 2 | + | ||
| 3 | +ctprob | ||
| 4 | +======== | ||
| 5 | + | ||
| 6 | +Compute event probability for a given model. | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +Synopsis | ||
| 10 | +-------- | ||
| 11 | + | ||
| 12 | +This tool takes an event list file (or an XML observation file) and a source | ||
| 13 | +model as input. For each event, it evalutes the probability for that event | ||
| 14 | +to come from each of the source in the model. This probability is obtained | ||
| 15 | +evaluating the differential expected counts for each source at the event | ||
| 16 | +direction and energy and normalizing it to the total differential expected | ||
| 17 | +counts for the given model. If only one source is provided in the model, | ||
| 18 | +the probability is set to 1 for each photon. | ||
| 19 | +A column for each source in the model is added to the event list in order to | ||
| 20 | +store these values. The name of each column is made by the source name with | ||
| 21 | +the prefix "PROB_". | ||
| 22 | + | ||
| 23 | + | ||
| 24 | +General parameters | ||
| 25 | +------------------ | ||
| 26 | + | ||
| 27 | +``inobs [file]`` | ||
| 28 | + Input event list or observation definition XML file | ||
| 29 | + | ||
| 30 | +``outobs [file]`` | ||
| 31 | + Output event list or observation definition XML file. | ||
| 32 | + | ||
| 33 | +``(prefix = "prob_") [string]`` | ||
| 34 | + Prefix for output event lists in observation definition file. | ||
| 35 | + | ||
| 36 | +``inmodel [string]`` | ||
| 37 | + Input model XML file. | ||
| 38 | + | ||
| 39 | +``caldb [string]`` | ||
| 40 | + Calibration database. | ||
| 41 | + | ||
| 42 | +``irf [string]`` | ||
| 43 | + Instrument response function. | ||
| 44 | + | ||
| 45 | +``(edisp = no) [boolean]`` | ||
| 46 | + Apply energy dispersion to response computation. | ||
| 47 | + | ||
| 48 | + | ||
| 49 | +Standard parameters | ||
| 50 | +------------------- | ||
| 51 | + | ||
| 52 | +``(publish = no) [boolean]`` | ||
| 53 | + Specifies whether the event list(s) should be published on VO Hub. | ||
| 54 | + | ||
| 55 | +``(chatter = 2) [integer]`` | ||
| 56 | + Verbosity of the executable: | ||
| 57 | + chatter = 0: no information will be logged | ||
| 58 | + | ||
| 59 | + chatter = 1: only errors will be logged | ||
| 60 | + | ||
| 61 | + chatter = 2: errors and actions will be logged | ||
| 62 | + | ||
| 63 | + chatter = 3: report about the task execution | ||
| 64 | + | ||
| 65 | + chatter = 4: detailed report about the task execution | ||
| 66 | + | ||
| 67 | +``(clobber = yes) [boolean]`` | ||
| 68 | + Specifies whether existing output files should be overwritten. | ||
| 69 | + | ||
| 70 | +``(debug = no) [boolean]`` | ||
| 71 | + Enables debug mode. In debug mode the executable will dump any log file output to the console. | ||
| 72 | + | ||
| 73 | +``(mode = ql) [string]`` | ||
| 74 | + Mode of automatic parameters (default is "ql", i.e. "query and learn"). | ||
| 75 | + | ||
| 76 | +``(logfile = ctlike.log) [string]`` | ||
| 77 | + Name of log file. | ||
| 78 | + | ||
| 79 | + | ||
| 80 | +Related tools or scripts | ||
| 81 | +------------------------ | ||
| 82 | + | ||
| 83 | +:doc:`ctphase` | ||
| 84 | +:doc:`csphasecrv` | ||
| 85 | + |
doc/source/users/reference_manual/index.rst
| @@ -31,6 +31,7 @@ ctools | @@ -31,6 +31,7 @@ ctools | ||
| 31 | ctskymap --- Generates sky map <ctskymap> | 31 | ctskymap --- Generates sky map <ctskymap> |
| 32 | cttsmap --- Generates Test Statistic map <cttsmap> | 32 | cttsmap --- Generates Test Statistic map <cttsmap> |
| 33 | ctulimit --- Calculates upper limit <ctulimit> | 33 | ctulimit --- Calculates upper limit <ctulimit> |
| 34 | + ctprob --- Computes event probability for a given model <ctprob> | ||
| 34 | 35 | ||
| 35 | 36 | ||
| 36 | cscripts | 37 | cscripts |
src/ctprob/ctprob.cpp
| @@ -673,11 +673,11 @@ void ctprob::get_obs(void) | @@ -673,11 +673,11 @@ void ctprob::get_obs(void) | ||
| 673 | * | 673 | * |
| 674 | * | 674 | * |
| 675 | * For each event from the input event file evaluates the probability that | 675 | * For each event from the input event file evaluates the probability that |
| 676 | - * the event comes from any of the source in the input model. This is done | ||
| 677 | - * by evaluating differential expected counts for the event direction and | ||
| 678 | - * energy and normalizing it to the total differential expected counts for | ||
| 679 | - * given model. If only one source is provided in the model, the probability | ||
| 680 | - * is set to 1. for each photon. | 676 | + * the event comes from any of the source in the input model. This is done |
| 677 | + * by evaluating the differential expected counts for each source at the event | ||
| 678 | + * direction and energy and normalizing it to the total differential expected | ||
| 679 | + * counts for the given model. If only one source is provided in the model, | ||
| 680 | + * the probability is set to 1 for each photon. | ||
| 681 | * | 681 | * |
| 682 | * A FITS column for each source in the model is created and added to | 682 | * A FITS column for each source in the model is created and added to |
| 683 | * the event list. The name of each column is made by the source name with | 683 | * the event list. The name of each column is made by the source name with |
src/ctprob/ctprob.hpp
| @@ -87,14 +87,6 @@ protected: | @@ -87,14 +87,6 @@ protected: | ||
| 87 | // User parameters | 87 | // User parameters |
| 88 | std::string m_outobs; //!< Output event list or XML file | 88 | std::string m_outobs; //!< Output event list or XML file |
| 89 | std::string m_prefix; //!< Prefix for multiple event lists | 89 | std::string m_prefix; //!< Prefix for multiple event lists |
| 90 | - // bool m_usepnt; //!< Use pointing instead of RA/DEC parameters | ||
| 91 | - //GCTARoi m_roi; //!< RoI selection | ||
| 92 | - //double m_tmin; //!< Start time | ||
| 93 | - //double m_tmax; //!< Stop time | ||
| 94 | - //double m_emin; //!< Lower energy | ||
| 95 | - //double m_emax; //!< Upper energy | ||
| 96 | - //std::string m_expr; //!< Selection expression | ||
| 97 | - //std::string m_usethres; //!< Energy threshold type | ||
| 98 | bool m_apply_edisp; //!< Apply energy dispersion? | 90 | bool m_apply_edisp; //!< Apply energy dispersion? |
| 99 | bool m_publish; //!< Publish model cube? | 91 | bool m_publish; //!< Publish model cube? |
| 100 | GChatter m_chatter; //!< Chattiness | 92 | GChatter m_chatter; //!< Chattiness |
| @@ -103,11 +95,6 @@ protected: | @@ -103,11 +95,6 @@ protected: | ||
| 103 | std::vector<std::string> m_infiles; //!< Input event filenames | 95 | std::vector<std::string> m_infiles; //!< Input event filenames |
| 104 | std::vector<std::string> m_evtname; //!< Event extension names | 96 | std::vector<std::string> m_evtname; //!< Event extension names |
| 105 | std::vector<std::string> m_gtiname; //!< GTI extension names | 97 | std::vector<std::string> m_gtiname; //!< GTI extension names |
| 106 | - //GTime m_timemin; //!< Earliest time | ||
| 107 | - //GTime m_timemax; //!< Latest time | ||
| 108 | - //bool m_select_energy; //!< Perform energy selection | ||
| 109 | - //bool m_select_roi; //!< Perform RoI selection | ||
| 110 | - //bool m_select_time; //!< Perform time selection | ||
| 111 | }; | 98 | }; |
| 112 | 99 | ||
| 113 | 100 |