Commit ffa7e42dec4d247e6da6cc817fbb95fce01ed66d

Authored by Jürgen Knödlseder
1 parent b653863b

Set GModelSpatialEllipticalGauss::theta_max() value to 2.5 times the maximum of …

…semimajor and semiminor axis.

Before the limitation was 5 times that values and this led to convergence problems when fitting the model. Limiting the model to 2.5 times the larger axis seems to avoid the problem. Note that this is certainly not a perfect fix of the problem, but it helps to make the working model for now. Solves at least #1561.
src/model/GModelSpatialEllipticalGauss.cpp
... ... @@ -404,7 +404,7 @@ GSkyDir GModelSpatialEllipticalGauss::mc(const GEnergy& energy,
404 404  
405 405  
406 406 /***********************************************************************//**
407   - * @brief Checks where model contains specified sky direction
  407 + * @brief Checks whether model contains specified sky direction
408 408 *
409 409 * @param[in] dir Sky direction.
410 410 * @param[in] margin Margin to be added to sky direction (degrees)
... ... @@ -431,16 +431,19 @@ bool GModelSpatialEllipticalGauss::contains(const GSkyDir& dir,
431 431 *
432 432 * @return Returns maximum model radius.
433 433 *
434   - * Returns \f$5 \sigma\f$ as approximate edge of the Gaussian. This limit
435   - * is of course arbitrary, but allows to limit the integration region for
436   - * response computation.
  434 + * Returns the maximum of \f$2.5\f$ semimajor() and \f$2.5\f$ semiminor() as
  435 + * approximate edge of the Gaussian. This limit is of course arbitrary, but
  436 + * allows to limit the integration region for response computation. The value
  437 + * of 2.5 has been determined by experiment. Ideally, a large value should
  438 + * be used to properly take into account the tails of the distribution, but
  439 + * this apparently leads to fit convergence problems (#1561).
437 440 ***************************************************************************/
438 441 double GModelSpatialEllipticalGauss::theta_max(void) const
439 442 {
440 443 // Set maximum model radius
441 444 double theta_max = (semimajor() > semiminor())
442   - ? semimajor() * gammalib::deg2rad * 5.0
443   - : semiminor() * gammalib::deg2rad * 5.0;
  445 + ? semimajor() * gammalib::deg2rad * 2.5
  446 + : semiminor() * gammalib::deg2rad * 2.5;
444 447  
445 448 // Return value
446 449 return theta_max;
... ...