Action #2711

Adapt cscripts to support any kind of background model

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

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

100%

Category:-
Target version:1.6.0
Duration:

Description

Following #2710, the cscripts should be adapted to support any kind of background models.

This means specifically that the use_irf_bkg user parameter should be changed to use_model_bkg in csphagen and cslightcrv. The parameter needs also to be changed in obsutils.py.


Recurrence

No recurrence.


Related issues

Related to ctools - Action #2752: Check On/Off analysis for H.E.S.S. DR1 Closed 11/14/2018

History

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

  • Status changed from New to In Progress
  • Assigned To set to Knödlseder Jürgen
  • % Done changed from 0 to 50

The csphagen script was adapted. The code was merged into devel.

Still, it needs to be checked whether the code actually works.

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

It turned out that the background model computation in GCTAOnOffObservation::N_bgd only worked for the GCTAModelIrfBackground class. In addition, there is an issue with the instrument codes.

First, I added instrument codes also for HESS, VERITAS and MAGIC. So now there is CTAOnOff, HESSOnOff, VERITASOnOff and MAGICOnOff. This is definitely not optimal, since it mixes instruments with analysis types, and we should in the long run think about a proper restructuring of the code.

I also modified the GCTAOnOffObservation::set code so that it automatically sets the proper On/Off instrument code.

There was also an issue in GCTAOnOffObservation::N_bgd with the mangling of parameter indices. The code was specifically designed for the GCTAModelIrfBackground class that has no spatial parameters. Now the code can handle background models with any kind of spatial, spectral and temporal parameters.

I also had to change the GCTAOnOffObservation(const GObservations& obs) constructor which now extracts the instrument of the first On/Off observation in the observation container and only stacks subsequent observations of the same instrument.

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

As mentioned in #2752, csphagen should also produce an output model that can be readily fitted using ctlike.

#4 Updated by Knödlseder Jürgen almost 6 years ago

  • Related to Action #2752: Check On/Off analysis for H.E.S.S. DR1 added

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

  • % Done changed from 50 to 90

I added a outmodel parameter to csphagen and added some code to csphagen._set_models() that sets a proper output model that can be used for model fitting. I also added a csphagen._set_statistic() method that automatically sets the correct statistic in the output observation definition XML file. If use_model_bkg=no the statistic will be wstat, otherwise it will be cstat.

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

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

Code is now merged into devel.

Also available in: Atom PDF