GammaLib 2.1.0.dev
Loading...
Searching...
No Matches
GCOMObservation Class Reference

Interface class for COMPTEL observations. More...

#include <GCOMObservation.hpp>

Inheritance diagram for GCOMObservation:
GObservation GBase

Public Member Functions

 GCOMObservation (void)
 Void constructor.
 
 GCOMObservation (const GXmlElement &xml)
 XML constructor.
 
 GCOMObservation (const GCOMDri &dre, const GCOMDri &drb, const GCOMDri &drg, const GCOMDri &drx)
 Binned observation DRI constructor.
 
 GCOMObservation (const GCOMDri &dre, const GCOMDri &drb, const GCOMDri &drw, const GCOMDri &drg, const GCOMDri &drx)
 Binned observation DRI constructor.
 
 GCOMObservation (const GFilename &drename, const GFilename &drbname, const GFilename &drwname, const GFilename &drgname, const GFilename &drxname)
 Binned observation filename constructor.
 
 GCOMObservation (const GFilename &evpname, const GFilename &timname, const std::vector< GFilename > &oadnames, const std::vector< GFilename > &hkdnames=std::vector< GFilename >(), const GFilename &bvcname="")
 Unbinned observation constructor.
 
 GCOMObservation (const GCOMObservation &obs)
 Copy constructor.
 
virtual ~GCOMObservation (void)
 Destructor.
 
virtual GCOMObservationoperator= (const GCOMObservation &obs)
 Assignment operator.
 
virtual void clear (void)
 Clear COMPTEL observation.
 
virtual GCOMObservationclone (void) const
 Clone COMPTEL observation.
 
virtual std::string classname (void) const
 Return class name.
 
virtual void response (const GResponse &rsp)
 Set response function.
 
virtual const GCOMResponseresponse (void) const
 Return response function.
 
virtual std::string instrument (void) const
 Return instrument.
 
virtual double ontime (void) const
 Return ontime.
 
virtual double livetime (void) const
 Return livetime.
 
virtual double deadc (const GTime &time=GTime()) const
 Return deadtime correction factor.
 
virtual void read (const GXmlElement &xml)
 Read observation from XML element.
 
virtual void write (GXmlElement &xml) const
 Write observation into XML element.
 
virtual std::string print (const GChatter &chatter=NORMAL) const
 Print observation information.
 
virtual double npred (const GModel &model) const
 Return total number of predicted counts for one model.
 
virtual double grad_step_size (const GModelPar &par) const
 Return gradient step size for a given model parameter.
 
bool is_unbinned (void) const
 Check whether observation is unbinned.
 
bool is_binned (void) const
 Check whether observation is binned.
 
void load (const GFilename &drename, const GFilename &drbname, const GFilename &drwname, const GFilename &drgname, const GFilename &drxname)
 Load data for a binned observation.
 
void load (const GFilename &evpname, const GFilename &timname, const std::vector< GFilename > &oadnames, const std::vector< GFilename > &hkdnames=std::vector< GFilename >(), const GFilename &bvcname="")
 Load data for an unbinned observation.
 
void response (const GCaldb &caldb, const std::string &rspname)
 Set response function.
 
void response (const GCOMResponse &response)
 Set response function.
 
void obs_id (const double &id)
 Set observation ID.
 
void ontime (const double &ontime)
 Set ontime.
 
void livetime (const double &livetime)
 Set livetime.
 
void deadc (const double &deadc)
 Set deadtime correction factor.
 
void ewidth (const double &ewidth)
 Set energy width.
 
const double & obs_id (void) const
 Return observation ID.
 
const double & ewidth (void) const
 Return energy width.
 
const GCOMDridrb (void) const
 Return background model.
 
const GCOMDridrw (void) const
 Return weighting cube.
 
const GCOMDridrg (void) const
 Return geometry factors.
 
const GCOMDridrx (void) const
 Return exposure.
 
GCOMDri drm (const GModels &models) const
 Compute DRM cube.
 
const GCOMTimtim (void) const
 Return COMPTEL Good Time Intervals.
 
void tim (const GCOMTim &tim)
 Set COMPTEL Good Time Intervals.
 
const GCOMOadsoads (void) const
 Return Orbit Aspect Data.
 
void oads (const GCOMOads &oads)
 Set Orbit Aspect Data.
 
const GCOMHkdshkds (void) const
 Return Housekeeping Data collection.
 
void hkds (const GCOMHkds &hkds)
 Set Housekeeping Data collection.
 
const GCOMBvcsbvcs (void) const
 Return Solar System Barycentre Data.
 
void bvcs (const GCOMBvcs &bvcs)
 Set Solar System Barycentre Data.
 
const GFilenamedrename (void) const
 Return DRE filename.
 
const GFilenamedrbname (void) const
 Return DRB filename.
 
const GFilenamedrwname (void) const
 Return DRW filename.
 
const GFilenamedrgname (void) const
 Return DRG filename.
 
const GFilenamedrxname (void) const
 Return DRX filename.
 
const GFilenamerspname (void) const
 Return response cache filename.
 
const int & phi_first (void) const
 Return index of first Phibar layer to be used for likelihood fitting.
 
const int & phi_last (void) const
 Return index of last Phibar layer to be used for likelihood fitting.
 
void drename (const GFilename &drename)
 Set DRE filename.
 
void drbname (const GFilename &drbname)
 Set DRB filename.
 
void drwname (const GFilename &drwname)
 Set DRW filename.
 
void drgname (const GFilename &drgname)
 Set DRG filename.
 
void drxname (const GFilename &drxname)
 Set DRX filename.
 
void rspname (const GFilename &rspname)
 Set response cache filename filename.
 
void phi_first (const int &phi_first)
 Set index of first Phibar layer to be used for likelihood fitting.
 
void phi_last (const int &phi_last)
 Set index of last Phibar layer to be used for likelihood fitting.
 
void compute_drb (const std::string &method, const GCOMDri &drm, const int &nrunav=3, const int &navgr=3, const int &nincl=15, const int &nexcl=0)
 Compute DRB cube.
 
- Public Member Functions inherited from GObservation
 GObservation (void)
 Void constructor.
 
 GObservation (const GObservation &obs)
 Copy constructor.
 
virtual ~GObservation (void)
 Destructor.
 
virtual GObservationoperator= (const GObservation &obs)
 Assignment operator.
 
virtual GEventsevents (void)
 Return events.
 
virtual const GEventsevents (void) const
 Return events (const version)
 
virtual void events (const GEvents &events)
 Set event container.
 
virtual double likelihood (const GModels &models, GVector *gradients, GMatrixSparse *curvature, double *npred) const
 Compute likelihood function.
 
virtual double model (const GModels &models, const GEvent &event, GVector *gradients=NULL) const
 Return model value and (optionally) gradients.
 
virtual GVector model (const GModels &models, GMatrixSparse *gradients=NULL) const
 Return vector of model values and (optionally) gradients.
 
virtual double nobserved (void) const
 Return total number of observed events.
 
virtual double npred (const GModels &models, GVector *gradients=NULL) const
 Return total number (and optionally gradients) of predicted counts for all models.
 
virtual double model_grad (const GModel &model, const GModelPar &par, const GEvent &event) const
 Returns parameter gradient of model for a given event.
 
virtual GVector model_grad (const GModel &model, const GModelPar &par) const
 Returns parameter gradients of model for all events.
 
virtual double npred_grad (const GModel &model, const GModelPar &par) const
 Returns parameter gradient of Npred.
 
virtual void remove_response_cache (const std::string &name)
 Remove response cache for specific model.
 
bool has_events (void) const
 Signal if observation has events.
 
bool has_gradient (const GModel &model, const GModelPar &par) const
 Check whether a model parameter has an analytical gradient.
 
void name (const std::string &name)
 Set observation name.
 
void id (const std::string &id)
 Set observation identifier.
 
void statistic (const std::string &statistic)
 Set optimizer statistic.
 
const std::string & name (void) const
 Return observation name.
 
const std::string & id (void) const
 Return observation identifier.
 
const std::string & statistic (void) const
 Return optimizer statistic.
 
void computed_gradient (const GModel &model, const GModelPar &par) const
 Signals that an analytical gradient was computed for a model parameter.
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor.
 

Protected Member Functions

void init_members (void)
 Initialise class members.
 
void copy_members (const GCOMObservation &obs)
 Copy class members.
 
void free_members (void)
 Delete class members.
 
void load_dre (const GFilename &drename)
 Load event cube data from DRE file.
 
void load_drb (const GFilename &drbname)
 Load background model from DRB file.
 
void load_drw (const GFilename &drwname)
 Load weighting cube from DRW file.
 
void load_drg (const GFilename &drgname)
 Load geometry factors from DRG file.
 
void load_drx (const GFilename &drxname)
 Load exposure from DRX file.
 
bool check_dri (const GCOMDri &map) const
 Check if DRI is compatible with event cube.
 
void read_attributes (const GFitsHDU *hdu)
 Read observation attributes.
 
void write_attributes (GFitsHDU *hdu) const
 Write observation attributes.
 
void compute_drb_phinor (const GCOMDri &drm)
 Compute DRB cube using PHINOR method.
 
void compute_drb_bgdlixa (const GCOMDri &drm, const int &nrunav=3, const int &navgr=3, const int &nincl=15, const int &nexcl=0)
 Compute DRB cube using BGDLIXA method.
 
void compute_drb_bgdlixe (const GCOMDri &drm, const int &nrunav=3, const int &navgr=3, const int &nincl=15, const int &nexcl=0)
 Compute DRB cube using BGDLIXE method.
 
void compute_drb_bgdlixf (const GCOMDri &drm, const int &nrunav=3, const int &navgr=3, const int &nincl=15, const int &nexcl=0)
 Compute DRB cube using BGDLIXF method.
 
GSkyMap get_weighted_drg_map (void) const
 Return weighted DRG map.
 
void get_bgdlixa_phibar_indices (const int &iphibar, const int &nincl, const int &nexcl, int *isel1, int *iex1, int *iex2, int *isel2) const
 Compute Phibar index range for BGDLIXA background method.
 
virtual bool use_event_for_likelihood (const int &index) const
 Check whether bin should be used for likelihood analysis.
 
- Protected Member Functions inherited from GObservation
void init_members (void)
 Initialise class members.
 
void copy_members (const GObservation &obs)
 Copy class members.
 
void free_members (void)
 Delete class members.
 
virtual double likelihood_poisson_unbinned (const GModels &models, GVector *gradients, GMatrixSparse *curvature, double *npred) const
 Evaluate log-likelihood function for Poisson statistic and unbinned analysis (version with working arrays)
 
virtual double likelihood_poisson_binned (const GModels &models, GVector *gradients, GMatrixSparse *curvature, double *npred) const
 Evaluate log-likelihood function for Poisson statistic and binned analysis (version with working arrays)
 
virtual double likelihood_gaussian_binned (const GModels &models, GVector *gradients, GMatrixSparse *curvature, double *npred) const
 Evaluate log-likelihood function for Gaussian statistic and binned analysis (version with working arrays)
 
virtual double npred_spec (const GModel &model, const GTime &obsTime) const
 Integrates spatially integrated Npred kernel spectrally.
 

Protected Attributes

std::string m_instrument
 Instrument name.
 
GCOMResponse m_response
 Response functions.
 
double m_obs_id
 Observation ID.
 
double m_ontime
 Ontime (sec)
 
double m_livetime
 Livetime (sec)
 
double m_deadc
 Deadtime correction.
 
GFilename m_drename
 DRE filename.
 
GFilename m_drbname
 DRB filename.
 
GFilename m_drwname
 DRW filename.
 
GFilename m_drgname
 DRG filename.
 
GFilename m_drxname
 DRX filename.
 
GFilename m_rspname
 Response cache filename.
 
GCOMDri m_drb
 Background model.
 
GCOMDri m_drw
 Weighting cube.
 
GCOMDri m_drg
 Geometry factors.
 
GCOMDri m_drx
 Exposure map.
 
double m_ewidth
 Energy width (MeV)
 
int m_phi_first
 First Phibar layer to use for likelihood.
 
int m_phi_last
 Last Phibar layer to use for likelihood.
 
GFilename m_evpname
 EVP filename.
 
GFilename m_timname
 TIM filename.
 
std::vector< GFilenamem_oadnames
 OAD filenames.
 
std::vector< GFilenamem_hkdnames
 HKD filenames.
 
GFilename m_bvcname
 BVC filename.
 
GCOMTim m_tim
 COMPTEL Good Time Intervals.
 
GCOMOads m_oads
 Orbit Aspect Data.
 
GCOMHkds m_hkds
 Housekeeping Data.
 
GCOMBvcs m_bvcs
 Solar System Barycentre Data.
 
- Protected Attributes inherited from GObservation
std::string m_name
 Observation name.
 
std::string m_id
 Observation identifier.
 
std::string m_statistic
 Optimizer statistic.
 
GEventsm_events
 Pointer to event container.
 
std::vector< std::string > m_pars_with_gradients
 

Detailed Description

Interface class for COMPTEL observations.

This class implements a COMPTEL observation. Each COMPTEL observation is defined for a given energy range, and is composed of a DRE, DRB, DRG and DRX file. The DRE file contains the event data, the DRB file contains a background model, the DRG file contains geometry factors, and the DRX file contains the exposure.

Definition at line 66 of file GCOMObservation.hpp.

Constructor & Destructor Documentation

◆ GCOMObservation() [1/7]

GCOMObservation::GCOMObservation ( void )

Void constructor.

Creates an empty COMPTEL observation.

Definition at line 90 of file GCOMObservation.cpp.

References init_members().

Referenced by clone().

◆ GCOMObservation() [2/7]

GCOMObservation::GCOMObservation ( const GXmlElement & xml)
explicit

XML constructor.

Parameters
[in]xmlXML element.

Constructs a COMPTEL observation from the information that is found in an XML element.

Definition at line 108 of file GCOMObservation.cpp.

References init_members(), and read().

◆ GCOMObservation() [3/7]

GCOMObservation::GCOMObservation ( const GCOMDri & dre,
const GCOMDri & drb,
const GCOMDri & drg,
const GCOMDri & drx )

Binned observation DRI constructor.

Parameters
[in]dreEvent cube.
[in]drbBackground cube.
[in]drgGeometry cube.
[in]drxExposure map.

Creates COMPTEL observation from DRI instances.

The method fixes the deadtime correction factor deadc to 0.965.

Definition at line 133 of file GCOMObservation.cpp.

References drb(), drg(), drx(), GEvents::emax(), GEvents::emin(), GEvents::gti(), init_members(), m_deadc, m_drb, m_drbname, m_drename, m_drg, m_drgname, m_drwname, m_drx, m_drxname, GObservation::m_events, m_ewidth, m_livetime, GObservation::m_name, m_obs_id, m_ontime, and GEnergy::MeV().

◆ GCOMObservation() [4/7]

GCOMObservation::GCOMObservation ( const GCOMDri & dre,
const GCOMDri & drb,
const GCOMDri & drw,
const GCOMDri & drg,
const GCOMDri & drx )

Binned observation DRI constructor.

Parameters
[in]dreEvent cube.
[in]drbBackground cube.
[in]drwWeighting cube.
[in]drgGeometry cube.
[in]drxExposure map.

Creates COMPTEL observation from DRI instances.

The method fixes the deadtime correction factor deadc to 0.965.

Definition at line 178 of file GCOMObservation.cpp.

References drb(), drg(), drw(), drx(), GEvents::emax(), GEvents::emin(), GEvents::gti(), init_members(), m_deadc, m_drb, m_drbname, m_drename, m_drg, m_drgname, m_drw, m_drwname, m_drx, m_drxname, GObservation::m_events, m_ewidth, m_livetime, GObservation::m_name, m_obs_id, m_ontime, and GEnergy::MeV().

◆ GCOMObservation() [5/7]

GCOMObservation::GCOMObservation ( const GFilename & drename,
const GFilename & drbname,
const GFilename & drwname,
const GFilename & drgname,
const GFilename & drxname )

Binned observation filename constructor.

Parameters
[in]drenameEvent cube name.
[in]drbnameBackground cube name.
[in]drwnameWeighting cube name.
[in]drgnameGeometry cube name.
[in]drxnameExposure map name.

Creates COMPTEL observation by loading the following FITS files:

DRE - Events cube
DRB - Background model cube
DRW - Weighting cube
DRG - Geometry factors cube
DRX - Exposure map

Each of the four files is mandatory.

Definition at line 231 of file GCOMObservation.cpp.

References drbname(), drename(), drgname(), drwname(), drxname(), init_members(), and load().

◆ GCOMObservation() [6/7]

GCOMObservation::GCOMObservation ( const GFilename & evpname,
const GFilename & timname,
const std::vector< GFilename > & oadnames,
const std::vector< GFilename > & hkdnames = std::vector<GFilename> (),
const GFilename & bvcname = "" )

Unbinned observation constructor.

Parameters
[in]evpnameEvent list FITS file name.
[in]timnameGood Time Intervals FITS file name.
[in]oadnamesList of Orbit Aspect Data FITS file names.
[in]hkdnamesList of Housekeeping Data FITS file names.
[in]bvcnameSolar System Barycentre Data FITS file name.

Creates a COMPTEL unbinned observation by loading the event list, Good Time Interval, Orbit Aspect Data and optionally the Solar System Barycentre Data from FITS files.

Except of the Housekeeping Data and the Solar System Barycentre Data all files are mandatory. The Housekeeping Data and the Solar System Barycentre Data will only be loaded if the file names are not empty.

See load() method for more information.

Definition at line 267 of file GCOMObservation.cpp.

References init_members(), and load().

◆ GCOMObservation() [7/7]

GCOMObservation::GCOMObservation ( const GCOMObservation & obs)

Copy constructor.

Parameters
[in]obsCOMPTEL observation.

Creates COMPTEL observation by copying an existing COMPTEL observation.

Definition at line 291 of file GCOMObservation.cpp.

References copy_members(), and init_members().

◆ ~GCOMObservation()

GCOMObservation::~GCOMObservation ( void )
virtual

Destructor.

Definition at line 307 of file GCOMObservation.cpp.

References free_members().

Member Function Documentation

◆ bvcs() [1/2]

void GCOMObservation::bvcs ( const GCOMBvcs & bvcs)
inline

Set Solar System Barycentre Data.

Parameters
[in]bvcsSolar System Barycentre Data.

Definition at line 582 of file GCOMObservation.hpp.

References bvcs(), and m_bvcs.

◆ bvcs() [2/2]

const GCOMBvcs & GCOMObservation::bvcs ( void ) const
inline

Return Solar System Barycentre Data.

Returns
Solar System Barycentre Data

Definition at line 569 of file GCOMObservation.hpp.

References m_bvcs.

Referenced by bvcs(), and GCOMDri::compute_dre().

◆ check_dri()

bool GCOMObservation::check_dri ( const GCOMDri & dri) const
protected

Check if DRI is compatible with event cube.

Parameters
[in]driDRI.
Returns
True if DRI is compatible, false otherwise.

Compares the dimension and the WCS definition of a DRI to that of the event cube. If both are identical, true is returned, false otherwise.

Definition at line 1519 of file GCOMObservation.cpp.

References GObservation::m_events, GCOMDri::map(), GSkyMap::nmaps(), GSkyMap::nx(), GSkyMap::ny(), and GSkyMap::projection().

Referenced by compute_drb_bgdlixa(), compute_drb_bgdlixe(), compute_drb_bgdlixf(), compute_drb_phinor(), load_drb(), load_drg(), and load_drw().

◆ classname()

std::string GCOMObservation::classname ( void ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GCOMObservation").

Implements GObservation.

Definition at line 256 of file GCOMObservation.hpp.

◆ clear()

void GCOMObservation::clear ( void )
virtual

Clear COMPTEL observation.

Implements GObservation.

Definition at line 364 of file GCOMObservation.cpp.

References free_members(), GObservation::free_members(), init_members(), and GObservation::init_members().

Referenced by load(), and read().

◆ clone()

GCOMObservation * GCOMObservation::clone ( void ) const
virtual

Clone COMPTEL observation.

Returns
Pointer to deep copy of COMPTEL observation.

Implements GObservation.

Definition at line 384 of file GCOMObservation.cpp.

References GCOMObservation().

◆ compute_drb()

void GCOMObservation::compute_drb ( const std::string & method,
const GCOMDri & drm,
const int & nrunav = 3,
const int & navgr = 3,
const int & nincl = 15,
const int & nexcl = 0 )

Compute DRB cube.

Parameters
[in]methodBackground method (PHINOR, BGDLIXA, BGDLIXE or BGDLIXF).
[in]drmDRM cube.
[in]nrunavBGDLIXn: number of bins used for running average.
[in]navgrBGDLIXn: number of bins used for averaging.
[in]ninclBGDLIXn: number of Phibar layers to include.
[in]nexclBGDLIXn: number of Phibar layers to exclude.

Computes a COMPTEL DRB cube using either the PHINOR or BGDLIX method. There are three variants of the BGFLIX method (BGDLIXA, BGDLIXE and BGDLIXF). See the protected methods compute_drb_phinor(), compute_drb_bgdlixa(), compute_drb_bgdlixe(), and compute_drb_bgdlixf() for more information.

Definition at line 1028 of file GCOMObservation.cpp.

References compute_drb_bgdlixa(), compute_drb_bgdlixe(), compute_drb_bgdlixf(), compute_drb_phinor(), drm(), and G_COMPUTE_DRB.

◆ compute_drb_bgdlixa()

void GCOMObservation::compute_drb_bgdlixa ( const GCOMDri & drm,
const int & nrunav = 3,
const int & navgr = 3,
const int & nincl = 15,
const int & nexcl = 0 )
protected

Compute DRB cube using BGDLIXA method.

Parameters
[in]drmDRM cube.
[in]nrunavNumber of bins used for running average.
[in]navgrNumber of bins used for averaging.
[in]ninclNumber of Phibar layers to include.
[in]nexclNumber of Phibar layers to exclude.
Exceptions
GException::invalid_valueObservation does not contain an event cube
GException::invalid_argumentDRM cube is incompatible with DRE

Computes a DRB cube using the BGDLIXA method that is documented in Rob van Dijk's PhD thesis. The revelant equations from the thesis that are implemented here are 3.12, 3.12 and 3.14.

Definition at line 1693 of file GCOMObservation.cpp.

References check_dri(), GCOMEventCube::dre(), drm(), GObservation::events(), G_COMPUTE_DRB_BGDLIXA, get_bgdlixa_phibar_indices(), get_weighted_drg_map(), GObservation::id(), m_drb, m_drg, GCOMDri::map(), GObservation::name(), GCOMDri::nchi(), norm(), GCOMDri::nphibar(), and GCOMDri::npsi().

Referenced by compute_drb().

◆ compute_drb_bgdlixe()

void GCOMObservation::compute_drb_bgdlixe ( const GCOMDri & drm,
const int & nrunav = 3,
const int & navgr = 3,
const int & nincl = 15,
const int & nexcl = 0 )
protected

Compute DRB cube using BGDLIXE method.

Parameters
[in]drmDRM cube.
[in]nrunavNumber of bins used for running average.
[in]navgrNumber of bins used for averaging.
[in]ninclNumber of Phibar layers to include.
[in]nexclNumber of Phibar layers to exclude.
Exceptions
GException::invalid_valueObservation does not contain an event cube
GException::invalid_argumentDRM cube is incompatible with DRE

Computes a DRB cube using the BGDLIXE method. This method differs from the BGDLIXA method in the last step.

Definition at line 2044 of file GCOMObservation.cpp.

References check_dri(), GCOMEventCube::dre(), drm(), GObservation::events(), G_COMPUTE_DRB_BGDLIXE, get_bgdlixa_phibar_indices(), get_weighted_drg_map(), GObservation::id(), m_drb, m_drg, GCOMDri::map(), GObservation::name(), GCOMDri::nchi(), norm(), GCOMDri::nphibar(), and GCOMDri::npsi().

Referenced by compute_drb().

◆ compute_drb_bgdlixf()

void GCOMObservation::compute_drb_bgdlixf ( const GCOMDri & drm,
const int & nrunav = 3,
const int & navgr = 3,
const int & nincl = 15,
const int & nexcl = 0 )
protected

Compute DRB cube using BGDLIXF method.

Parameters
[in]drmDRM cube.
[in]nrunavNumber of bins used for running average.
[in]navgrNumber of bins used for averaging.
[in]ninclNumber of Phibar layers to include.
[in]nexclNumber of Phibar layers to exclude.
Exceptions
GException::invalid_valueObservation does not contain an event cube
GException::invalid_argumentDRM cube is incompatible with DRE

Computes a DRB cube using the BGDLIXF method. This method differs from the BGDLIXE method in the DRW instead of the DRG is used for background model computation.

Definition at line 2255 of file GCOMObservation.cpp.

References check_dri(), GCOMEventCube::dre(), drm(), GObservation::events(), G_COMPUTE_DRB_BGDLIXE, G_COMPUTE_DRB_BGDLIXF, get_bgdlixa_phibar_indices(), GObservation::id(), m_drb, m_drw, GCOMDri::map(), GObservation::name(), GCOMDri::nchi(), norm(), GCOMDri::nphibar(), and GCOMDri::npsi().

Referenced by compute_drb().

◆ compute_drb_phinor()

void GCOMObservation::compute_drb_phinor ( const GCOMDri & drm)
protected

Compute DRB cube using PHINOR method.

Parameters
[in]drmDRM cube.
Exceptions
GException::invalid_valueObservation does not contain an event cube
GException::invalid_argumentDRM cube is incompatible with DRE

Definition at line 1605 of file GCOMObservation.cpp.

References check_dri(), GCOMEventCube::dre(), drm(), GObservation::events(), G_COMPUTE_DRB_PHINOR, get_weighted_drg_map(), GObservation::id(), m_drb, m_drg, GCOMDri::map(), GObservation::name(), norm(), GCOMDri::nphibar(), and GSkyMap::npix().

Referenced by compute_drb().

◆ copy_members()

void GCOMObservation::copy_members ( const GCOMObservation & obs)
protected

◆ deadc() [1/2]

void GCOMObservation::deadc ( const double & deadc)
inline

Set deadtime correction factor.

Parameters
[in]deadcDeadtime correction factor.

Definition at line 387 of file GCOMObservation.hpp.

References deadc(), and m_deadc.

◆ deadc() [2/2]

double GCOMObservation::deadc ( const GTime & time = GTime()) const
inlinevirtual

Return deadtime correction factor.

Parameters
[in]timeTime.
Returns
Deadtime correction factor.

Implements GObservation.

Definition at line 335 of file GCOMObservation.hpp.

References m_deadc.

Referenced by GCOMResponse::backproject(), deadc(), GCOMResponse::irf_diffuse(), GCOMResponse::irf_elliptical(), GCOMResponse::irf_ptsrc(), and GCOMResponse::irf_radial().

◆ drb()

const GCOMDri & GCOMObservation::drb ( void ) const
inline

Return background model.

Returns
Background model.

Definition at line 439 of file GCOMObservation.hpp.

References m_drb.

Referenced by GCOMModelDRBPhibarBins::eval(), GCOMModelDRBPhibarNodes::eval(), GCOMObservation(), and GCOMObservation().

◆ drbname() [1/2]

void GCOMObservation::drbname ( const GFilename & drbname)
inline

Set DRB filename.

Parameters
[in]drbnameDRB filename.

Definition at line 736 of file GCOMObservation.hpp.

References drbname(), and m_drbname.

◆ drbname() [2/2]

const GFilename & GCOMObservation::drbname ( void ) const
inline

Return DRB filename.

Returns
DRB filename.

Definition at line 632 of file GCOMObservation.hpp.

References m_drbname.

Referenced by drbname(), GCOMObservation(), load(), load_drb(), and read().

◆ drename() [1/2]

void GCOMObservation::drename ( const GFilename & drename)
inline

Set DRE filename.

Parameters
[in]drenameDRE filename.

Definition at line 723 of file GCOMObservation.hpp.

References drename(), and m_drename.

◆ drename() [2/2]

const GFilename & GCOMObservation::drename ( void ) const
inline

Return DRE filename.

Returns
DRE filename.

Definition at line 619 of file GCOMObservation.hpp.

References m_drename.

Referenced by drename(), GCOMObservation(), load(), load_dre(), and read().

◆ drg()

const GCOMDri & GCOMObservation::drg ( void ) const
inline

◆ drgname() [1/2]

void GCOMObservation::drgname ( const GFilename & drgname)
inline

Set DRG filename.

Parameters
[in]drgnameDRG filename.

Definition at line 762 of file GCOMObservation.hpp.

References drgname(), and m_drgname.

◆ drgname() [2/2]

const GFilename & GCOMObservation::drgname ( void ) const
inline

Return DRG filename.

Returns
DRG filename.

Definition at line 658 of file GCOMObservation.hpp.

References m_drgname.

Referenced by drgname(), GCOMObservation(), load(), load_drg(), and read().

◆ drm()

GCOMDri GCOMObservation::drm ( const GModels & models) const

Compute DRM cube.

Parameters
[in]modelsModel container.
Returns
DRM cube (units of counts)
Exceptions
GException::invalid_valueObservation does not contain an event cube.

Computes a COMPTEL DRM cube from the information provided in a model container. The values of the DRM cube are in units of counts.

Definition at line 969 of file GCOMObservation.cpp.

References GCOMEventBin::counts(), GCOMEventCube::dre(), drm(), GModels::eval(), G_DRM, GObservation::m_events, GObservation::model(), GObservation::name(), GCOMEventBin::size(), and GCOMEventCube::size().

Referenced by compute_drb(), compute_drb_bgdlixa(), compute_drb_bgdlixe(), compute_drb_bgdlixf(), compute_drb_phinor(), and drm().

◆ drw()

const GCOMDri & GCOMObservation::drw ( void ) const
inline

Return weighting cube.

Returns
Weighting cube.

Definition at line 452 of file GCOMObservation.hpp.

References m_drw.

Referenced by GCOMObservation().

◆ drwname() [1/2]

void GCOMObservation::drwname ( const GFilename & drwname)
inline

Set DRW filename.

Parameters
[in]drwnameDRW filename.

Definition at line 749 of file GCOMObservation.hpp.

References drwname(), and m_drwname.

◆ drwname() [2/2]

const GFilename & GCOMObservation::drwname ( void ) const
inline

Return DRW filename.

Returns
DRW filename.

Definition at line 645 of file GCOMObservation.hpp.

References m_drwname.

Referenced by drwname(), GCOMObservation(), load(), load_drw(), and read().

◆ drx()

const GCOMDri & GCOMObservation::drx ( void ) const
inline

◆ drxname() [1/2]

void GCOMObservation::drxname ( const GFilename & drxname)
inline

Set DRX filename.

Parameters
[in]drxnameDRX filename.

Definition at line 775 of file GCOMObservation.hpp.

References drxname(), and m_drxname.

◆ drxname() [2/2]

const GFilename & GCOMObservation::drxname ( void ) const
inline

Return DRX filename.

Returns
DRX filename.

Definition at line 671 of file GCOMObservation.hpp.

References m_drxname.

Referenced by drxname(), GCOMObservation(), load(), load_drx(), and read().

◆ ewidth() [1/2]

void GCOMObservation::ewidth ( const double & ewidth)
inline

Set energy width.

Parameters
[in]ewidthEnergy width (MeV).

Definition at line 400 of file GCOMObservation.hpp.

References ewidth(), and m_ewidth.

◆ ewidth() [2/2]

const double & GCOMObservation::ewidth ( void ) const
inline

Return energy width.

Returns
Energy width (MeV).

Definition at line 426 of file GCOMObservation.hpp.

References m_ewidth.

Referenced by ewidth().

◆ free_members()

void GCOMObservation::free_members ( void )
protected

Delete class members.

Definition at line 1281 of file GCOMObservation.cpp.

Referenced by clear(), operator=(), and ~GCOMObservation().

◆ get_bgdlixa_phibar_indices()

void GCOMObservation::get_bgdlixa_phibar_indices ( const int & iphibar,
const int & nincl,
const int & nexcl,
int * isel1,
int * iex1,
int * iex2,
int * isel2 ) const
protected

Compute Phibar index range for BGDLIXA background method.

Parameters
[in]iphibarPhibar layer index.
[in]ninclNumber of Phibar layers to include.
[in]nexclNumber of Phibar layers to exclude.
[out]isel1Start index for first sum.
[out]iex1Stop index for first sum.
[out]iex2Start index for second sum.
[out]isel2Stop index for second sum.

This method is a helper method for the BGDLIXA background method. It computes the Phibar index range for the third step of the background model computation. The third step corresponds to Equation (3.14) in Rob van Dijk's PhD thesis.

The Phibar sum will be taken over the index ranges [isel1, iex1] and [ixe2, isel2].

Definition at line 2497 of file GCOMObservation.cpp.

References m_drg, and GCOMDri::nphibar().

Referenced by compute_drb_bgdlixa(), compute_drb_bgdlixe(), and compute_drb_bgdlixf().

◆ get_weighted_drg_map()

GSkyMap GCOMObservation::get_weighted_drg_map ( void ) const
protected

Return weighted DRG map.

Returns
Weighted DRG map.

Returns a DRG as sky map where each pixel of the map is multiplied by the solidangle of the pixel.

Definition at line 2456 of file GCOMObservation.cpp.

References drg(), m_drg, and GCOMDri::map().

Referenced by compute_drb_bgdlixa(), compute_drb_bgdlixe(), and compute_drb_phinor().

◆ grad_step_size()

double GCOMObservation::grad_step_size ( const GModelPar & par) const
virtual

Return gradient step size for a given model parameter.

Parameters
[in]parModel parameter
Returns
Gradient step size

Returns the step size that is used for numerical gradient computation for a given model parameter par.

Following a detailed analysis (see https://gitlab.in2p3.fr/gammalib/gammalib/-/issues/14) the step size is set to 0.002 for all parameters except of position angles (PA) which will have a step size of 0.02. At these step sizes numerical computation of parameter gradients is no longer perturbed by numerical noise.

Reimplemented from GObservation.

Definition at line 1076 of file GCOMObservation.cpp.

◆ hkds() [1/2]

void GCOMObservation::hkds ( const GCOMHkds & hkds)
inline

Set Housekeeping Data collection.

Parameters
[in]hkdsHousekeeping Data collection.

Definition at line 556 of file GCOMObservation.hpp.

References hkds(), and m_hkds.

◆ hkds() [2/2]

const GCOMHkds & GCOMObservation::hkds ( void ) const
inline

Return Housekeeping Data collection.

Returns
Housekeeping Data collection

Definition at line 543 of file GCOMObservation.hpp.

References m_hkds.

Referenced by hkds(), and GCOMDris::vetorate_setup().

◆ init_members()

◆ instrument()

std::string GCOMObservation::instrument ( void ) const
inlinevirtual

Return instrument.

Returns
Instrument name.

Implements GObservation.

Definition at line 294 of file GCOMObservation.hpp.

References m_instrument.

Referenced by print().

◆ is_binned()

bool GCOMObservation::is_binned ( void ) const
inline

Check whether observation is binned.

Returns
True if observation is unbinned.

Definition at line 607 of file GCOMObservation.hpp.

References GObservation::m_events.

Referenced by write().

◆ is_unbinned()

bool GCOMObservation::is_unbinned ( void ) const
inline

Check whether observation is unbinned.

Returns
True if observation is unbinned.

Definition at line 595 of file GCOMObservation.hpp.

References GObservation::m_events.

Referenced by write().

◆ livetime() [1/2]

void GCOMObservation::livetime ( const double & livetime)
inline

Set livetime.

Parameters
[in]livetimeLivetime.

Definition at line 374 of file GCOMObservation.hpp.

References livetime(), and m_livetime.

◆ livetime() [2/2]

double GCOMObservation::livetime ( void ) const
inlinevirtual

Return livetime.

Returns
Livetime (seconds).

Implements GObservation.

Definition at line 320 of file GCOMObservation.hpp.

References m_livetime.

Referenced by livetime(), and print().

◆ load() [1/2]

void GCOMObservation::load ( const GFilename & drename,
const GFilename & drbname,
const GFilename & drwname,
const GFilename & drgname,
const GFilename & drxname )

Load data for a binned observation.

Parameters
[in]drenameEvent cube name.
[in]drbnameBackground cube name.
[in]drwnameWeighting cube name.
[in]drgnameGeometry cube name.
[in]drxnameExposure map name.

Load event cube from DRE file, background model from DRB file, weigthing cube from DRW file, geometry factors from DRG file and the exposure map from the DRX file. All files are mandatory.

Definition at line 815 of file GCOMObservation.cpp.

References drbname(), drename(), drgname(), drwname(), drxname(), load_drb(), load_dre(), load_drg(), load_drw(), and load_drx().

Referenced by GCOMObservation(), GCOMObservation(), and read().

◆ load() [2/2]

void GCOMObservation::load ( const GFilename & evpname,
const GFilename & timname,
const std::vector< GFilename > & oadnames,
const std::vector< GFilename > & hkdnames = std::vector<GFilename> (),
const GFilename & bvcname = "" )

Load data for an unbinned observation.

Parameters
[in]evpnameEvent list FITS file name.
[in]timnameGood Time Intervals FITS file name.
[in]oadnamesList of Orbit Aspect Data FITS file names.
[in]hkdnamesList of Housekeeping Data FITS file names.
[in]bvcnameSolar System Barycentre Data FITS file name.

Loads the event list, Good Time Interval, Orbit Aspect Data and optionally Housekeeping data and Solar System Barycentre Data for an unbinned observation.

Except of the Housekeeping Data and the Solar System Barycentre Data all files are mandatory. The Housekeeping Data and the Solar System Barycentre Data will only be loaded if the file names are not empty.

The method fixes the deadtime correction factor deadc to 0.965.

Definition at line 860 of file GCOMObservation.cpp.

References clear(), GFits::close(), GCOMHkds::extend(), GCOMOads::extend(), GCOMTim::gti(), GCOMOads::insert(), GCOMBvcs::load(), GCOMTim::load(), m_bvcname, m_bvcs, m_deadc, GObservation::m_events, m_evpname, m_hkdnames, m_hkds, m_livetime, m_oadnames, m_oads, m_ontime, m_tim, m_timname, oads(), GGti::ontime(), read_attributes(), GCOMHkds::size(), and GCOMOads::size().

◆ load_drb()

void GCOMObservation::load_drb ( const GFilename & drbname)
protected

Load background model from DRB file.

Parameters
[in]drbnameDRB filename.
Exceptions
GException::invalid_valueDRB data space incompatible with DRE data space.

Load the background model from the primary image of the specified FITS file. Since a DRB file is optional the method does nothing if the DRB filename is empty.

Definition at line 1354 of file GCOMObservation.cpp.

References check_dri(), GFits::close(), gammalib::com_wcs_mer2car(), drbname(), G_LOAD_DRB, GFits::image(), GFilename::is_empty(), m_drb, m_drbname, m_drename, GCOMDri::map(), and GCOMDri::read().

Referenced by load().

◆ load_dre()

void GCOMObservation::load_dre ( const GFilename & drename)
protected

Load event cube data from DRE file.

Parameters
[in]drenameDRE filename.

Loads the event cube from a DRE file.

The ontime is extracted from the Good Time Intervals. The deadtime correction factor deadc is fixed to 0.965. The livetime is computed by multiplying the deadtime correction by the ontime, i.e. LIVETIME = ONTIME * DEADC.

Definition at line 1300 of file GCOMObservation.cpp.

References GFits::close(), drename(), GEvents::emax(), GEvents::emin(), GEvents::gti(), m_deadc, m_drename, GObservation::m_events, m_ewidth, m_livetime, m_ontime, GEnergy::MeV(), GEvents::read(), and read_attributes().

Referenced by load().

◆ load_drg()

void GCOMObservation::load_drg ( const GFilename & drgname)
protected

Load geometry factors from DRG file.

Parameters
[in]drgnameDRG filename.
Exceptions
GException::invalid_valueDRG data space incompatible with DRE data space.

Load the geometry factors from the primary image of the specified FITS file.

Definition at line 1446 of file GCOMObservation.cpp.

References check_dri(), GFits::close(), gammalib::com_wcs_mer2car(), drgname(), G_LOAD_DRG, GFits::image(), m_drename, m_drg, m_drgname, GCOMDri::map(), and GCOMDri::read().

Referenced by load().

◆ load_drw()

void GCOMObservation::load_drw ( const GFilename & drwname)
protected

Load weighting cube from DRW file.

Parameters
[in]drwnameDRW filename.
Exceptions
GException::invalid_valueDRW data space incompatible with DRE data space.

Load the weighting cube from the primary image of the specified FITS file.

Definition at line 1401 of file GCOMObservation.cpp.

References check_dri(), GFits::close(), drwname(), G_LOAD_DRW, GFits::image(), GFilename::is_empty(), m_drename, m_drw, m_drwname, and GCOMDri::read().

Referenced by load().

◆ load_drx()

void GCOMObservation::load_drx ( const GFilename & drxname)
protected

Load exposure from DRX file.

Parameters
[in]drxnameDRX filename.

Load the exposure map from the primary image of the specified FITS file.

Definition at line 1485 of file GCOMObservation.cpp.

References GFits::close(), gammalib::com_wcs_mer2car(), drxname(), GFits::image(), m_drx, m_drxname, GCOMDri::map(), and GCOMDri::read().

Referenced by load().

◆ npred()

double GCOMObservation::npred ( const GModel & model) const
virtual

Return total number of predicted counts for one model.

Parameters
[in]modelGamma-ray source model.
Returns
Total number of predicted counts in model.

Returns the total number of predicted counts in a given model component.

Reimplemented from GObservation.

Definition at line 453 of file GCOMObservation.cpp.

References GModels::append(), GObservation::events(), GObservation::model(), npred(), GEventBin::size(), GVector::size(), and use_event_for_likelihood().

Referenced by npred().

◆ oads() [1/2]

void GCOMObservation::oads ( const GCOMOads & oads)
inline

Set Orbit Aspect Data.

Parameters
[in]oadsOrbit Aspect Data.

Definition at line 530 of file GCOMObservation.hpp.

References m_oads, and oads().

◆ oads() [2/2]

const GCOMOads & GCOMObservation::oads ( void ) const
inline

◆ obs_id() [1/2]

void GCOMObservation::obs_id ( const double & id)
inline

Set observation ID.

Parameters
[in]idObservation ID.

Definition at line 348 of file GCOMObservation.hpp.

References GObservation::id(), and m_obs_id.

◆ obs_id() [2/2]

const double & GCOMObservation::obs_id ( void ) const
inline

Return observation ID.

Returns
Observation ID.

Definition at line 413 of file GCOMObservation.hpp.

References m_obs_id.

◆ ontime() [1/2]

void GCOMObservation::ontime ( const double & ontime)
inline

Set ontime.

Parameters
[in]ontimeOntime.

Definition at line 361 of file GCOMObservation.hpp.

References m_ontime, and ontime().

◆ ontime() [2/2]

double GCOMObservation::ontime ( void ) const
inlinevirtual

◆ operator=()

GCOMObservation & GCOMObservation::operator= ( const GCOMObservation & obs)
virtual

Assignment operator.

Parameters
[in]obsCOMPTEL observation.
Returns
COMPTEL observation.

Assign COMPTEL observation to this object.

Definition at line 331 of file GCOMObservation.cpp.

References copy_members(), free_members(), init_members(), and GObservation::operator=().

◆ phi_first() [1/2]

void GCOMObservation::phi_first ( const int & phi_first)
inline

Set index of first Phibar layer to be used for likelihood fitting.

Parameters
[in]phi_firstIndex of first Phibar layer.

Definition at line 801 of file GCOMObservation.hpp.

References m_phi_first, and phi_first().

◆ phi_first() [2/2]

const int & GCOMObservation::phi_first ( void ) const
inline

Return index of first Phibar layer to be used for likelihood fitting.

Returns
Index of first Phibar layer.

Definition at line 697 of file GCOMObservation.hpp.

References m_phi_first.

Referenced by phi_first(), and print().

◆ phi_last() [1/2]

void GCOMObservation::phi_last ( const int & phi_last)
inline

Set index of last Phibar layer to be used for likelihood fitting.

Parameters
[in]phi_lastIndex of last Phibar layer.

Definition at line 814 of file GCOMObservation.hpp.

References m_phi_last, and phi_last().

◆ phi_last() [2/2]

const int & GCOMObservation::phi_last ( void ) const
inline

Return index of last Phibar layer to be used for likelihood fitting.

Returns
Index of last Phibar layer.

Definition at line 710 of file GCOMObservation.hpp.

References m_phi_last.

Referenced by phi_last(), and print().

◆ print()

◆ read()

void GCOMObservation::read ( const GXmlElement & xml)
virtual

Read observation from XML element.

Parameters
[in]xmlXML element.

Reads information for a COMPTEL observation from an XML element. The method supports both an unbinned and a binned observation.

For an unbinned observation the XML format is

<observation name="Crab" id="000001" instrument="COM">
  <parameter name="EVP" file="m16992_evp.fits"/>
  <parameter name="TIM" file="m10695_tim.fits"/>
  <parameter name="OAD" file="m20039_oad.fits"/>
  <parameter name="OAD" file="m20041_oad.fits"/>
  <parameter name="HKD" file="m20035_hkd.fits"/>
  <parameter name="HKD" file="m20037_hkd.fits"/>
  <parameter name="BVC" file="s10150_bvc.fits"/>
  ...
</observation>

where the observation can contain an arbitrary number of OAD file parameters. The file attribute provide either absolute or relative file names. If a file name includes no access path it is assumed that the file resides in the same location as the XML file. The HKD and BVC files are optional and do not need to be specified.

For a binned observation the XML format is

<observation name="Crab" id="000001" instrument="COM">
  <parameter name="DRE" file="m50438_dre.fits"/>
  <parameter name="DRB" file="m34997_drg.fits"/>
  <parameter name="DRW" file="m34997_drw.fits"/>
  <parameter name="DRG" file="m34997_drg.fits"/>
  <parameter name="DRX" file="m32171_drx.fits"/>
  <parameter name="IAQ" value="UNH(1.0-3.0)MeV"/>
</observation>

Note that the DRW parameter is optional.

Implements GObservation.

Definition at line 533 of file GCOMObservation.cpp.

References GXmlElement::attribute(), clear(), drbname(), drename(), drgname(), drwname(), drxname(), GXmlNode::element(), GXmlNode::elements(), GFilename::exists(), G_READ, GXmlElement::has_attribute(), GFilename::is_fits(), load(), GCOMResponse::load_cache(), GObservation::m_id, m_instrument, GObservation::m_name, m_phi_first, m_phi_last, m_response, m_rspname, response(), gammalib::toint(), gammalib::xml_file_expand(), gammalib::xml_get_attr(), and gammalib::xml_has_par().

Referenced by GCOMObservation().

◆ read_attributes()

void GCOMObservation::read_attributes ( const GFitsHDU * hdu)
protected

Read observation attributes.

Parameters
[in]hduFITS HDU pointer

Reads optional attributes are

OBS_ID   - Observation identifier
OBJECT   - Object

Nothing is done if the HDU pointer is NULL.

Definition at line 1558 of file GCOMObservation.cpp.

References GFitsHDU::has_card(), GObservation::m_name, m_obs_id, GFitsHDU::real(), and GFitsHDU::string().

Referenced by load(), and load_dre().

◆ response() [1/4]

void GCOMObservation::response ( const GCaldb & caldb,
const std::string & rspname )

Set response function.

Parameters
[in]caldbCalibration database.
[in]rspnameName of COMPTEL response.

Sets the response function by loading the response information from the calibration database.

Definition at line 429 of file GCOMObservation.cpp.

References GCOMResponse::caldb(), GCOMResponse::clear(), GCOMResponse::load(), m_response, and rspname().

◆ response() [2/4]

void GCOMObservation::response ( const GCOMResponse & response)
inline

Set response function.

Parameters
[in]responseResponse function.

Definition at line 281 of file GCOMObservation.hpp.

References m_response, and response().

◆ response() [3/4]

void GCOMObservation::response ( const GResponse & rsp)
virtual

Set response function.

Parameters
[in]rspResponse function.
Exceptions
GException::invalid_argumentSpecified response is not a COMPTEL response.

Sets the response function for the observation.

Implements GObservation.

Definition at line 400 of file GCOMObservation.cpp.

References G_RESPONSE, m_response, and GObservation::name().

◆ response() [4/4]

const GCOMResponse * GCOMObservation::response ( void ) const
inlinevirtual

Return response function.

Returns
Response function.

Implements GObservation.

Definition at line 268 of file GCOMObservation.hpp.

References m_response.

Referenced by print(), read(), and response().

◆ rspname() [1/2]

void GCOMObservation::rspname ( const GFilename & rspname)
inline

Set response cache filename filename.

Parameters
[in]rspnameResponse cache filename.

Definition at line 788 of file GCOMObservation.hpp.

References m_rspname, and rspname().

◆ rspname() [2/2]

const GFilename & GCOMObservation::rspname ( void ) const
inline

Return response cache filename.

Returns
Response cache filename.

Definition at line 684 of file GCOMObservation.hpp.

References m_rspname.

Referenced by print(), response(), and rspname().

◆ tim() [1/2]

void GCOMObservation::tim ( const GCOMTim & tim)
inline

Set COMPTEL Good Time Intervals.

Parameters
[in]timCOMPTEL Good Time Intervals.

Definition at line 504 of file GCOMObservation.hpp.

References m_tim, and tim().

◆ tim() [2/2]

const GCOMTim & GCOMObservation::tim ( void ) const
inline

Return COMPTEL Good Time Intervals.

Returns
COMPTEL Good Time Intervals.

Definition at line 491 of file GCOMObservation.hpp.

References m_tim.

Referenced by GCOMDri::compute_dre(), GCOMDri::compute_drg(), GCOMDris::compute_drws_energy(), GCOMDris::compute_drws_phibar(), GCOMDri::compute_drx(), tim(), GCOMDris::vetorate_generate(), and GCOMDris::vetorate_setup().

◆ use_event_for_likelihood()

bool GCOMObservation::use_event_for_likelihood ( const int & index) const
protectedvirtual

Check whether bin should be used for likelihood analysis.

Parameters
[in]indexEvent index.
Returns
True if event with specified index should be used.

Implements the Phibar event selection.

Reimplemented from GObservation.

Definition at line 2563 of file GCOMObservation.cpp.

References m_drg, m_phi_first, m_phi_last, GCOMDri::map(), and GSkyMap::npix().

Referenced by npred().

◆ write()

void GCOMObservation::write ( GXmlElement & xml) const
virtual

Write observation into XML element.

Parameters
[in]xmlXML element.

Writes information for a COMPTEL observation into an XML element. The method supports both an unbinned and a binned observation.

For an unbinned observation the XML format is

<observation name="Crab" id="000001" instrument="COM">
  <parameter name="EVP" file="m16992_evp.fits"/>
  <parameter name="TIM" file="m10695_tim.fits"/>
  <parameter name="OAD" file="m20039_oad.fits"/>
  <parameter name="OAD" file="m20041_oad.fits"/>
  <parameter name="HKD" file="m20035_hkd.fits"/>
  <parameter name="HKD" file="m20037_hkd.fits"/>
  <parameter name="BVC" file="s10150_bvc.fits"/>
  ...
</observation>

where the observation can contain an arbitrary number of OAD file parameters. The file attribute provide either absolute or relative file names. If a file name includes no access path it is assumed that the file resides in the same location as the XML file. The HKD and BVC files are optional and are only written if HKD and BVC information is contained in the observation.

For a binned observation the XML format is

<observation name="Crab" id="000001" instrument="COM">
  <parameter name="DRE" file="m50438_dre.fits"/>
  <parameter name="DRB" file="m34997_drg.fits"/>
  <parameter name="DRW" file="m34997_drw.fits"/>
  <parameter name="DRG" file="m34997_drg.fits"/>
  <parameter name="DRX" file="m32171_drx.fits"/>
  <parameter name="IAQ" value="UNH(1.0-3.0)MeV"/>
</observation>

Note that the DRW parameter is optional.

Implements GObservation.

Definition at line 695 of file GCOMObservation.cpp.

References GXmlNode::append(), GXmlElement::attribute(), GXmlNode::element(), GXmlNode::elements(), GFilename::exists(), G_WRITE, is_binned(), GCOMBvcs::is_empty(), GFilename::is_empty(), is_unbinned(), m_bvcname, m_bvcs, m_drbname, m_drename, m_drgname, m_drwname, m_drxname, m_evpname, m_hkdnames, m_oadnames, m_phi_first, m_phi_last, m_response, m_rspname, m_timname, GXmlNode::remove(), GCOMResponse::rspname(), GCOMResponse::save_cache(), gammalib::str(), gammalib::xml_file_reduce(), and gammalib::xml_need_par().

◆ write_attributes()

void GCOMObservation::write_attributes ( GFitsHDU * hdu) const
protected

Write observation attributes.

Parameters
[in]hduFITS HDU pointer

Nothing is done if the HDU pointer is NULL.

Todo
Implement method.

Definition at line 1583 of file GCOMObservation.cpp.

Member Data Documentation

◆ m_bvcname

GFilename GCOMObservation::m_bvcname
protected

BVC filename.

Definition at line 242 of file GCOMObservation.hpp.

Referenced by copy_members(), init_members(), load(), and write().

◆ m_bvcs

GCOMBvcs GCOMObservation::m_bvcs
protected

Solar System Barycentre Data.

Definition at line 246 of file GCOMObservation.hpp.

Referenced by bvcs(), bvcs(), copy_members(), init_members(), load(), print(), and write().

◆ m_deadc

double GCOMObservation::m_deadc
protected

Deadtime correction.

Definition at line 220 of file GCOMObservation.hpp.

Referenced by copy_members(), deadc(), deadc(), GCOMObservation(), GCOMObservation(), init_members(), load(), load_dre(), and print().

◆ m_drb

◆ m_drbname

GFilename GCOMObservation::m_drbname
protected

◆ m_drename

GFilename GCOMObservation::m_drename
protected

◆ m_drg

◆ m_drgname

GFilename GCOMObservation::m_drgname
protected

◆ m_drw

GCOMDri GCOMObservation::m_drw
protected

Weighting cube.

Definition at line 230 of file GCOMObservation.hpp.

Referenced by compute_drb_bgdlixf(), copy_members(), drw(), GCOMObservation(), init_members(), and load_drw().

◆ m_drwname

GFilename GCOMObservation::m_drwname
protected

◆ m_drx

GCOMDri GCOMObservation::m_drx
protected

Exposure map.

Definition at line 232 of file GCOMObservation.hpp.

Referenced by copy_members(), drx(), GCOMObservation(), GCOMObservation(), init_members(), and load_drx().

◆ m_drxname

GFilename GCOMObservation::m_drxname
protected

◆ m_evpname

GFilename GCOMObservation::m_evpname
protected

EVP filename.

Definition at line 238 of file GCOMObservation.hpp.

Referenced by copy_members(), init_members(), load(), and write().

◆ m_ewidth

double GCOMObservation::m_ewidth
protected

Energy width (MeV)

Definition at line 233 of file GCOMObservation.hpp.

Referenced by copy_members(), ewidth(), ewidth(), GCOMObservation(), GCOMObservation(), init_members(), and load_dre().

◆ m_hkdnames

std::vector<GFilename> GCOMObservation::m_hkdnames
protected

HKD filenames.

Definition at line 241 of file GCOMObservation.hpp.

Referenced by copy_members(), init_members(), load(), and write().

◆ m_hkds

GCOMHkds GCOMObservation::m_hkds
protected

Housekeeping Data.

Definition at line 245 of file GCOMObservation.hpp.

Referenced by copy_members(), hkds(), hkds(), init_members(), load(), and print().

◆ m_instrument

std::string GCOMObservation::m_instrument
protected

Instrument name.

Definition at line 215 of file GCOMObservation.hpp.

Referenced by copy_members(), init_members(), instrument(), and read().

◆ m_livetime

double GCOMObservation::m_livetime
protected

Livetime (sec)

Definition at line 219 of file GCOMObservation.hpp.

Referenced by copy_members(), GCOMObservation(), GCOMObservation(), init_members(), livetime(), livetime(), load(), and load_dre().

◆ m_oadnames

std::vector<GFilename> GCOMObservation::m_oadnames
protected

OAD filenames.

Definition at line 240 of file GCOMObservation.hpp.

Referenced by copy_members(), init_members(), load(), and write().

◆ m_oads

GCOMOads GCOMObservation::m_oads
protected

Orbit Aspect Data.

Definition at line 244 of file GCOMObservation.hpp.

Referenced by copy_members(), init_members(), load(), oads(), oads(), and print().

◆ m_obs_id

double GCOMObservation::m_obs_id
protected

Observation ID.

Definition at line 217 of file GCOMObservation.hpp.

Referenced by copy_members(), GCOMObservation(), GCOMObservation(), init_members(), obs_id(), obs_id(), and read_attributes().

◆ m_ontime

double GCOMObservation::m_ontime
protected

Ontime (sec)

Definition at line 218 of file GCOMObservation.hpp.

Referenced by copy_members(), GCOMObservation(), GCOMObservation(), init_members(), load(), load_dre(), ontime(), and ontime().

◆ m_phi_first

int GCOMObservation::m_phi_first
protected

First Phibar layer to use for likelihood.

Definition at line 234 of file GCOMObservation.hpp.

Referenced by copy_members(), init_members(), phi_first(), phi_first(), print(), read(), use_event_for_likelihood(), and write().

◆ m_phi_last

int GCOMObservation::m_phi_last
protected

Last Phibar layer to use for likelihood.

Definition at line 235 of file GCOMObservation.hpp.

Referenced by copy_members(), init_members(), phi_last(), phi_last(), print(), read(), use_event_for_likelihood(), and write().

◆ m_response

GCOMResponse GCOMObservation::m_response
protected

Response functions.

Definition at line 216 of file GCOMObservation.hpp.

Referenced by copy_members(), init_members(), read(), response(), response(), response(), response(), and write().

◆ m_rspname

GFilename GCOMObservation::m_rspname
protected

Response cache filename.

Definition at line 228 of file GCOMObservation.hpp.

Referenced by copy_members(), init_members(), print(), read(), rspname(), rspname(), and write().

◆ m_tim

GCOMTim GCOMObservation::m_tim
protected

COMPTEL Good Time Intervals.

Definition at line 243 of file GCOMObservation.hpp.

Referenced by copy_members(), init_members(), load(), print(), tim(), and tim().

◆ m_timname

GFilename GCOMObservation::m_timname
protected

TIM filename.

Definition at line 239 of file GCOMObservation.hpp.

Referenced by copy_members(), init_members(), load(), and write().


The documentation for this class was generated from the following files: