Feature #2723

Add example script to show significance distribution in significance map

Added by Specovius Andreas over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:11/07/2018
Priority:NormalDue date:
Assigned To:Specovius Andreas% Done:

100%

Category:-Estimated time:10.00 hours
Target version:1.6.0
Duration:

Description

It would be nice to have an example script show_significance_distribution.py that can quickly show the distribution of significance values in a given significance map.

It should also be possible to exclude known sources so that the distribution of the significances of the source-free regions can be analysed. This could be fitted using a gaussian to give the user a measure at hand.

distribution.png (49.6 KB) Knödlseder Jürgen, 12/12/2018 12:48 PM

Distribution

Recurrence

No recurrence.


Related issues

Blocked by GammaLib - Feature #2733: Make function fitting with GOptimizer possible for python... Closed 11/09/2018

History

#1 Updated by Specovius Andreas over 5 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 90

I implemented an example script for that purpose. The script is in my gitlab repository in the corresponding branch and ready for review.

Currently the user can steer the script via the following parameters:
  • mapfile (mandatory, no default value): Path to the significance map to analyse.
  • nbins (default 130): Number of bins for histogram.
  • smin (default -5): Lower boundary of histogram sigma axis.
  • smax (default 8): Upper boundary of histogram sigma axis.
  • include (default empty string): Path to map masking the sky area(s) to include in the analysis. This can be used for specifying the roi.
  • exclude (default empty string): Path to map or ds9 region file masking the sky area(s) to exclude from the analysis. This can be used to exclude known source regions. If an exclusion map is provided a fit of a normal distribution to the significance data surviving the exclusions is performed and the results are printed in the plot.
  • p (default empty string): Storage path for figure. If provided the plot will not be shown.

#2 Updated by Specovius Andreas over 5 years ago

  • Status changed from Feedback to In Progress
  • % Done changed from 90 to 80

Note that currently the scipy module is used for fitting the normal distribution to the significance histogram, which is obviously not allowed. Have to implement fitting without scipy.

Put back issue to in progress.

#3 Updated by Specovius Andreas over 5 years ago

Currently it is not possible to use the gammalib optimizer from within python. I created the dedicated issue #2733 for that. Until that is implemented this issue is stalled.

#4 Updated by Specovius Andreas over 5 years ago

  • Blocked by Feature #2733: Make function fitting with GOptimizer possible for python scripts added

#5 Updated by Knödlseder Jürgen over 5 years ago

I’m currently working on merging in the script, using the GammaLib optimizer. Do you have some example files that I can use for testing?

#6 Updated by Knödlseder Jürgen over 5 years ago

Here is what I get for a standard Crab run sky map, generated with ctskymap, and using:

$ show_significance_distribution.py skymap.fits --exclude skymap.fits[EXCLUSION]

#7 Updated by Knödlseder Jürgen over 5 years ago

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

Merged into devel.

Also available in: Atom PDF