27#ifndef GSPIRESPONSE_HPP
28#define GSPIRESPONSE_HPP
108 virtual void clear(
void);
110 virtual std::string
classname(
void)
const;
118 const GTime& obsTime,
128 const double&
dlogE(
void)
const;
129 const double&
gamma(
void)
const;
134 const int& ireg)
const;
141 const bool& clobber =
false)
const;
162 const double* livetimes,
167 const double& emax)
const;
171 GMatrix* gradients = NULL)
const;
185 GMatrix* gradients = NULL)
const;
188 GMatrix* gradients = NULL)
const;
191 GMatrix* gradients = NULL)
const;
194 GMatrix* gradients = NULL)
const;
230 return (
"GSPIResponse");
360 return (
m_spix[ipt].dist(dir));
405 int map =
irf->detids[idet] + (
irf->ireg + ieng *
irf->nreg) *
irf->ndet;
Energy boundaries class interface definition.
Filename class interface definition.
Generic matrix class definition.
Node array class interface definition.
Abstract response base class definition.
Sky direction class interface definition.
Sky map class definition.
Vector class interface definition.
Energy boundaries container class.
bool is_empty(void) const
Signal if there are no energy boundaries.
Class that handles energies in a unit independent way.
Abstract interface for the event classes.
Abstract FITS image base class.
Generic matrix class definition.
Abstract observation base class.
Class that handles photons.
Abstract instrument response base class.
INTEGRAL/SPI event bin class.
INTEGRAL/SPI event bin container class.
INTEGRAL/SPI observation class.
INTEGRAL/SPI instrument response function class.
void irf_init(const GObservation &obs, GSPIResponseIrf *irf) const
Initialise structure for projection computation of response.
double m_wcs_xpix_max
Maximum X pixel index.
void set_detids(const GSPIEventCube *cube)
Set vector of detector identifiers used by the observation.
virtual std::string classname(void) const
Return class name.
virtual GSPIResponse & operator=(const GSPIResponse &rsp)
Assignment operator.
const double & gamma(void) const
Return power-law index for continuum IRFs.
const double & dlogE(void) const
Return logarithmic step size for continuum IRFs.
void write(GFits &fits) const
Write SPI response into FITS object.
int irf_map(const int &idet, const int &ieng, const GSPIResponseIrf *irf) const
Return map index for detector and energy index.
void irf_skydir(const int &ipt, const int &inx, GSPIResponseIrf *irf) const
Set sky direction for pointing and IRF pixel index.
virtual GVector irf_radial(const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const
Return instrument response to radial source sky model.
virtual GVector irf_ptsrc(const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const
Return instrument response to point source sky model.
virtual GVector irf_elliptical(const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const
Return instrument response to elliptical source sky model.
double m_wcs_xbin
X value bin size (radians)
void save(const GFilename &filename, const bool &clobber=false) const
Save SPI response into file.
GSkyMap m_irfs
IRFs stored as sky map.
GNodeArray m_energies
Node array of IRF energies.
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.
double irf_weight(const double &beta, const double &emin, const double &emax) const
Compute weight of logarithmic energy bin.
double m_wcs_ymin
Minimum Y value (radians)
virtual std::string print(const GChatter &chatter=NORMAL) const
Print INTEGRAL/SPI response information.
double m_wcs_ybin
Y value bin size (radians)
void set_wcs(const GFitsImage *image)
Set IRF image limits.
double irf_value(const GSkyDir &srcDir, const GSPIEventBin &bin, const int &ireg) const
Return value of INTEGRAL/SPI instrument response for sky direction and event bin.
void read(const GFits &fits)
Read SPI response from FITS object.
GSkyMap compute_irf(const double &emin, const double &emax) const
Compute as sky map.
virtual double irf(const GEvent &event, const GPhoton &photon, const GObservation &obs) const
Return value of INTEGRAL/SPI instrument response for a photon.
GSkyMap load_irf(const GFilename &rspname) const
Load IRF as sky map.
std::vector< GSkyDir > m_spix
SPI pointing direction.
double m_dlogE
Logarithmic energy step for IRF band.
virtual bool use_edisp(void) const
Signal if energy dispersion will be used.
void write_detids(GFits &fits) const
Write detector identifiers into FITS object.
void init_members(void)
Initialise class members.
virtual ~GSPIResponse(void)
Destructor.
double azimuth(const int &ipt, const GSkyDir &dir) const
Return azimuth angle of sky direction for pointing in radians.
void copy_members(const GSPIResponse &rsp)
Copy class members.
std::vector< int > m_detids
Vector of detector IDs.
virtual GVector irf_diffuse(const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const
Return instrument response to diffuse source sky model.
void free_members(void)
Delete class members.
GFilename m_rspname
File name of response group.
void write_energies(GFits &fits) const
Write energies into FITS object.
void load(const GFilename &filename)
Load SPI response from file.
double m_wcs_ypix_max
Maximum Y pixel index.
double m_gamma
Power-law spectral index for IRF band.
void read_detids(const GFits &fits)
Read detector identifiers from FITS object.
void set_cache(const GSPIEventCube *cube)
Set computation cache.
int irf_detid(const int &detid) const
Convert detector identifier into IRF detector identifier.
double zenith(const int &ipt, const GSkyDir &dir) const
Return zenith angle of sky direction for pointing in radians.
double m_wcs_xmax
Maximum X value (radians)
bool is_precomputed(void) const
Signals if response is precomputed.
double m_wcs_ymax
Maximum Y value (radians)
void irf_rot_matrix(const int &ipt, GSPIResponseIrf *irf) const
Set rotation matrix for pointing.
void irf_vector(const GSPIEventCube *cube, const double &xpix, const double &ypix, const int &ireg, const double *livetimes, GVector *irf) const
Fill vector of INTEGRAL/SPI instrument response for IRF pixel.
virtual GSPIResponse * clone(void) const
Clone instance.
double m_wcs_xmin
Minimum X value (radians)
double m_energy_keV
IRF line energy (optional)
GEbounds m_ebounds
Energy bounaries of IRF.
double m_max_zenith
Maximum zenith angle (radians)
void read_energies(const GFits &fits)
Read energies from FITS object.
GSPIResponse(void)
Void constructor.
virtual void clear(void)
Clear instance.
const GFilename & rspname(void) const
Get response group file name.
const double & energy_keV(void) const
Return line IRF energy in keV.
bool m_has_wcs
Has WCS information.
virtual GEbounds ebounds(const GEnergy &obsEnergy) const
Return true energy boundaries for a specific observed energy.
void set(const GSPIObservation &obs, const GEnergy &energy=GEnergy())
Set response for a specific observation.
virtual bool use_tdisp(void) const
Signal if time dispersion will be used.
std::vector< double > m_posang
Position angle of Y axis (CEL, radians)
void load_irfs(const int ®ion)
Load Instrument Response Functions.
void irf_diffuse_map(const GModelSpatialDiffuseMap *diffuse, const GObservation &obs, GVector *irfs, GMatrix *gradients=NULL) const
Return instrument response to diffuse map sky model.
Class that handles gamma-ray sources.
Kernel for azimuth angle integration of elliptical models.
Kernel for rho angle integration of elliptical models.
Kernel for azimuth angle integration of radial models.
Kernel for rho angle integration of radial models.
std::vector< int > detids