Commit 527d68b2d6877a0eb3a3aef7cc60a9e570ed08f9
1 parent
2ee8bac1
Handle zero parameter errors in ctulimit (#1795)
Showing
4 changed files
with
15 additions
and
5 deletions
ChangeLog
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | * Version 1.1.0 released | 3 | * Version 1.1.0 released |
| 4 | ======================== | 4 | ======================== |
| 5 | 5 | ||
| 6 | + Handle zero parameter errors in ctulimit (#1795) | ||
| 6 | Compute counts cube weights in ctbin (#1789) | 7 | Compute counts cube weights in ctbin (#1789) |
| 7 | Adapt to new stacked cube interface (#1788) | 8 | Adapt to new stacked cube interface (#1788) |
| 8 | Add ctools and cscripts unit tests | 9 | Add ctools and cscripts unit tests |
NEWS
| @@ -183,6 +183,9 @@ ctulimit - Compute upper limit | @@ -183,6 +183,9 @@ ctulimit - Compute upper limit | ||
| 183 | Add "edispcube" parameter to support energy dispersion for stacked analysis | 183 | Add "edispcube" parameter to support energy dispersion for stacked analysis |
| 184 | (#1724). | 184 | (#1724). |
| 185 | 185 | ||
| 186 | +In case that the parameter error is zero, the parameter value is taken as | ||
| 187 | +parameter error to define the bracketing parameter values (#1795). | ||
| 188 | + | ||
| 186 | 189 | ||
| 187 | cterror - Likelihood profile error computation | 190 | cterror - Likelihood profile error computation |
| 188 | ---------------------------------------------- | 191 | ---------------------------------------------- |
README.md
| 1 | ctools information | 1 | ctools information |
| 2 | ================== | 2 | ================== |
| 3 | -* Version: 1.1.0.dev1 (20 June 2016) | 3 | +* Version: 1.1.0.dev1 (21 June 2016) |
| 4 | * Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu) | 4 | * Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu) |
| 5 | * GammaLib dependency: 1.1.0.dev1 | 5 | * GammaLib dependency: 1.1.0.dev1 |
| 6 | 6 |
src/ctulimit/ctulimit.cpp
| @@ -290,14 +290,20 @@ void ctulimit::run(void) | @@ -290,14 +290,20 @@ void ctulimit::run(void) | ||
| 290 | 290 | ||
| 291 | } // endif: likelihood was zero | 291 | } // endif: likelihood was zero |
| 292 | 292 | ||
| 293 | - // Extract current value | 293 | + // Extract current value and error |
| 294 | double value = m_model_par->factor_value(); | 294 | double value = m_model_par->factor_value(); |
| 295 | + double error = m_model_par->factor_error(); | ||
| 295 | 296 | ||
| 296 | - // Compute parameter bracketing | 297 | + // If parameter error is zero then take parameter value as error |
| 298 | + if (error == 0) { | ||
| 299 | + error = value; | ||
| 300 | + } | ||
| 301 | + | ||
| 302 | + // Compute parameter bracketing. In case that the parameter error is | ||
| 297 | double parmin = std::max(m_model_par->factor_min(), | 303 | double parmin = std::max(m_model_par->factor_min(), |
| 298 | - value - m_sigma_min * m_model_par->factor_error()); | 304 | + value - m_sigma_min * error); |
| 299 | double parmax = std::min(m_model_par->factor_max(), | 305 | double parmax = std::min(m_model_par->factor_max(), |
| 300 | - value + m_sigma_max * m_model_par->factor_error()); | 306 | + value + m_sigma_max * error); |
| 301 | 307 | ||
| 302 | // Write header | 308 | // Write header |
| 303 | if (logTerse()) { | 309 | if (logTerse()) { |