Monday, August 24, 2015

Final project report part 1: progress

The last 2 weeks of Google Summer of Code (GSoC) have been a bit intense and exciting.

Gammapy 0.3

First of all Gammapy version 0.3 has been released. It is still an alpha version of Gammapy. But it contains already some of the functionality I developed for the GSoC. For instance:
  • dummy observation table generator.
  • container class for cube data.
  • dummy background cube model generator.
  • observation selection tools.
  • many small fixes.


As for my work on the last 2 weeks, I spent much of the time refactoring the code of the background cube model production script mentioned in my previous report and integrating the functionality into Gammapy. In addition, I added some tests
to assure that the recently added code works, and documented the new classes, methods and scripts.

New functionality added to Gammapy:
  • Observation grouping classes: classes to define groups of observations with similar properties (like observation altitude/azimuth angle or number of telescopes participating in the observations) in order to be analyzed in groups instead of individually
  • Format converters: methods to convert the observations list formats of different experiment into the Gammapy observation list format.
  • Dummy dataset generator: methods to generate a dummy dataset with event lists (data) and effective area tables (instrument response functions) in order to test some of the Gammapy functionality. The tools work as follows:
    • generate a dummy observation table, generated with the tool mentioned above.
    • Simulate background data (using a very simple model) according to the produced observation table
    • Store the data emulating the data structure of an existing experiment, like H.E.S.S..
  • Class to handle the creation of background cube models: the methods acting on background cube models have been divided into 2 classes:
    • Cube: the basic container class for cube data mentioned above. This class is kept as generic as possible, allowing other classes to use it to contain other kinds of cube data in the future. It contains basic I/O functionality, plotting methods, and methods operating on the cubes.
    • CubeBackgroundModel: class with methods specific for the background cube model productions, such as binning, histogramming, and smoothing. It also defines 3 cubes necessary for the model production:
      • counts cube: contains the statistic participating in the model.
      • livetime cube: contains the livetime correction to apply.
      • background cube: contains the model.
  • Command line tool to run the production of background cube models: this tool takes as input a dataset either from an existing experiment like H.E.S.S., or simulated data produced with the tools mentioned above and produces the models in several steps:
    • Produce a global observation list, filtering observations taken close to known sources. The tool selects all observations far from the sources listed in the TeVCAT catalog.
    • Group the observations according to similar observation properties, in this case: altitude and azimuth angles.
    • For each group produce the background cube models by:
      • define binning.
      • fill events and livetime correction in cubes.
      • fill events in bg cube.
      • smooth the bg cube to reduce fluctuations due to (low) Poisson statistics.
      • correct for livetime and bin volume.
      • set 0 level to something very small.
  • Example script to make a few plots comparing 2 sets of background cube models.
  • Added a new file to gammapy-extra with a test CubeBackgroundModel object
More details on the background cube model production can be found online in the documentation I produced during the GSoC, especially in the last week:


As an example of the new capabilities of Gammapy in order to produce background models, I produced 2 different models using the tools I developed and documented here and compared them:
  • A simulated background cube model (a.k.a. true model).
  • A reconstructed model (a.k.a. reco model) using simulated data following the model used for the true model.
The models very roughly represent the background seen by a H.E.S.S.-like experiment at an altitude close to the zenith and South azimuth.
Using the example script to plot 2 models together for comparison I produced the following plot (click for an enlarged view):
The plot shows that the reconstructed (reco) model agrees quite well with the simulated (true) model.

The following animated image shows the data of the reco model (click for an enlarged view):

Each frame represents one energy bin of the model, ranging from 0.1 TeV to 80 TeV. The pictures represent the (X, Y) view of the model in detector coordinates (a.k.a. nominal system), covering a 8 x 8 square degree area.

It is shown that Gammpy can be now used to produce accurate background cube models.

No comments:

Post a Comment