Action #2422

Add energy integration methods to GCTAEdisp

Added by Knödlseder Jürgen about 6 years ago. Updated about 6 years ago.

Status:ClosedStart date:03/28/2018
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.6.0
Duration:

Description

Energy integration methods

double prob_etruebin(GEnergy etrue_min, GEnergy etrue_max, GEnergy ereco, double theta);
double prob_erecobin(GEnergy ereco_min, GEnergy ereco_max, GEnergy etrue, double theta);
should be added to GCTAEdisp that integrate the energy dispersion information over a bin in true or reconstructed energy. The prob_erecobin method can then be used in GCTAOnOffObservation::compute_rmf() to speed up the computations of csphagen.

onoff_stacked_rmf_reference.png (34.4 KB) Knödlseder Jürgen, 03/30/2018 10:34 AM

onoff_stacked_rmf_anaint.png (34.4 KB) Knödlseder Jürgen, 03/30/2018 10:34 AM

onoff_stacked_rmf_anaint-reference.png (36.2 KB) Knödlseder Jürgen, 03/30/2018 10:35 AM

Onoff_stacked_rmf_reference Onoff_stacked_rmf_anaint Onoff_stacked_rmf_anaint-reference

Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen about 6 years ago

  • Status changed from New to In Progress

To have a reference, here a test run on the DC-1 data and Cas A:

$ csobsselect
Input event list or observation definition XML file [obs.xml] $CTADATA/obs/obs_gps_baseline.xml
Pointing selection region shape (CIRCLE|BOX) [CIRCLE] 
Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] 
Right Ascension of selection centre (deg) (0-360) [83.63] 350.8524
Declination of selection centre (deg) (-90-90) [22.01] 58.8159
Radius of selection circle (deg) (0-180) [5.0] 5.0
Start time (UTC string, JD, MJD or MET in seconds) [NONE] 
Output observation definition XML file [outobs.xml] obs.xml

$ csphagen
Input event list or observation definition XML file [obs.xml] 
Algorithm for defining energy bins (FILE|LIN|LOG) [LOG] 
Start value for first energy bin in TeV [0.1] 
Stop value for last energy bin in TeV [100.0] 50.0
Number of energy bins [120] 30
Stack multiple observations into single PHA, ARF and RMF files? [no] yes
Output observation definition XML file [onoff_obs.xml] 
Method for background estimation (REFLECTED|CUSTOM) [REFLECTED] 
Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] 
Right Ascension of source region centre (deg) (0-360) [83.63] 350.8524
Declination of source region centre (deg) (-90-90) [22.01] 58.8159
Radius of source region circle (deg) (0-180) [0.2] 
It took 1231.67 second of CPU time to execute.

Removing the computation of the RMF, the execution time reduced to 223.4 seconds. This illustrates the potential of replacing the numerical integration by the integration methods in csphagen.

#2 Updated by Knödlseder Jürgen about 6 years ago

I implemented the prob_erecobin() method for the GCTAEdisp2D class. The execution of the csphagen script now takes 403 second, hence a factor of 3 increase in computation speed.

The resulting RMF matrix is compared below to the one obtained for the numerical integration. The left panel shows the RMF matrix obtained with numerical integration, the mid panel the one using the prob_erecobin() method and the right panel the difference between the prob_erecobin() RMF and the numerical integration RMF. The agreement is satisfactory.

#3 Updated by Knödlseder Jürgen about 6 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 50 to 100

The prob_erecobin method was added. For the moment a prob_etruebin method does not make any sense, since the true energies are convolved with some model spectrum, hence the method will not be implemented.

Merged code into devel.

Also available in: Atom PDF