GammaLib 2.1.0.dev
|
Interface for the COMPTEL instrument response function. More...
#include <GCOMResponse.hpp>
Public Member Functions | |
GCOMResponse (void) | |
Void constructor. | |
GCOMResponse (const GCOMResponse &rsp) | |
Copy constructor. | |
GCOMResponse (const GCaldb &caldb, const std::string &rspname) | |
Response constructor. | |
virtual | ~GCOMResponse (void) |
Destructor. | |
virtual GCOMResponse & | operator= (const GCOMResponse &rsp) |
Assignment operator. | |
virtual void | clear (void) |
Clear instance. | |
virtual GCOMResponse * | clone (void) const |
Clone instance. | |
virtual std::string | classname (void) const |
Return class name. | |
virtual bool | use_edisp (void) const |
Signal if energy dispersion will be used. | |
virtual bool | use_tdisp (void) const |
Signal if time dispersion will be used. | |
virtual double | irf (const GEvent &event, const GPhoton &photon, const GObservation &obs) const |
Return value of instrument response function. | |
virtual double | nroi (const GModelSky &model, const GEnergy &obsEng, const GTime &obsTime, const GObservation &obs) const |
Return integral of event probability for a given sky model over ROI. | |
virtual GEbounds | ebounds (const GEnergy &obsEnergy) const |
Return true energy boundaries for a specific observed energy. | |
virtual std::string | print (const GChatter &chatter=NORMAL) const |
Print COMPTEL response information. | |
void | caldb (const GCaldb &caldb) |
Set calibration database. | |
const GCaldb & | caldb (void) const |
Return calibration database. | |
const std::string & | rspname (void) const |
Return response name. | |
void | load (const std::string &rspname) |
Load COMPTEL response. | |
void | read (const GFitsImage &hdu) |
Read COMPTEL response from FITS image. | |
void | write (GFitsImageFloat &image) const |
Write COMPTEL response into FITS image. | |
void | load_cache (const GFilename &filename) |
Load response cache. | |
void | save_cache (const GFilename &filename) const |
Save response cache. | |
void | backproject (const GObservation &obs, const GEvents *events, GSkyMap *map) const |
Backproject events using instrument response function to sky map. | |
Public Member Functions inherited from GResponse | |
GResponse (void) | |
Void constructor. | |
GResponse (const GResponse &rsp) | |
Copy constructor. | |
virtual | ~GResponse (void) |
Destructor. | |
virtual GResponse & | operator= (const GResponse &rsp) |
Assignment operator. | |
virtual double | convolve (const GModelSky &model, const GEvent &event, const GObservation &obs, const bool &grad=true) const |
Convolve sky model with the instrument response. | |
virtual GVector | convolve (const GModelSky &model, const GObservation &obs, GMatrixSparse *gradients=NULL) const |
Convolve sky model with the instrument response. | |
virtual double | irf_spatial (const GEvent &event, const GSource &source, const GObservation &obs) const |
Return instrument response integrated over the spatial model. | |
virtual GVector | irf_spatial (const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const |
Return instrument response vector integrated over the spatial model. | |
virtual void | remove_response_cache (const std::string &cache_id) |
Remove response cache for specific observation and model. | |
Public Member Functions inherited from GBase | |
virtual | ~GBase (void) |
Destructor. | |
Private Member Functions | |
void | init_members (void) |
Initialise class members. | |
void | copy_members (const GCOMResponse &rsp) |
Copy class members. | |
void | free_members (void) |
Delete class members. | |
void | compute_faq (void) |
Compute FAQ. | |
virtual GVector | irf_ptsrc (const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const |
Return instrument response to point source. | |
virtual GVector | irf_radial (const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const |
Return instrument response to radial source. | |
virtual GVector | irf_elliptical (const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const |
Return instrument response to elliptical source. | |
virtual GVector | irf_diffuse (const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const |
Return instrument response to diffuse source. | |
Private Attributes | |
GCaldb | m_caldb |
Calibration database. | |
std::string | m_rspname |
Response name. | |
std::vector< double > | m_iaq |
IAQ array. | |
GSkyMap | m_faq |
FAQ array. | |
std::vector< bool > | m_faq_zero |
Array of zero FAQ bins. | |
std::vector< GVector > | m_faq_native |
Array of native FAQ vectors. | |
GVector | m_faq_solidangle |
Array of FAQ solid angles. | |
int | m_phigeo_bins |
Number of Phigeo bins. | |
int | m_phibar_bins |
Number of Phibar bins. | |
int | m_faq_bins |
Number of FAQ bins. | |
double | m_phigeo_ref_value |
Phigeo reference value (deg) | |
double | m_phigeo_ref_pixel |
Phigeo reference pixel (starting from 1) | |
double | m_phigeo_bin_size |
Phigeo binsize (deg) | |
double | m_phigeo_min |
Phigeo value of first bin (deg) | |
double | m_phibar_ref_value |
Phigeo reference value (deg) | |
double | m_phibar_ref_pixel |
Phigeo reference pixel (starting from 1) | |
double | m_phibar_bin_size |
Phigeo binsize (deg) | |
double | m_phibar_min |
Phigeo value of first bin (deg) | |
Friends | |
class | GCOMDri |
Additional Inherited Members | |
Protected Member Functions inherited from GResponse | |
void | init_members (void) |
Initialise class members. | |
void | copy_members (const GResponse &rsp) |
Copy class members. | |
void | free_members (void) |
Delete class members. | |
double | eval_prob (const GModelSky &model, const GEvent &event, const GEnergy &srcEng, const GTime &srcTime, const GObservation &obs, const bool &grad) const |
Convolve sky model with the instrument response. | |
GVector | eval_probs (const GModelSky &model, const GObservation &obs, GMatrixSparse *gradients=NULL) const |
Convolve sky model with the instrument response. | |
int | size_edisp_vector (const GModelSky &model, const GObservation &obs, const bool &grad) const |
Return size of vector for energy dispersion computation. | |
GEbounds | ebounds_model (const GModelSky &model) const |
Return true energy intervals for sky model. | |
virtual double | irf_ptsrc (const GEvent &event, const GSource &source, const GObservation &obs) const |
Return instrument response to point source. | |
virtual double | irf_radial (const GEvent &event, const GSource &source, const GObservation &obs) const |
Return instrument response to radial source. | |
virtual double | irf_elliptical (const GEvent &event, const GSource &source, const GObservation &obs) const |
Return instrument response to elliptical source. | |
virtual double | irf_diffuse (const GEvent &event, const GSource &source, const GObservation &obs) const |
Return instrument response to diffuse source. | |
virtual double | irf_composite (const GEvent &event, const GSource &source, const GObservation &obs) const |
Return instrument response to composite source. | |
virtual GVector | irf_composite (const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const |
Return instrument response to composite source sky model. | |
Protected Attributes inherited from GResponse | |
bool | m_use_irf_cache |
Control usage of irf cache. | |
bool | m_use_nroi_cache |
Control usage of nroi cache. | |
int | m_irf_radial_iter_theta |
Radial model integration theta iterations. | |
int | m_irf_radial_iter_phi |
Radial model integration phi iterations. | |
int | m_irf_elliptical_iter_theta |
Elliptical model integration theta iterations. | |
int | m_irf_elliptical_iter_phi |
Elliptical model integration phi iterations. | |
double | m_irf_diffuse_resolution |
Angular resolution for diffuse model. | |
GResponseCache | m_irf_cache |
GResponseCache | m_nroi_cache |
GResponseVectorCache | m_irf_vector_cache |
Interface for the COMPTEL instrument response function.
Definition at line 59 of file GCOMResponse.hpp.
GCOMResponse::GCOMResponse | ( | void | ) |
Void constructor.
Creates an empty COMPTEL response.
Definition at line 105 of file GCOMResponse.cpp.
References init_members().
Referenced by clone().
GCOMResponse::GCOMResponse | ( | const GCOMResponse & | rsp | ) |
Copy constructor.
[in] | rsp | COM response. |
Definition at line 120 of file GCOMResponse.cpp.
References copy_members(), and init_members().
GCOMResponse::GCOMResponse | ( | const GCaldb & | caldb, |
const std::string & | iaqname ) |
Response constructor.
[in] | caldb | Calibration database. |
[in] | iaqname | IAQ file name. |
Create COMPTEL response by loading an IAQ file from a calibration database.
Definition at line 142 of file GCOMResponse.cpp.
References caldb(), init_members(), and load().
|
virtual |
Destructor.
Destroys instance of COMPTEL response object.
Definition at line 164 of file GCOMResponse.cpp.
References free_members().
void GCOMResponse::backproject | ( | const GObservation & | obs, |
const GEvents * | events, | ||
GSkyMap * | map ) const |
Backproject events using instrument response function to sky map.
[in] | obs | Observation. |
[in] | events | Events. |
[in,out] | map | Sky map. |
GException::invalid_argument | Events pointer invalid. Sky map pointer invalid. Observation is not a COMPTEL observation. Events are not a COMPTEL event cube. |
GException::invalid_value | Response not initialised with a valid IAQ Incompatible IAQ encountered |
Backprojects events using the instrument response function to sky map using
\[ f_j = \sum_i n_i R_{ij} \]
where
If the sky map contains at least two maps, the second map will contain on output the normalisation map
\[ f_j = \sum_i R_{ij} \]
Definition at line 770 of file GCOMResponse.cpp.
References GSkyMap::contains(), GCOMObservation::deadc(), gammalib::deg2rad, GSkyDir::dist_deg(), GCOMEventCube::dre(), GCOMObservation::drg(), GCOMObservation::drx(), G_BACKPROJECT, GSkyMap::inx2dir(), irf(), m_iaq, m_phibar_bins, m_phigeo_bin_size, m_phigeo_bins, m_phigeo_min, GCOMDri::map(), GCOMDri::nchi(), GSkyMap::nmaps(), norm(), GCOMDri::nphibar(), GSkyMap::npix(), GCOMDri::npsi(), GCOMObservation::ontime(), GCOMDri::phase_correction(), GSkyMap::pixels(), GCOMDri::size(), gammalib::str(), and GCOMDri::tof_correction().
|
inline |
Set calibration database.
[in] | caldb | Calibration database. |
Sets the calibration database for the COMPTEL response.
Definition at line 202 of file GCOMResponse.hpp.
References caldb(), and m_caldb.
Referenced by GCOMObservation::response().
|
inline |
Return calibration database.
Definition at line 188 of file GCOMResponse.hpp.
References m_caldb.
Referenced by caldb(), GCOMResponse(), and load().
|
inlinevirtual |
Return class name.
Implements GResponse.
Definition at line 152 of file GCOMResponse.hpp.
|
virtual |
Clear instance.
Clears COMPTEL response object by resetting all members to an initial state. Any information that was present in the object before will be lost.
Implements GResponse.
Definition at line 227 of file GCOMResponse.cpp.
References free_members(), GResponse::free_members(), init_members(), and GResponse::init_members().
Referenced by GCOMObservation::init_members(), load(), and GCOMObservation::response().
|
virtual |
Clone instance.
Implements GResponse.
Definition at line 247 of file GCOMResponse.cpp.
References GCOMResponse().
|
private |
Compute FAQ.
Computes FAQ from IAQ that is needed for direction projection computation
Definition at line 1107 of file GCOMResponse.cpp.
References GSkyMap::clear(), GVector::clear(), gammalib::deg2rad, m_faq, m_faq_bins, m_faq_native, m_faq_solidangle, m_faq_zero, m_iaq, m_phibar_bins, m_phigeo_bin_size, m_phigeo_bins, GSkyMap::npix(), GSkyMap::save(), and GSkyMap::solidangle().
Referenced by read().
|
private |
Copy class members.
[in] | rsp | COMPTEL response. |
Definition at line 1065 of file GCOMResponse.cpp.
References m_caldb, m_faq, m_faq_bins, m_faq_native, m_faq_solidangle, m_faq_zero, m_iaq, m_phibar_bin_size, m_phibar_bins, m_phibar_min, m_phibar_ref_pixel, m_phibar_ref_value, m_phigeo_bin_size, m_phigeo_bins, m_phigeo_min, m_phigeo_ref_pixel, m_phigeo_ref_value, and m_rspname.
Referenced by GCOMResponse(), and operator=().
Return true energy boundaries for a specific observed energy.
[in] | obsEnergy | Observed Energy. |
GException::feature_not_implemented | Method is not implemented. |
Implements GResponse.
Definition at line 469 of file GCOMResponse.cpp.
References ebounds(), and G_EBOUNDS.
Referenced by ebounds().
|
private |
Delete class members.
Definition at line 1095 of file GCOMResponse.cpp.
Referenced by clear(), operator=(), and ~GCOMResponse().
|
private |
Initialise class members.
Definition at line 1033 of file GCOMResponse.cpp.
References GCaldb::clear(), GSkyMap::clear(), GVector::clear(), m_caldb, m_faq, m_faq_bins, m_faq_native, m_faq_solidangle, m_faq_zero, m_iaq, m_phibar_bin_size, m_phibar_bins, m_phibar_min, m_phibar_ref_pixel, m_phibar_ref_value, m_phigeo_bin_size, m_phigeo_bins, m_phigeo_min, m_phigeo_ref_pixel, m_phigeo_ref_value, and m_rspname.
Referenced by clear(), GCOMResponse(), GCOMResponse(), GCOMResponse(), and operator=().
|
virtual |
Return value of instrument response function.
[in] | event | Observed event. |
[in] | photon | Incident photon. |
[in] | obs | Observation. |
GException::invalid_argument | Observation is not a COMPTEL observation. Event is not a COMPTEL event bin. |
GException::invalid_value | Response not initialised with a valid IAQ |
Returns the instrument response function for a given observed photon direction as function of the assumed true photon direction. The result is given by
\[ {\tt IRF} = \frac{{\tt IAQ} \times {\tt DRG} \times {\tt DRX}} {T \times {\tt TOFCOR}} \times {\tt PHASECOR} \]
where
The observed photon direction is spanned by the three values \(\Chi\), \(\Psi\), and \(\bar{\varphi})\). \(\Chi\) and \(\Psi\) is the scatter direction of the event, given in sky coordinates. \(\bar{\varphi}\) is the Compton scatter angle, computed from the energy deposits in the two detector planes.
Implements GResponse.
Definition at line 293 of file GCOMResponse.cpp.
References GObservation::deadc(), GCOMEventBin::dir(), GCOMInstDir::dir(), GPhoton::dir(), GSkyDir::dist_deg(), GCOMEventCube::dre(), GCOMObservation::drg(), GCOMObservation::drx(), GObservation::events(), G_IRF, irf(), gammalib::is_infinite(), gammalib::is_notanumber(), m_iaq, m_phibar_bin_size, m_phibar_bins, m_phigeo_bin_size, m_phigeo_bins, GCOMDri::map(), GCOMObservation::ontime(), GCOMDri::phase_correction(), GCOMInstDir::phibar(), GPhoton::time(), and GCOMDri::tof_correction().
Referenced by backproject(), irf(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), and irf_radial().
|
privatevirtual |
Return instrument response to diffuse source.
[in] | model | Sky model. |
[in] | obs | Observation. |
[out] | gradients | Gradients matrix. |
GException::invalid_value | Response not initialised with a valid IAQ Incompatible IAQ encountered |
Returns the instrument response to a diffuse source sky model for all events. The methods works on response vectors that are computed per pointing. The method assumes that the spatial model component is of type GModelSpatialDiffuse, that the observations is of type GCOMObservation and that the events are of type GCOMEventCube. No checking of these assumptions is performed by the method, and not respecting the assumptions will results in a segfault.
The computation is done using a direct convolution in the system of the instrument response function, sampling fully the resolution of the data space.
For details about the choice of the convolution method and its parameters see https://gitlab.in2p3.fr/gammalib/gammalib/-/issues/14.
gradients
is an optional matrix where the number of rows corresponds to the number of events in the observation and the number of columns corresponds to the number of spatial model parameters. Since for diffuse sources no gradients are computed, the method does not alter the content of gradients
.
Reimplemented from GResponse.
Definition at line 2144 of file GCOMResponse.cpp.
References GSkyMap::contains(), GCOMObservation::deadc(), GSkyDir::dec_deg(), gammalib::deg2rad, GCOMEventBin::dir(), GCOMInstDir::dir(), GCOMEventCube::dre(), GCOMObservation::drg(), GCOMObservation::drx(), GCOMEventBin::energy(), GMatrix::eulery(), GMatrix::eulerz(), GModelSpatial::eval(), GModelSpatialDiffuse::eval(), GObservation::events(), G_IRF_DIFFUSE, gammalib::get_current_clock(), irf(), GSkyMap::is_empty(), m_faq, m_faq_bins, m_faq_native, m_faq_solidangle, m_faq_zero, m_iaq, m_phibar_bins, m_phigeo_bin_size, m_phigeo_bins, m_phigeo_min, GCOMDri::map(), GCOMEventCube::naxis(), GCOMObservation::ontime(), GCOMDri::phase_correction(), GSkyMap::pixels(), GSkyDir::ra_deg(), GSkyDir::rotate(), GCOMEventCube::size(), GModelSky::spatial(), gammalib::str(), GCOMEventBin::time(), GCOMDri::tof_correction(), and gammalib::twopi.
|
privatevirtual |
Return instrument response to elliptical source.
[in] | model | Sky model. |
[in] | obs | Observation. |
[out] | gradients | Gradients matrix. |
GException::invalid_value | Response not initialised with a valid IAQ Incompatible IAQ encountered |
Returns the instrument response to an elliptical source sky model for all events. The methods works on response vectors that are computed per pointing. The method assumes that the spatial model component is of type GModelSpatialElliptical, that the observations is of type GCOMObservation and that the events are of type GCOMEventCube. No checking of these assumptions is performed by the method, and not respecting the assumptions will results in a segfault.
The method toggles between two convolution methods that are used depending on the extent of the elliptical source. Extent means here the larger of the minor and major "radius" parameters, which is the radius for a disk or the sigma parameter for a Gaussian.
For extents smaller than 10 degrees a numerical integration is performed in a radial system around the elliptical model that is fast but that may become inaccurate for larger extents as the model sampling will exceed the resolution of the data space. The number of iterations in the zenith and azimuth angle was fixed to 6.
For extents larger than 15 degrees a direct convolution is performed in the system of the instrument response function, that is slower, but that samples fully the resolution of the data space. The direct convolution is however not accurate for angles smaller than about 1 degree, hence it is not appropriate to compute for the response for the determination of upper limits.
For intermediate extents (in the interval 10 - 15 degrees), both convolutions are computed and combined according to a weight that varies linearly with source extent. In principle the convolved results should be identical in that intermediate range, but computing both and their weighted combination assures that no steps occur when varying the source extent, which is required for seamless log-likelihood fits.
For details about the choice of the convolution method and its parameters see https://gitlab.in2p3.fr/gammalib/gammalib/-/issues/14.
gradients
is an optional matrix where the number of rows corresponds to the number of events in the observation and the number of columns corresponds to the number of spatial model parameters. Since for elliptical sources no gradients are computed, the method does not alter the content of gradients
.
< 6 iterations
< 6 iterations
< Integration for extent < 10 deg
< Direct for extent > 15 deg
Reimplemented from GResponse.
Definition at line 1819 of file GCOMResponse.cpp.
References GSkyMap::contains(), GModelSpatialElliptical::coordsys(), GCOMObservation::deadc(), GSkyDir::dec_deg(), gammalib::deg2rad, GCOMEventBin::dir(), GCOMInstDir::dir(), GModelSpatialElliptical::dir(), GSkyDir::dist(), GCOMEventCube::dre(), GCOMObservation::drg(), GCOMObservation::drx(), GCOMEventBin::energy(), GMatrix::eulery(), GMatrix::eulerz(), GModelSpatialElliptical::eval(), GObservation::events(), GIntegrals::fixed_iter(), G_IRF_ELLIPTICAL, gammalib::get_current_clock(), irf(), GSkyMap::is_empty(), m_faq, m_faq_bins, m_faq_native, m_faq_solidangle, m_faq_zero, m_iaq, m_phibar_bins, m_phigeo_bin_size, m_phigeo_bins, m_phigeo_min, GCOMDri::map(), GCOMEventCube::naxis(), norm(), GCOMObservation::ontime(), GCOMDri::phase_correction(), GSkyMap::pixels(), GSkyDir::posang(), GSkyDir::ra_deg(), GIntegrals::romberg(), GCOMEventCube::size(), GModelSky::spatial(), gammalib::str(), GModelSpatialElliptical::theta_max(), GCOMEventBin::time(), and GCOMDri::tof_correction().
|
privatevirtual |
Return instrument response to point source.
[in] | model | Sky model. |
[in] | obs | Observation. |
[out] | gradients | Gradients matrix. |
GException::invalid_argument | Observation is not a COMPTEL observation. Event is not a COMPTEL event bin. |
GException::invalid_value | Response not initialised with a valid IAQ Incompatible IAQ encountered |
Returns the instrument response to a point source for all events in the observations.
gradients
is an optional matrix where the number of rows corresponds to the number of events in the observation and the number of columns corresponds to the number of spatial model parameters. Since for point sources no gradients are computed, the method does not alter the content of gradients
.
Reimplemented from GResponse.
Definition at line 1277 of file GCOMResponse.cpp.
References GCOMObservation::deadc(), GCOMEventBin::dir(), GCOMInstDir::dir(), GSkyDir::dist_deg(), GCOMEventCube::dre(), GCOMObservation::drg(), GCOMObservation::drx(), GObservation::events(), G_IRF_PTSRC, GObservation::id(), irf(), m_iaq, m_phibar_bins, m_phigeo_bin_size, m_phigeo_bins, GCOMDri::map(), GObservation::name(), GCOMEventCube::naxis(), GCOMObservation::ontime(), GCOMDri::phase_correction(), GSkyMap::pixels(), GCOMEventCube::size(), GModelSky::spatial(), gammalib::str(), and GCOMDri::tof_correction().
|
privatevirtual |
Return instrument response to radial source.
[in] | model | Sky model. |
[in] | obs | Observation. |
[out] | gradients | Gradients matrix. |
GException::invalid_value | Response not initialised Incompatible IAQ encountered |
Returns the instrument response to a radial source sky model for all events. The methods works on response vectors that are computed per pointing. The method assumes that the spatial model component is of type GModelSpatialRadial, that the observations is of type GCOMObservation and that the events are of type GCOMEventCube. No checking of these assumptions is performed by the method, and not respecting the assumptions will results in a segfault.
The method toggles between two convolution methods that are used depending on the extent of the radial source. Extent means here the value of the radial parameter, which is the radius for a disk or the sigma parameter for a Gaussian.
For extents smaller than 10 degrees a numerical integration is performed in the system of the radial model that is fast but that may become inaccurate for larger extents as the model sampling will exceed the resolution of the data space. The number of iterations in the zenith and azimuth angle was fixed to 6.
For extents larger than 15 degrees a direct convolution is performed in the system of the instrument response function, that is slower, but that samples fully the resolution of the data space. The direct convolution is however not accurate for angles smaller than about 1 degree, hence it is not appropriate to compute for the response for the determination of upper limits.
For intermediate extents (in the interval 10 - 15 degrees), both convolutions are computed and combined according to a weight that varies linearly with source extent. In principle the convolved results should be identical in that intermediate range, but computing both and their weighted combination assures that no steps occur when varying the source extent, which is required for seamless log-likelihood fits.
For details about the choice of the convolution method and its parameters see https://gitlab.in2p3.fr/gammalib/gammalib/-/issues/14.
gradients
is an optional matrix where the number of rows corresponds to the number of events in the observation and the number of columns corresponds to the number of spatial model parameters. Since for radial sources no gradients are computed, the method does not alter the content of gradients
.
< 6 iterations
< 6 iterations
< Integration for extent < 10 deg
< Direct for extent > 15 deg
Reimplemented from GResponse.
Definition at line 1479 of file GCOMResponse.cpp.
References GSkyMap::contains(), GCOMObservation::deadc(), GSkyDir::dec_deg(), gammalib::deg2rad, GCOMEventBin::dir(), GCOMInstDir::dir(), GModelSpatialRadial::dir(), GSkyDir::dist(), GCOMEventCube::dre(), GCOMObservation::drg(), GCOMObservation::drx(), GCOMEventBin::energy(), GMatrix::eulery(), GMatrix::eulerz(), GModelSpatialRadial::eval(), GObservation::events(), GIntegrals::fixed_iter(), G_IRF_RADIAL, gammalib::get_current_clock(), irf(), GSkyMap::is_empty(), m_faq, m_faq_bins, m_faq_native, m_faq_solidangle, m_faq_zero, m_iaq, m_phibar_bins, m_phigeo_bin_size, m_phigeo_bins, m_phigeo_min, GCOMDri::map(), GCOMEventCube::naxis(), norm(), GCOMObservation::ontime(), GCOMDri::phase_correction(), GSkyMap::pixels(), GSkyDir::ra_deg(), GIntegrals::romberg(), GCOMEventCube::size(), GModelSky::spatial(), gammalib::str(), GModelSpatialRadial::theta_max(), GCOMEventBin::time(), and GCOMDri::tof_correction().
void GCOMResponse::load | ( | const std::string & | rspname | ) |
Load COMPTEL response.
[in] | rspname | COMPTEL response name. |
Loads the COMPTEL response with specified name rspname
.
The method first attempts to interpret rspname
as a file name and to load the corresponding response.
If rspname
is not a FITS file the method searches for an appropriate response in the calibration database. If no appropriate response is found, the method takes the CALDB root path and response name to build the full path to the response file, and tries to load the response from these paths.
If also this fails an exception is thrown.
Definition at line 501 of file GCOMResponse.cpp.
References caldb(), clear(), GFits::close(), GFilename::exists(), GCaldb::filename(), gammalib::filepath(), GFits::image(), GFilename::is_empty(), GFilename::is_fits(), m_caldb, m_rspname, read(), GCaldb::rootdir(), and rspname().
Referenced by GCOMResponse(), and GCOMObservation::response().
void GCOMResponse::load_cache | ( | const GFilename & | filename | ) |
Load response cache.
[in] | filename | Response cache filename. |
Loads response cache from FITS file.
Definition at line 707 of file GCOMResponse.cpp.
References GResponseVectorCache::load(), and GResponse::m_irf_vector_cache.
Referenced by GCOMObservation::read().
|
virtual |
Return integral of event probability for a given sky model over ROI.
[in] | model | Sky model. |
[in] | obsEng | Observed photon energy. |
[in] | obsTime | Observed photon arrival time. |
[in] | obs | Observation. |
GException::feature_not_implemented | Method is not implemented. |
Implements GResponse.
Definition at line 445 of file GCOMResponse.cpp.
References G_NROI.
|
virtual |
Assignment operator.
[in] | rsp | COMPTEL response. |
Assigns COMPTEL response object to another COMPTEL response object. The assignment performs a deep copy of all information, hence the original object from which the assignment has been performed can be destroyed after this operation without any loss of information.
Definition at line 191 of file GCOMResponse.cpp.
References copy_members(), free_members(), init_members(), and GResponse::operator=().
Print COMPTEL response information.
[in] | chatter | Chattiness. |
Implements GResponse.
Definition at line 971 of file GCOMResponse.cpp.
References EXPLICIT, m_caldb, m_phibar_bin_size, m_phibar_bins, m_phibar_min, m_phibar_ref_pixel, m_phibar_ref_value, m_phigeo_bin_size, m_phigeo_bins, m_phigeo_min, m_phigeo_ref_pixel, m_phigeo_ref_value, m_rspname, gammalib::parformat(), GCaldb::print(), SILENT, gammalib::str(), and VERBOSE.
void GCOMResponse::read | ( | const GFitsImage & | image | ) |
Read COMPTEL response from FITS image.
[in] | image | FITS image. |
Read the COMPTEL response from IAQ FITS file and convert the IAQ values into a probability per steradian.
The IAQ values are divided by the solid angle of a Phigeo bin which is given by
\begin{eqnarray*} \Omega & = & 2 \pi \left[ \left( 1 - \cos \left( \varphi_{\rm geo} + \frac{1}{2} \Delta \varphi_{\rm geo} \right) \right) - \left( 1 - \cos \left( \varphi_{\rm geo} - \frac{1}{2} \Delta \varphi_{\rm geo} \right) \right) \right] \\ &=& 2 \pi \left[ \cos \left( \varphi_{\rm geo} - \frac{1}{2} \Delta \varphi_{\rm geo} \right) - \cos \left( \varphi_{\rm geo} + \frac{1}{2} \Delta \varphi_{\rm geo} \right) \right] \\ &=& 4 \pi \sin \left( \varphi_{\rm geo} \right) \sin \left( \frac{1}{2} \Delta \varphi_{\rm geo} \right) \end{eqnarray*}
Definition at line 583 of file GCOMResponse.cpp.
References compute_faq(), gammalib::deg2rad, gammalib::fourpi, m_iaq, m_phibar_bin_size, m_phibar_bins, m_phibar_min, m_phibar_ref_pixel, m_phibar_ref_value, m_phigeo_bin_size, m_phigeo_bins, m_phigeo_min, m_phigeo_ref_pixel, m_phigeo_ref_value, GFitsImage::naxes(), GFitsImage::naxis(), GFitsImage::pixel(), and GFitsHDU::real().
Referenced by load().
|
inline |
Return response name.
Definition at line 215 of file GCOMResponse.hpp.
References m_rspname.
Referenced by load(), and GCOMObservation::write().
void GCOMResponse::save_cache | ( | const GFilename & | filename | ) | const |
Save response cache.
[in] | filename | Response cache filename. |
Saves response cache from FITS file.
Definition at line 724 of file GCOMResponse.cpp.
References GResponse::m_irf_vector_cache, and GResponseVectorCache::save().
Referenced by GCOMObservation::write().
|
inlinevirtual |
Signal if energy dispersion will be used.
Implements GResponse.
Definition at line 164 of file GCOMResponse.hpp.
|
inlinevirtual |
Signal if time dispersion will be used.
Implements GResponse.
Definition at line 176 of file GCOMResponse.hpp.
void GCOMResponse::write | ( | GFitsImageFloat & | image | ) | const |
Write COMPTEL response into FITS image.
[in] | image | FITS image. |
Writes the COMPTEL response into an IAQ FITS file.
Definition at line 652 of file GCOMResponse.cpp.
References GFitsHDU::card(), gammalib::deg2rad, gammalib::fourpi, m_iaq, m_phibar_bin_size, m_phibar_bins, m_phibar_ref_pixel, m_phibar_ref_value, m_phigeo_bin_size, m_phigeo_bins, m_phigeo_min, m_phigeo_ref_pixel, and m_phigeo_ref_value.
|
friend |
Definition at line 62 of file GCOMResponse.hpp.
|
private |
Calibration database.
Definition at line 125 of file GCOMResponse.hpp.
Referenced by caldb(), caldb(), copy_members(), init_members(), load(), and print().
|
private |
FAQ array.
Definition at line 128 of file GCOMResponse.hpp.
Referenced by compute_faq(), copy_members(), init_members(), irf_diffuse(), irf_elliptical(), and irf_radial().
|
private |
Number of FAQ bins.
Definition at line 134 of file GCOMResponse.hpp.
Referenced by compute_faq(), copy_members(), init_members(), irf_diffuse(), irf_elliptical(), and irf_radial().
|
private |
Array of native FAQ vectors.
Definition at line 130 of file GCOMResponse.hpp.
Referenced by compute_faq(), copy_members(), init_members(), irf_diffuse(), irf_elliptical(), and irf_radial().
|
private |
Array of FAQ solid angles.
Definition at line 131 of file GCOMResponse.hpp.
Referenced by compute_faq(), copy_members(), init_members(), irf_diffuse(), irf_elliptical(), and irf_radial().
|
private |
Array of zero FAQ bins.
Definition at line 129 of file GCOMResponse.hpp.
Referenced by compute_faq(), copy_members(), init_members(), irf_diffuse(), irf_elliptical(), and irf_radial().
|
private |
IAQ array.
Definition at line 127 of file GCOMResponse.hpp.
Referenced by backproject(), compute_faq(), copy_members(), init_members(), irf(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), irf_radial(), read(), and write().
|
private |
Phigeo binsize (deg)
Definition at line 141 of file GCOMResponse.hpp.
Referenced by copy_members(), init_members(), irf(), print(), read(), and write().
|
private |
Number of Phibar bins.
Definition at line 133 of file GCOMResponse.hpp.
Referenced by backproject(), compute_faq(), copy_members(), init_members(), irf(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), irf_radial(), print(), read(), and write().
|
private |
Phigeo value of first bin (deg)
Definition at line 142 of file GCOMResponse.hpp.
Referenced by copy_members(), init_members(), print(), and read().
|
private |
Phigeo reference pixel (starting from 1)
Definition at line 140 of file GCOMResponse.hpp.
Referenced by copy_members(), init_members(), print(), read(), and write().
|
private |
Phigeo reference value (deg)
Definition at line 139 of file GCOMResponse.hpp.
Referenced by copy_members(), init_members(), print(), read(), and write().
|
private |
Phigeo binsize (deg)
Definition at line 137 of file GCOMResponse.hpp.
Referenced by backproject(), compute_faq(), copy_members(), init_members(), irf(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), irf_radial(), print(), read(), and write().
|
private |
Number of Phigeo bins.
Definition at line 132 of file GCOMResponse.hpp.
Referenced by backproject(), compute_faq(), copy_members(), init_members(), irf(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), irf_radial(), print(), read(), and write().
|
private |
Phigeo value of first bin (deg)
Definition at line 138 of file GCOMResponse.hpp.
Referenced by backproject(), copy_members(), init_members(), irf_diffuse(), irf_elliptical(), irf_radial(), print(), read(), and write().
|
private |
Phigeo reference pixel (starting from 1)
Definition at line 136 of file GCOMResponse.hpp.
Referenced by copy_members(), init_members(), print(), read(), and write().
|
private |
Phigeo reference value (deg)
Definition at line 135 of file GCOMResponse.hpp.
Referenced by copy_members(), init_members(), print(), read(), and write().
|
private |
Response name.
Definition at line 126 of file GCOMResponse.hpp.
Referenced by copy_members(), init_members(), load(), print(), and rspname().