GammaLib
2.0.0
|
Fermi LAT livetime cube map class. More...
#include <GLATLtCubeMap.hpp>
Public Member Functions | |
GLATLtCubeMap (void) | |
Void constructor. More... | |
GLATLtCubeMap (const GLATLtCubeMap &map) | |
Copy constructor. More... | |
virtual | ~GLATLtCubeMap (void) |
Destructor. More... | |
GLATLtCubeMap & | operator= (const GLATLtCubeMap &cube) |
Assignment operator. More... | |
double | operator() (const GSkyDir &dir, _ltcube_ctheta fct) const |
Sum function multiplied by livetime over zenith angle. More... | |
double | operator() (const GSkyDir &dir, _ltcube_ctheta_phi fct) const |
Sum function multiplied by livetime over zenith and azimuth angles. More... | |
double | operator() (const GSkyDir &dir, const GEnergy &energy, const GLATAeff &aeff) const |
Sum effective area multiplied by livetime over zenith and (optionally) azimuth angles. More... | |
double | operator() (const GSkyDir &dir, const GEnergy &energy, const double &offset, const GLATPsf &psf, const GLATAeff &aeff) const |
Sum effective area multiplied by livetime over zenith angles. More... | |
void | clear (void) |
Clear livetime cube map. More... | |
GLATLtCubeMap * | clone (void) const |
Clone livetime cube map. More... | |
std::string | classname (void) const |
Return class name. More... | |
void | read (const GFitsTable &table) |
Load livetime cube from FITS file. More... | |
void | write (GFits &fits, const std::string &extname=gammalib::extname_lat_ltcubemap) const |
Write livetime cube map into FITS file. More... | |
const int & | ncostheta (void) const |
Return number of cosine theta bins. More... | |
const int & | nphi (void) const |
Return number of phi bins. More... | |
bool | has_phi (void) const |
Signal if livetime cube map has phi dependence. More... | |
double | costheta (const int &index) const |
Return cos theta value for an index. More... | |
double | phi (const int &index) const |
Return phi value (in radians) for an index. More... | |
const double & | costhetamin (void) const |
Return minimum of cosine theta. More... | |
std::string | costhetabin (void) const |
Return cos theta binning scheme. More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print livetime cube map information. More... | |
Public Member Functions inherited from GBase | |
virtual | ~GBase (void) |
Destructor. More... | |
Private Member Functions | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GLATLtCubeMap &cube) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Private Attributes | |
GSkyMap | m_map |
Lifetime cube map. More... | |
int | m_num_ctheta |
Number of bins in cos theta. More... | |
int | m_num_phi |
Number of bins in phi. More... | |
double | m_min_ctheta |
Minimum cos theta value. More... | |
bool | m_sqrt_bin |
Square root binning? More... | |
Fermi LAT livetime cube map class.
A livetime cube map holds a set of HEALPix skymaps that are a function of the cosine of the zenith angle and (optionally) of the azimuth angle.
Definition at line 60 of file GLATLtCubeMap.hpp.
GLATLtCubeMap::GLATLtCubeMap | ( | void | ) |
Void constructor.
Definition at line 61 of file GLATLtCubeMap.cpp.
References init_members().
Referenced by clone().
GLATLtCubeMap::GLATLtCubeMap | ( | const GLATLtCubeMap & | map | ) |
Copy constructor.
map | Livetime cube map. |
Definition at line 76 of file GLATLtCubeMap.cpp.
References copy_members(), and init_members().
|
virtual |
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 115 of file GLATLtCubeMap.hpp.
|
virtual |
Clear livetime cube map.
Implements GBase.
Definition at line 350 of file GLATLtCubeMap.cpp.
References free_members(), and init_members().
Referenced by GLATLtCube::init_members(), and read().
|
virtual |
Clone livetime cube map.
Implements GBase.
Definition at line 368 of file GLATLtCubeMap.cpp.
References GLATLtCubeMap().
|
private |
Copy class members.
map | Livetime cube map. |
Definition at line 591 of file GLATLtCubeMap.cpp.
References m_map, m_min_ctheta, m_num_ctheta, m_num_phi, and m_sqrt_bin.
Referenced by GLATLtCubeMap(), and operator=().
double GLATLtCubeMap::costheta | ( | const int & | index | ) | const |
Return cos theta value for an index.
[in] | index | Cos theta bin index [0,...,m_num_ctheta[ |
GException::out_of_range | Bin index outside value range. |
The cos theta value is computed using
\[\cos \theta = 1 - \left( \frac{{\rm index} + 0.5}{\rm ncostheta} \right)^N (1 - {\rm costhetamin})\]
where \({\rm index}\) is the bin index, \({\rm ncostheta}\) is the number of cos theta bins, \(N\) is either 1 or 2, and \({\rm costhetamin}\) is the minimum cos theta value. Default values for LAT are \(N=2\) and \({\rm costhetamin}=0\).
Definition at line 452 of file GLATLtCubeMap.cpp.
References G_COSTHETA, m_min_ctheta, m_num_ctheta, and m_sqrt_bin.
Referenced by operator()().
std::string GLATLtCubeMap::costhetabin | ( | void | ) | const |
Return cos theta binning scheme.
Returns either "SQRT(1-COSTHETA)" or "COSTHETA".
Definition at line 513 of file GLATLtCubeMap.cpp.
References m_sqrt_bin.
Referenced by write().
|
inline |
Return minimum of cosine theta.
Definition at line 163 of file GLATLtCubeMap.hpp.
References m_min_ctheta.
Referenced by print().
|
private |
Delete class members.
Definition at line 608 of file GLATLtCubeMap.cpp.
Referenced by clear(), operator=(), and ~GLATLtCubeMap().
|
inline |
Signal if livetime cube map has phi dependence.
Definition at line 151 of file GLATLtCubeMap.hpp.
References m_num_phi.
Referenced by operator()().
|
private |
Initialise class members.
Definition at line 572 of file GLATLtCubeMap.cpp.
References GSkyMap::clear(), m_map, m_min_ctheta, m_num_ctheta, m_num_phi, and m_sqrt_bin.
Referenced by clear(), GLATLtCubeMap(), and operator=().
|
inline |
Return number of cosine theta bins.
Definition at line 127 of file GLATLtCubeMap.hpp.
References m_num_ctheta.
Referenced by print().
|
inline |
Return number of phi bins.
Definition at line 139 of file GLATLtCubeMap.hpp.
References m_num_phi.
Referenced by print().
double GLATLtCubeMap::operator() | ( | const GSkyDir & | dir, |
_ltcube_ctheta | fct | ||
) | const |
Sum function multiplied by livetime over zenith angle.
[in] | dir | Sky direction. |
[in] | fct | Function to evaluate. |
Computes
\[\sum_{\cos \theta} T_{\rm live}(\cos \theta) f(\cos \theta)\]
where \(T_{\rm live}(\cos \theta)\) is the livetime as a function of the cosine of the zenith angle, and \(f(\cos \theta)\) is a function that depends on the cosine of the zenith angle. This method assumes that \(T_{\rm live}(\cos \theta)\) is stored as a set of maps.
Definition at line 151 of file GLATLtCubeMap.cpp.
References costheta(), GSkyMap::dir2pix(), m_map, m_num_ctheta, and sum().
double GLATLtCubeMap::operator() | ( | const GSkyDir & | dir, |
_ltcube_ctheta_phi | fct | ||
) | const |
Sum function multiplied by livetime over zenith and azimuth angles.
[in] | dir | Sky direction. |
[in] | fct | Function to evaluate. |
Computes
\[\sum_{\cos \theta, \phi} T_{\rm live}(\cos \theta, \phi) f(\cos \theta, \phi)\]
where \(T_{\rm live}(\cos \theta, \phi)\) is the livetime as a function of the cosine of the zenith and of the azimuth angle, and \(f(\cos \theta, \phi)\) is a function that depends on the cosine of the zenith angle and of the azimuth angle. This method assumes that \(T_{\rm live}(\cos \theta, \phi)\) is stored as a set of maps in a 2D array with \(\cos \theta\) being the most rapidely varying parameter and with the first map starting at index m_num_ctheta (the first m_num_ctheta maps are the livetime cube maps without any \(\phi\) dependence).
Definition at line 189 of file GLATLtCubeMap.cpp.
References costheta(), GSkyMap::dir2pix(), m_map, m_num_ctheta, m_num_phi, phi(), and sum().
double GLATLtCubeMap::operator() | ( | const GSkyDir & | dir, |
const GEnergy & | energy, | ||
const GLATAeff & | aeff | ||
) | const |
Sum effective area multiplied by livetime over zenith and (optionally) azimuth angles.
[in] | dir | True sky direction. |
[in] | energy | True photon energy. |
[in] | aeff | Effective area. |
Computes
\[\sum_{\cos \theta, \phi} T_{\rm live}(\cos \theta, \phi) A_{\rm eff}(\log E, \cos \theta, \phi)\]
where \(T_{\rm live}(\cos \theta, \phi)\) is the livetime as a function of the cosine of the zenith and the azimuth angle, and \(A_{\rm eff}(\log E, \cos \theta, \phi)\) is the effective area that depends on the log10 of the energy (in MeV), the cosine of the zenith angle, and the azimuth angle. This method assumes that \(T_{\rm live}(\cos \theta, \phi)\) is stored as a set of maps in a 2D array with \(\cos \theta\) being the most rapidely varying parameter and with the first map starting at index m_num_ctheta (the first m_num_ctheta maps are the livetime cube maps without any \(\phi\) dependence).
Definition at line 237 of file GLATLtCubeMap.cpp.
References costheta(), GSkyMap::dir2pix(), has_phi(), GLATAeff::has_phi(), GEnergy::log10MeV(), m_map, m_num_ctheta, m_num_phi, phi(), and sum().
double GLATLtCubeMap::operator() | ( | const GSkyDir & | dir, |
const GEnergy & | energy, | ||
const double & | offset, | ||
const GLATPsf & | psf, | ||
const GLATAeff & | aeff | ||
) | const |
Sum effective area multiplied by livetime over zenith angles.
[in] | dir | True sky direction. |
[in] | energy | True photon energy. |
[in] | offset | Offset from true direction (deg). |
[in] | psf | Point spread function. |
[in] | aeff | Effective area. |
Computes
\[\sum_{\cos \theta} T_{\rm live}(\cos \theta) PSF(\log E, \delta, \cos \theta) A_{\rm eff}(\cos \theta, \phi)\]
where \(T_{\rm live}(\cos \theta)\) is the livetime as a function of the cosine of the zenith angle, and \(PSF(\log E, \delta, \cos \theta)\) is the point spread function that depends on the log10 of the energy (in MeV), the offset angle from the true direction (in degrees), and the cosine of the zenith angle, and \(A_{\rm eff}(\cos \theta, \phi)\) is the effective area that depends on the cosine of the zenith angle and (optionally) of the azimuth angle.
Definition at line 297 of file GLATLtCubeMap.cpp.
References costheta(), GSkyMap::dir2pix(), has_phi(), GLATAeff::has_phi(), GEnergy::log10MeV(), m_map, m_num_ctheta, m_num_phi, phi(), and sum().
GLATLtCubeMap & GLATLtCubeMap::operator= | ( | const GLATLtCubeMap & | map | ) |
Assignment operator.
[in] | map | Livetime cube map. |
Definition at line 114 of file GLATLtCubeMap.cpp.
References copy_members(), free_members(), and init_members().
double GLATLtCubeMap::phi | ( | const int & | index | ) | const |
Return phi value (in radians) for an index.
[in] | index | Phi bin index [0,...,m_num_phi[ |
GException::out_of_range | Bin index outside value range. |
The phi value is computed using
\[\phi = \frac{{\rm index} + 0.5}{\rm nphi} \frac{\pi}{4}\]
where \({\rm index}\) is the bin index, and \({\rm nphi}\) is the number of phi bins.
Definition at line 490 of file GLATLtCubeMap.cpp.
References G_PHI, m_num_phi, and gammalib::pi.
Referenced by operator()().
Print livetime cube map information.
[in] | chatter | Chattiness (defaults to NORMAL). |
Implements GBase.
Definition at line 529 of file GLATLtCubeMap.cpp.
References costhetamin(), m_map, m_sqrt_bin, ncostheta(), nphi(), gammalib::parformat(), GSkyMap::print(), gammalib::reduce(), SILENT, and gammalib::str().
Referenced by GLATLtCube::print().
void GLATLtCubeMap::read | ( | const GFitsTable & | table | ) |
Load livetime cube from FITS file.
[in] | table | FITS table. |
Definition at line 379 of file GLATLtCubeMap.cpp.
References clear(), GFitsHDU::integer(), m_map, m_min_ctheta, m_num_ctheta, m_num_phi, m_sqrt_bin, GSkyMap::read(), GFitsHDU::real(), GFitsHDU::string(), gammalib::strip_whitespace(), and gammalib::toupper().
Referenced by GLATLtCube::read().
void GLATLtCubeMap::write | ( | GFits & | fits, |
const std::string & | extname = gammalib::extname_lat_ltcubemap |
||
) | const |
Write livetime cube map into FITS file.
[in] | fits | FITS file. |
[in] | extname | Livetime cube map extension name. |
Writes livetime cube map into a FITS file.
Definition at line 410 of file GLATLtCubeMap.cpp.
References GFitsHDU::card(), GFits::contains(), costhetabin(), m_map, m_min_ctheta, m_num_ctheta, m_num_phi, GFits::remove(), and GSkyMap::write().
Referenced by GLATLtCube::write().
|
private |
Lifetime cube map.
Definition at line 101 of file GLATLtCubeMap.hpp.
Referenced by copy_members(), init_members(), operator()(), print(), read(), and write().
|
private |
Minimum cos theta value.
Definition at line 104 of file GLATLtCubeMap.hpp.
Referenced by copy_members(), costheta(), costhetamin(), init_members(), read(), and write().
|
private |
Number of bins in cos theta.
Definition at line 102 of file GLATLtCubeMap.hpp.
Referenced by copy_members(), costheta(), init_members(), ncostheta(), operator()(), read(), and write().
|
private |
Number of bins in phi.
Definition at line 103 of file GLATLtCubeMap.hpp.
Referenced by copy_members(), has_phi(), init_members(), nphi(), operator()(), phi(), read(), and write().
|
private |
Square root binning?
Definition at line 105 of file GLATLtCubeMap.hpp.
Referenced by copy_members(), costheta(), costhetabin(), init_members(), print(), and read().