Commit da257d9979f701ea7c64c80473b69a7575d903c7
1 parent
5ff7129b
Add new covmat feature to ctlike docu (+ a few tab corrections)
Showing
2 changed files
with
17 additions
and
11 deletions
doc/source/users/reference_manual/ctlike.rst
| @@ -48,9 +48,13 @@ the spatial model parameters can be kept fixed during that computation | @@ -48,9 +48,13 @@ the spatial model parameters can be kept fixed during that computation | ||
| 48 | ctlike generates an output model XML file that contains the values of the | 48 | ctlike generates an output model XML file that contains the values of the |
| 49 | best fitting model parameters. For all free parameters, an ``error`` attribute | 49 | best fitting model parameters. For all free parameters, an ``error`` attribute |
| 50 | is added that provides the statistical uncertainty in the parameter estimate. | 50 | is added that provides the statistical uncertainty in the parameter estimate. |
| 51 | -If computation of the Test Statistics has been requested for a model component, | ||
| 52 | -a ``ts`` attribute providing the Test Statistics value is added. The output | ||
| 53 | -model can be used as an input model for other ctools. | 51 | +In addition, the entire output of the covariance matrix to a separate FITS file |
| 52 | +can be queried (parameter ``covmat``). The parameter order given in the file | ||
| 53 | +corresponds to the arrangement of the covariance matrix entries. If computation | ||
| 54 | +of the Test Statistics has been requested for a model component, a ``ts`` | ||
| 55 | +attribute providing the Test Statistics value is added. The output model can be | ||
| 56 | +used as an input model for other ctools. | ||
| 57 | + | ||
| 54 | 58 | ||
| 55 | 59 | ||
| 56 | General parameters | 60 | General parameters |
| @@ -92,9 +96,12 @@ General parameters | @@ -92,9 +96,12 @@ General parameters | ||
| 92 | 96 | ||
| 93 | ``(fix_spat_for_ts = no) [boolean]`` | 97 | ``(fix_spat_for_ts = no) [boolean]`` |
| 94 | Fix spatial parameters for TS computation. | 98 | Fix spatial parameters for TS computation. |
| 95 | - | ||
| 96 | - | ||
| 97 | 99 | ||
| 100 | +``(covmat = NONE) [string]`` | ||
| 101 | + Output FITS file to store covariance matrix. | ||
| 102 | + | ||
| 103 | + | ||
| 104 | + | ||
| 98 | Standard parameters | 105 | Standard parameters |
| 99 | ------------------- | 106 | ------------------- |
| 100 | 107 |
src/ctlike/ctlike.cpp
| @@ -228,20 +228,19 @@ void ctlike::run(void) | @@ -228,20 +228,19 @@ void ctlike::run(void) | ||
| 228 | // Optimize model parameters using LM optimizer | 228 | // Optimize model parameters using LM optimizer |
| 229 | optimize_lm(); | 229 | optimize_lm(); |
| 230 | 230 | ||
| 231 | - // Save covarianve matrix if valid filename is passed | 231 | + // Save covariance matrix if valid filename is passed |
| 232 | if (is_valid_filename(m_covmat)) { | 232 | if (is_valid_filename(m_covmat)) { |
| 233 | 233 | ||
| 234 | - // Write header | ||
| 235 | - log_header1(TERSE, "Saving covariance matrix"); | 234 | + // Write header |
| 235 | + log_header1(TERSE, "Saving covariance matrix"); | ||
| 236 | 236 | ||
| 237 | - // Log filename | ||
| 238 | - log_value(NORMAL, "Covariance matrix file", m_covmat.url()); | 237 | + // Log filename |
| 238 | + log_value(NORMAL, "Covariance matrix file", m_covmat.url()); | ||
| 239 | 239 | ||
| 240 | // Save covarianve matrix | 240 | // Save covarianve matrix |
| 241 | m_obs.save_covmat(m_covmat); | 241 | m_obs.save_covmat(m_covmat); |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | - | ||
| 245 | // Store Npred | 244 | // Store Npred |
| 246 | double npred = m_obs.npred(); | 245 | double npred = m_obs.npred(); |
| 247 | 246 |