Action #2710

GCTAOnOffObservation should support any kind of background model

Added by Knödlseder Jürgen about 6 years ago. Updated almost 6 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

So far GCTAOnOffObservation only works for IRF background templates, but it should work for all possible background models, including analytical background models. This should be changed, so that GCTAOnOffObservation extracts the background information from a model definition.

For this purpose, the GCTAOnOffObservation::GCTAOnOffObservation() constructor needs to be changed, taking now a model container and not only a spatial source model. Since the spatial source model was used to compute the ARF, we probably need to add a source name so that the relevant spatial model component can be extracted from the constructor. A possible interface is the following:

GCTAOnOffObservation::GCTAOnOffObservation(const GCTAObservation& obs,
                                           const GModels&         models,
                                           const std::string&     srcname,
                                           const GEbounds&        etrue,
                                           const GEbounds&        ereco,
                                           const GSkyRegions&     on,
                                           const GSkyRegions&     off,
                                           const bool&            use_model_bkg);

The use_irf_bkg argument was replaced by a use_model_bkg argument. Alternatively, the use of the background model could be controlled by its presence in the model container. In case that no background model is present for an observation, the code could switch to use_model_bkg=false. On the other hand, this would hide from the user what happens in detail, and it’s probably better to throw an exception in case that use_model_bkg=true and a background model is missing.


Recurrence

No recurrence.

History

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

  • Status changed from New to Pull request
  • Assigned To set to Knödlseder Jürgen
  • % Done changed from 0 to 100

I changed the GCTAOnOffObservation interface so that the constructor now takes a model container and a source name. The source name is used to extract the spatial source model component for ARF computation. The background model components are used to compute the alpha factors and the background response.

I also modified the csphagen script that interfaces with GCTAOnOffObservation. The use_irf_bkg parameter was changed to use_model_bkg to reflect the universal usage of the background model. The parameter was also changed in cslightcrv.

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

  • Status changed from Pull request to Closed

Merged into devel.

Also available in: Atom PDF