Bug #1989

cssens script hangs

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

Status:ClosedStart date:04/05/2017
Priority:UrgentDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.3.0
Duration:

Description

I received this e-mail from Jamie:

Hi Jurgen,

I’ve been playing with ctools to try and get some numbers for the Performance Metrics. As a starting point, I was planning to try to reproduce the survey sensitivity numbers from the Science TDR, and then to recalculate them with the updated IRFs.

I’ve been using the “cssens” script. It worked fine with my older version of ctools, which I installed early last year. I recently updated both ctools and gammalib from the OSX distribution and now it hangs after calculating the results for the first energy bin. I attach old and new versions of the script - the difference is something to do with energy bounds, but I don’t really understand what’s going on, to be honest.

I’ll go back to the old script for now - both scripts give the same result for the first energy bin.

Please let me know if I’m missing something. I’d also be keen to know if you think this is a good approach for the Performance Metrics in general, or if you have other (better) ideas - I’m still pretty new to this!

Thanks,

Jamie

old_cssens.py Magnifier (25.4 KB) Knödlseder Jürgen, 04/05/2017 11:13 AM

new_cssens.py Magnifier (27 KB) Knödlseder Jürgen, 04/05/2017 11:13 AM

sensitivity_18000s_20bin_r2.0.png (38.4 KB) Knödlseder Jürgen, 04/06/2017 02:28 AM

sensitivity_18000s_20bin_r3.0.png (38.6 KB) Knödlseder Jürgen, 04/06/2017 02:28 AM

sensitivity_18000s_20bin_r4.0.png (38.6 KB) Knödlseder Jürgen, 04/06/2017 02:28 AM

sensitivity_18000s_20bin_r5.0.png (38.8 KB) Knödlseder Jürgen, 04/06/2017 02:28 AM

sensitivity_180000s_20bin_r2.0.png (39.2 KB) Knödlseder Jürgen, 04/06/2017 02:29 AM

sensitivity_1800s_20bin_r5.0.png (38.4 KB) Knödlseder Jürgen, 04/06/2017 02:43 AM

sensitivity_180000s_20bin_r5.0.png (39.1 KB) Knödlseder Jürgen, 04/06/2017 03:02 AM

tn-sensitivity.pdf (363 KB) Preview Knödlseder Jürgen, 04/13/2017 04:09 PM

Sensitivity_18000s_20bin_r2.0 Sensitivity_18000s_20bin_r3.0 Sensitivity_18000s_20bin_r4.0 Sensitivity_18000s_20bin_r5.0 Sensitivity_180000s_20bin_r2.0 Sensitivity_1800s_20bin_r5.0 Sensitivity_180000s_20bin_r5.0

Recurrence

No recurrence.

History

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

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

A first problem occurs when running cssens with the default parameters: the energy intervals are NaN.

This related to a problem in the GEbounds::set_lin() and GEbounds::set_log() methods that did not check the input arguments. Specifically, GEbounds::set_log() did allow zero energy values, which led to NaN when converting into logarithmic values.

I modified the GEbounds class so that the GEbounds::set_lin() and GEbounds::set_log() method now throw exceptions if the minimum energy is larger than the maximum energy. In addition, the GEbounds::set_log() method throws an exception if either the minimum or maximum energy are zero. Furthermore, the methods clear the energy boundaries if the requested number of intervals is non-zero.

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

There was a problem that occurred due to omission of the emin and emax keyword when calling the cssens._set_obs() method. Therefore the default parameters 100 GeV - 100 TeV have been used. The cssens._set_obs() method has been modified so that emin and emax have now to specified explicitly as arguments. In addition, the emin and emax are now read from the parameter file before calling cssens._set_obs().

Now, the following exception occurs, which is normal since the Prod2 response does not allow values as low as 20 GeV:

ValueError: *** ERROR in GCTABackground3D::mc(GEnergy&, GTime&, GRan&): Invalid value. Event energy 22.6328474582043 GeV is outside the energy range [26.2109896567651 GeV, 182.049519553934 TeV] covered by the background response table. Please restrict the energy range of the simulation to the validity range of the background response table.

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

Here a compilation of sensitivity curves for Prod2 South response functions as function of RoI radius (columns) and observation time (rows).

South_0.5h
South_5h
South_50h

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

  • File tn-sensitivity.pdf added
  • Status changed from In Progress to Closed
  • % Done changed from 10 to 100

I think I solved all open issues with cssens, a report is here: tn-sensitivity.pdf

I close the issue now.

Also available in: Atom PDF