Bug #1259
Many integration warnings shown when fitting diffuse models or extended questions
Status: | Closed | Start date: | 07/09/2014 | |
---|---|---|---|---|
Priority: | High | Due date: | ||
Assigned To: | Knödlseder Jürgen | % Done: | 100% | |
Category: | - | |||
Target version: | 1.0.0 | |||
Duration: |
Description
Several cases of many integration warnings have been reported when using diffuse or extended models. One way to reproduce the problem is when making pull distributions for the Orion B molecular cloud diffuse map, e.g.
$ cspull debug=yes pattern="four" rad=2.0 Source model [modelTeV_OrionB.xml] Output file name [pull.dat] Number of trials [1] Calibration database [dummy] Instrument response function [cta_dummy_irf] RA of pointing (deg) (0-360) [86.171648] Dec of pointing (deg) (-90-90) [-1.4774586] Lower energy limit (TeV) (0.0) [0.1] Upper energy limit (TeV) (0.0) [100.0] Number of energy bins (0=unbinned) [0] Effective exposure time (s) [1800.0]
This results in the following messages (G_DEBUG_INTEGRAL enabled in GCTAResponse_helpers.cpp):
+++ WARNING in GIntegral::romb(0, 6.28319, 5): Integration uncertainty 9.21297e-16 exceeds tolerance of 1.20322e-16 after 21 iterations. Result 1.20322e-11 is inaccurate. cta_npred_diffuse_kern_theta(theta=2.08247 deg): === GIntegral === Relative precision ........: 1e-05 Iterations ................: 21 (maximum: 20) Status ....................: Integration uncertainty 9.21297e-16 exceeds tolerance of 1.20322e-16 after 21 iterations. Result 1.20322e-11 is inaccurate. Warnings ..................: in standard output +++ WARNING in GIntegral::romb(0, 6.28319, 5): Integration uncertainty 1.69892e-15 exceeds tolerance of 1.36789e-16 after 21 iterations. Result 1.36789e-11 is inaccurate. cta_npred_diffuse_kern_theta(theta=2.08247 deg): === GIntegral === Relative precision ........: 1e-05 Iterations ................: 21 (maximum: 20) Status ....................: Integration uncertainty 1.69892e-15 exceeds tolerance of 1.36789e-16 after 21 iterations. Result 1.36789e-11 is inaccurate. Warnings ..................: in standard output +++ WARNING in GIntegral::romb(0, 6.28319, 5): Integration uncertainty 3.96767e-16 exceeds tolerance of 7.99764e-17 after 21 iterations. Result 7.99764e-12 is inaccurate. cta_npred_diffuse_kern_theta(theta=2.09481 deg): === GIntegral === Relative precision ........: 1e-05 Iterations ................: 21 (maximum: 20) Status ....................: Integration uncertainty 3.96767e-16 exceeds tolerance of 7.99764e-17 after 21 iterations. Result 7.99764e-12 is inaccurate. Warnings ..................: in standard output ...
Interestingly, the errors occur for theta values just beyond the ROI radius (here 2 degrees). Changing the ROI radius gives the same result, but then for the changed radius. It seems that the problem occurs in the tails of the PSF.
Recurrence
No recurrence.
Related issues
History
#1 Updated by Knödlseder Jürgen over 10 years ago
- http://www.mymathlib.com/quadrature/
- http://www.mymathlib.com/quadrature/adaptive.html
- http://www.holoborodko.com/pavel/numerical-methods/numerical-integration
- http://www.pcs.cnu.edu/~bbradie/cquadrature.html
- http://www.gnu.org/software/gsl/
- http://homerreid.dyndns.org/research/codes/Libraries/index.shtml
- http://people.sc.fsu.edu/~jburkardt/c_src/kronrod/kronrod.html
#2 Updated by Knödlseder Jürgen over 10 years ago
- Target version set to 1.0.0
#3 Updated by Knödlseder Jürgen over 10 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 50
See #1291 for an analysis of the problem. At the end this boils down to relaxing the integration precision. But I still need to examine this specific problem.
#4 Updated by Knödlseder Jürgen about 10 years ago
- Status changed from In Progress to Closed
- % Done changed from 50 to 100
This is now solved with the recent improvements in the response computation. Here the output I get:
$ cspull debug=yes pattern="four" rad=2.0 Source model [$CTOOLS/share/models/crab.xml] modelTeV_OrionB.xml Output file name [pull.dat] Number of trials [10] 1 Calibration database [dummy] Instrument response function [cta_dummy_irf] RA of pointing (deg) (0-360) [83.6331] 86.171648 Dec of pointing (deg) (-90-90) [22.0145] -1.4774586 Lower energy limit (TeV) (0.0) [0.1] Upper energy limit (TeV) (0.0) [100.0] Number of energy bins (0=unbinned) [0] Effective exposure time (s) [1800.0] 2014-10-30T10:31:00: +============+ 2014-10-30T10:31:00: | Parameters | 2014-10-30T10:31:00: +============+ 2014-10-30T10:31:00: srcmdl ....................: modelTeV_OrionB.xml 2014-10-30T10:31:00: outfile ...................: pull.dat 2014-10-30T10:31:00: ntrials ...................: 1 2014-10-30T10:31:00: caldb .....................: dummy 2014-10-30T10:31:00: irf .......................: cta_dummy_irf 2014-10-30T10:31:00: edisp .....................: no 2014-10-30T10:31:00: ra ........................: 86.171648 2014-10-30T10:31:00: dec .......................: -1.4774586 2014-10-30T10:31:00: emin ......................: 0.1 2014-10-30T10:31:00: emax ......................: 100.0 2014-10-30T10:31:00: enumbins ..................: 0 2014-10-30T10:31:00: duration ..................: 1800.0 2014-10-30T10:31:00: deadc .....................: 0.95 2014-10-30T10:31:00: rad .......................: 2.0 2014-10-30T10:31:00: pattern ...................: four 2014-10-30T10:31:00: offset ....................: 1.5 2014-10-30T10:31:00: npix ......................: 200 2014-10-30T10:31:00: binsz .....................: 0.05 2014-10-30T10:31:00: chatter ...................: 2 2014-10-30T10:31:00: clobber ...................: yes 2014-10-30T10:31:00: debug .....................: yes 2014-10-30T10:31:00: mode ......................: ql 2014-10-30T10:31:00: 2014-10-30T10:31:00: +=============+ 2014-10-30T10:31:00: | Observation | 2014-10-30T10:31:00: +=============+ 2014-10-30T10:31:00: === GObservations === 2014-10-30T10:31:00: Number of observations ....: 4 2014-10-30T10:31:00: Number of predicted events : 0 2014-10-30T10:31:00: === GCTAObservation === 2014-10-30T10:31:00: Name ......................: 2014-10-30T10:31:00: Identifier ................: 000001 2014-10-30T10:31:00: Instrument ................: CTA 2014-10-30T10:31:00: Event file ................: 2014-10-30T10:31:00: Event type ................: EventList 2014-10-30T10:31:00: Statistics ................: Poisson 2014-10-30T10:31:00: Ontime ....................: 1800 s 2014-10-30T10:31:00: Livetime ..................: 1710 s 2014-10-30T10:31:00: Deadtime correction .......: 0.95 2014-10-30T10:31:00: === GCTAPointing === 2014-10-30T10:31:00: Pointing direction ........: (RA,Dec)=(86.1716,0.0225414) 2014-10-30T10:31:00: === GCTAResponseIrf === 2014-10-30T10:31:00: Response name .............: cta_dummy_irf 2014-10-30T10:31:00: Energy dispersion .........: Not used 2014-10-30T10:31:00: === GCaldb === 2014-10-30T10:31:00: Database root .............: /usr/local/gamma/share/caldb 2014-10-30T10:31:00: Selected Mission ..........: CTA 2014-10-30T10:31:00: Selected Instrument .......: DUMMY 2014-10-30T10:31:00: Calibration Index File ....: /usr/local/gamma/share/caldb/data/cta/dummy/caldb.indx 2014-10-30T10:31:00: Number of entries .........: 4 2014-10-30T10:31:00: === GCTAAeffPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: Offset angle dependence ...: Fixed sigma=3 2014-10-30T10:31:00: === GCTAPsfPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: === GCTAEdispPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: === GCTABackgroundPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: Offset angle dependence ...: Fixed sigma=3 2014-10-30T10:31:00: === GCTAEventList === 2014-10-30T10:31:00: Number of events ..........: 0 2014-10-30T10:31:00: Time interval .............: 55197 - 55197 days 2014-10-30T10:31:00: === GCTAObservation === 2014-10-30T10:31:00: Name ......................: 2014-10-30T10:31:00: Identifier ................: 000002 2014-10-30T10:31:00: Instrument ................: CTA 2014-10-30T10:31:00: Event file ................: 2014-10-30T10:31:00: Event type ................: EventList 2014-10-30T10:31:00: Statistics ................: Poisson 2014-10-30T10:31:00: Ontime ....................: 1800 s 2014-10-30T10:31:00: Livetime ..................: 1710 s 2014-10-30T10:31:00: Deadtime correction .......: 0.95 2014-10-30T10:31:00: === GCTAPointing === 2014-10-30T10:31:00: Pointing direction ........: (RA,Dec)=(87.6721,-1.47695) 2014-10-30T10:31:00: === GCTAResponseIrf === 2014-10-30T10:31:00: Response name .............: cta_dummy_irf 2014-10-30T10:31:00: Energy dispersion .........: Not used 2014-10-30T10:31:00: === GCaldb === 2014-10-30T10:31:00: Database root .............: /usr/local/gamma/share/caldb 2014-10-30T10:31:00: Selected Mission ..........: CTA 2014-10-30T10:31:00: Selected Instrument .......: DUMMY 2014-10-30T10:31:00: Calibration Index File ....: /usr/local/gamma/share/caldb/data/cta/dummy/caldb.indx 2014-10-30T10:31:00: Number of entries .........: 4 2014-10-30T10:31:00: === GCTAAeffPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: Offset angle dependence ...: Fixed sigma=3 2014-10-30T10:31:00: === GCTAPsfPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: === GCTAEdispPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: === GCTABackgroundPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: Offset angle dependence ...: Fixed sigma=3 2014-10-30T10:31:00: === GCTAEventList === 2014-10-30T10:31:00: Number of events ..........: 0 2014-10-30T10:31:00: Time interval .............: 55197 - 55197 days 2014-10-30T10:31:00: === GCTAObservation === 2014-10-30T10:31:00: Name ......................: 2014-10-30T10:31:00: Identifier ................: 000003 2014-10-30T10:31:00: Instrument ................: CTA 2014-10-30T10:31:00: Event file ................: 2014-10-30T10:31:00: Event type ................: EventList 2014-10-30T10:31:00: Statistics ................: Poisson 2014-10-30T10:31:00: Ontime ....................: 1800 s 2014-10-30T10:31:00: Livetime ..................: 1710 s 2014-10-30T10:31:00: Deadtime correction .......: 0.95 2014-10-30T10:31:00: === GCTAPointing === 2014-10-30T10:31:00: Pointing direction ........: (RA,Dec)=(86.1716,-2.97746) 2014-10-30T10:31:00: === GCTAResponseIrf === 2014-10-30T10:31:00: Response name .............: cta_dummy_irf 2014-10-30T10:31:00: Energy dispersion .........: Not used 2014-10-30T10:31:00: === GCaldb === 2014-10-30T10:31:00: Database root .............: /usr/local/gamma/share/caldb 2014-10-30T10:31:00: Selected Mission ..........: CTA 2014-10-30T10:31:00: Selected Instrument .......: DUMMY 2014-10-30T10:31:00: Calibration Index File ....: /usr/local/gamma/share/caldb/data/cta/dummy/caldb.indx 2014-10-30T10:31:00: Number of entries .........: 4 2014-10-30T10:31:00: === GCTAAeffPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: Offset angle dependence ...: Fixed sigma=3 2014-10-30T10:31:00: === GCTAPsfPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: === GCTAEdispPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: === GCTABackgroundPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: Offset angle dependence ...: Fixed sigma=3 2014-10-30T10:31:00: === GCTAEventList === 2014-10-30T10:31:00: Number of events ..........: 0 2014-10-30T10:31:00: Time interval .............: 55197 - 55197.1 days 2014-10-30T10:31:00: === GCTAObservation === 2014-10-30T10:31:00: Name ......................: 2014-10-30T10:31:00: Identifier ................: 000004 2014-10-30T10:31:00: Instrument ................: CTA 2014-10-30T10:31:00: Event file ................: 2014-10-30T10:31:00: Event type ................: EventList 2014-10-30T10:31:00: Statistics ................: Poisson 2014-10-30T10:31:00: Ontime ....................: 1800 s 2014-10-30T10:31:00: Livetime ..................: 1710 s 2014-10-30T10:31:00: Deadtime correction .......: 0.95 2014-10-30T10:31:00: === GCTAPointing === 2014-10-30T10:31:00: Pointing direction ........: (RA,Dec)=(84.6711,-1.47695) 2014-10-30T10:31:00: === GCTAResponseIrf === 2014-10-30T10:31:00: Response name .............: cta_dummy_irf 2014-10-30T10:31:00: Energy dispersion .........: Not used 2014-10-30T10:31:00: === GCaldb === 2014-10-30T10:31:00: Database root .............: /usr/local/gamma/share/caldb 2014-10-30T10:31:00: Selected Mission ..........: CTA 2014-10-30T10:31:00: Selected Instrument .......: DUMMY 2014-10-30T10:31:00: Calibration Index File ....: /usr/local/gamma/share/caldb/data/cta/dummy/caldb.indx 2014-10-30T10:31:00: Number of entries .........: 4 2014-10-30T10:31:00: === GCTAAeffPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: Offset angle dependence ...: Fixed sigma=3 2014-10-30T10:31:00: === GCTAPsfPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: === GCTAEdispPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: === GCTABackgroundPerfTable === 2014-10-30T10:31:00: Filename ..................: /usr/local/gamma/share/caldb/data/cta/dummy/bcf/cta_dummy_irf.dat 2014-10-30T10:31:00: Number of energy bins .....: 20 2014-10-30T10:31:00: Log10(Energy) range .......: 0.0199526 - 125.893 TeV 2014-10-30T10:31:00: Offset angle dependence ...: Fixed sigma=3 2014-10-30T10:31:00: === GCTAEventList === 2014-10-30T10:31:00: Number of events ..........: 0 2014-10-30T10:31:00: Time interval .............: 55197.1 - 55197.1 days 2014-10-30T10:31:00: 2014-10-30T10:31:00: +============================+ 2014-10-30T10:31:00: | Generate pull distribution | 2014-10-30T10:31:00: +============================+ 2014-10-30T10:31:05: 2014-10-30T10:31:05: Application "cspull" terminated after 41 wall clock seconds, consuming 19.2181 seconds of CPU time.