Feature #2290

Add methods to support csresspec in ctools

Added by Tibaldo Luigi about 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:12/12/2017
Priority:NormalDue date:
Assigned To:Tibaldo Luigi% Done:

100%

Category:-
Target version:1.5.0
Duration:

Description

Some low-level functionalities are needed to support the creation of csresspec ([[https://cta-redmine.irap.omp.eu/issues/2289]]):
- collapse GSkyMap over spatial dimensions to produce energy array
- extract Gamma and Background Counts (TBD)


Recurrence

No recurrence.

History

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

  • Target version set to 1.5.0

#2 Updated by Tibaldo Luigi about 7 years ago

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

Implemented:
- in GSkyMap: total_counts and total_flux methods to sum or integrate over a map/set pf maps
- in GCTAOnOffObservation: model_gamma and model_background that given a model container return a Pha object with the corresponding predicted counts for the observation; this required to excise the WSTAT likelihood profiling out of the full likelihood_wstat function (wstat_value), so that it can be used to derive the background counts for WSTAT for a single bin without all the other tasks to do an optimization (Hessian, etc).
All that is needed for csresspec is in place, but I’ll leave this open in case anything else pops out.

#3 Updated by Tibaldo Luigi about 7 years ago

- Added method to extract data from GPha as GNdarray
- Added method to calculate sign of GNdarray

#4 Updated by Tibaldo Luigi about 7 years ago

- Also added methods to multiply and divide GNdarray by other GNdarray

#5 Updated by Tibaldo Luigi about 7 years ago

Added method to clip skymap at threshold

#6 Updated by Tibaldo Luigi about 7 years ago

Added method to extract backscal as GNdarray

#7 Updated by Tibaldo Luigi almost 7 years ago

  • Status changed from In Progress to Pull request

Work completed and ready for integration on my side.

#8 Updated by Knödlseder Jürgen almost 7 years ago

  • Status changed from Pull request to Closed
  • % Done changed from 70 to 100

I merged the code into devel.

I renamed the methods GSkyMap::total_flux() and GSkyMap::total_counts() to GSkyMap::flux() and GSkyMap::counts() since a GSkyMap::flux() method with different arguments existed already, and the current GammaLib logic is to overload methods with the same name if they provide the same kind of functionality.

Also available in: Atom PDF