54#define G_RESPONSE "GCOMObservation::response(GResponse&)"
55#define G_READ "GCOMObservation::read(GXmlElement&)"
56#define G_WRITE "GCOMObservation::write(GXmlElement&)"
57#define G_LOAD_DRB "GCOMObservation::load_drb(GFilename&)"
58#define G_LOAD_DRG "GCOMObservation::load_drg(GFilename&)"
59#define G_DRM "GCOMObservation::drm(GModels&)"
60#define G_COMPUTE_DRB "GCOMObservation::compute_drb(std::string&, GCOMDri&, "\
61 "int&, int&, int&, int&"
62#define G_COMPUTE_DRB_PHINOR "GCOMObservation::compute_drb_phinor(GCOMDri&)"
63#define G_COMPUTE_DRB_BGDLIXA "GCOMObservation::compute_drb_bgdlixa("\
64 "GCOMDri&, int&, int&, int&, int&)"
65#define G_COMPUTE_DRB_BGDLIXE "GCOMObservation::compute_drb_bgdlixe("\
66 "GCOMDri&, int&, int&, int&, int&)"
209 const std::vector<GFilename>& oadnames,
216 load(evpname, timname, oadnames, bvcname);
343 if (comrsp == NULL) {
344 std::string cls = std::string(
typeid(&rsp).
name());
345 std::string msg =
"Response of type \""+cls+
"\" is "
346 "not a COMPTEL response. Please specify a COMPTEL "
347 "response as argument.";
440 std::vector<GFilename> oadnames;
441 for (
int i = 0; i < xml.
elements(
"parameter"); ++i) {
443 if (element->
attribute(
"name") ==
"OAD") {
444 std::string oadname = element->
attribute(
"file");
451 std::string bvcname =
"";
458 load(evpname, timname, oadnames, bvcname);
484 GFilename filename_expanded(iaqname_expanded);
485 if (filename_expanded.
is_fits()) {
560 for (
int i = 0; i < xml.
elements(
"parameter"); ++i) {
562 if (element->
attribute(
"name") ==
"OAD") {
672 const std::vector<GFilename>& oadnames,
697 std::vector<GCOMOads>
oads;
700 for (
int i = 0; i < oadnames.size(); ++i) {
706 if (oad.
size() < 1) {
712 for (; index <
oads.
size(); ++index) {
713 if (oad[0].tstop() <
oads[index][
oads[index].size()-1].tstart()) {
729 for (
int i = 0; i <
oads.
size(); ++i) {
767 std::string msg =
"Events of type \""+cls+
"\" is not a COMPTEL event "
768 "cube. Please specify a COMPTEL event cube when "
769 "using this method.";
780 for (
int i = 0; i < drm_cube.
size(); ++i) {
823 if (method ==
"PHINOR") {
826 else if (method ==
"BGDLIXA") {
829 else if (method ==
"BGDLIXE") {
833 std::string msg =
"Unknown background method \""+method+
"\". "
834 "Specify either \"PHINOR\", \"BGDLIXA\" or "
859 result.append(
"=== GCOMObservation ===");
879 result.append(
" - ");
884 if (
response()->rspname().length() > 0) {
1116 std::string msg =
"DRB data cube \""+
drbname+
"\" incompatible with "
1161 std::string msg =
"DRG data cube \""+
drgname+
"\" incompatible with "
1222 bool same_dimension = ((map.
nx() == ref.
nx()) &&
1223 (map.
ny() == ref.
ny()) &&
1227 bool same_projection =
false;
1230 if ((proj_ref == NULL) && (proj_map == NULL)) {
1231 same_projection =
true;
1233 else if ((proj_ref != NULL) && (proj_map != NULL)) {
1234 same_projection = (*proj_map == *proj_ref);
1238 return (same_dimension && same_projection);
1306 std::string msg =
"Observation \""+this->
name()+
"\" ("+this->
id()+
") "
1307 "does not contain a COMPTEL event cube. Please "
1308 "specify a COMPTEL observation containing and event "
1315 std::string msg =
"Specified DRM cube is incompatible with DRE. Please "
1316 "specify a DRM with a data-space definition that is "
1317 "identical to that of the DRE.";
1335 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1336 double sum_dre = 0.0;
1337 double sum_drm = 0.0;
1338 double sum_drg = 0.0;
1339 for (
int ipix = 0; ipix < npix; ++ipix) {
1340 sum_dre += map_dre(ipix, iphibar);
1341 sum_drm += map_drm(ipix, iphibar);
1342 sum_drg += map_drg(ipix, iphibar);
1344 if (sum_drg > 0.0) {
1345 double norm = (sum_dre - sum_drm) / sum_drg;
1346 for (
int ipix = 0; ipix < npix; ++ipix) {
1347 map_drb(ipix, iphibar) = map_drg(ipix, iphibar) *
norm;
1351 for (
int ipix = 0; ipix < npix; ++ipix) {
1352 map_drb(ipix, iphibar) = 0.0;
1358 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1359 for (
int ipix = 0; ipix < npix; ++ipix) {
1360 if (map_drb(ipix, iphibar) < 0.0) {
1361 map_drb(ipix, iphibar) = 0.0;
1398 std::string msg =
"Observation \""+this->
name()+
"\" ("+this->
id()+
") "
1399 "does not contain a COMPTEL event cube. Please "
1400 "specify a COMPTEL observation containing and event "
1407 std::string msg =
"Specified DRM cube is incompatible with DRE. Please "
1408 "specify a DRM with a data-space definition that is "
1409 "identical to that of the DRE.";
1428 int npix = nchi * npsi;
1431 int navgr2 = int(navgr/2);
1434 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1435 for (
int ipix = 0; ipix < npix; ++ipix) {
1436 map_drb(ipix, iphibar) = 0.0;
1437 map_dri(ipix, iphibar) = 0.0;
1442 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1443 double sum_dre = 0.0;
1444 double sum_drm = 0.0;
1445 double sum_drg = 0.0;
1446 for (
int ipix = 0; ipix < npix; ++ipix) {
1447 sum_dre += map_dre(ipix, iphibar);
1448 sum_drm += map_drm(ipix, iphibar);
1449 sum_drg += map_drg(ipix, iphibar);
1451 if (sum_drg > 0.0) {
1452 double norm = (sum_dre - sum_drm) / sum_drg;
1453 for (
int ipix = 0; ipix < npix; ++ipix) {
1454 map_dri(ipix, iphibar) = map_drg(ipix, iphibar) *
norm;
1467 for (
int ichi = 0; ichi < nchi; ++ichi) {
1470 int kchi_min = ichi - nrunav;
1471 int kchi_max = ichi + nrunav;
1475 if (kchi_max >= nchi) {
1476 kchi_max = nchi - 1;
1480 for (
int ipsi = 0; ipsi < npsi; ++ipsi) {
1483 int kpsi_min = ipsi - nrunav;
1484 int kpsi_max = ipsi + nrunav;
1488 if (kpsi_max >= npsi) {
1489 kpsi_max = npsi - 1;
1493 double sum_dre = 0.0;
1494 double sum_drm = 0.0;
1495 double sum_dri = 0.0;
1498 for (
int kchi = kchi_min; kchi <= kchi_max; ++kchi) {
1499 for (
int kpsi = kpsi_min; kpsi <= kpsi_max; ++kpsi) {
1500 int kpix = kchi + kpsi * nchi;
1501 for (
int kphibar = 0; kphibar < nphibar; ++kphibar) {
1502 if (map_drg(kpix, kphibar) != 0.0) {
1503 sum_dre += map_dre(kpix, kphibar);
1504 sum_drm += map_drm(kpix, kphibar);
1505 sum_dri += map_dri(kpix, kphibar);
1512 if (sum_dri != 0.0) {
1513 int ipix = ichi + ipsi * nchi;
1514 double norm = (sum_dre - sum_drm) / sum_dri;
1515 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1516 map_dri(ipix, iphibar) *=
norm;
1533 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1537 &ksel1, &kex1, &kex2, &ksel2);
1540 for (
int ipix = 0; ipix < npix; ++ipix) {
1543 map_drb(ipix, iphibar) = 0.0;
1546 if (map_dri(ipix, iphibar) != 0.0) {
1549 double sum_dri = 0.0;
1553 for (
int kphibar = ksel1; kphibar <= kex1; ++kphibar) {
1554 sum_dri += map_dri(ipix, kphibar);
1559 if (kex2 < nphibar) {
1560 for (
int kphibar = kex2; kphibar <= ksel2; ++kphibar) {
1561 sum_dri += map_dri(ipix, kphibar);
1566 if (sum_dri != 0.0) {
1567 map_drb(ipix, iphibar) = map_dri(ipix, iphibar) / sum_dri;
1586 for (
int ichi = 0; ichi < nchi; ++ichi) {
1589 int kchi_min = ichi - navgr2;
1590 int kchi_max = ichi + navgr2;
1594 if (kchi_max >= nchi) {
1595 kchi_max = nchi - 1;
1599 for (
int ipsi = 0; ipsi < npsi; ++ipsi) {
1602 int kpsi_min = ipsi - navgr2;
1603 int kpsi_max = ipsi + navgr2;
1607 if (kpsi_max >= npsi) {
1608 kpsi_max = npsi - 1;
1612 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1615 double sum_dre = 0.0;
1616 double sum_drm = 0.0;
1617 double sum_drg = 0.0;
1620 for (
int kchi = kchi_min; kchi <= kchi_max; ++kchi) {
1621 for (
int kpsi = kpsi_min; kpsi <= kpsi_max; ++kpsi) {
1622 int kpix = kchi + kpsi * nchi;
1623 sum_dre += map_dre(kpix, iphibar);
1624 sum_drm += map_drm(kpix, iphibar);
1625 sum_drg += map_drg(kpix, iphibar);
1630 int ipix = ichi + ipsi * nchi;
1631 if (sum_drg > 0.0) {
1632 double norm = (sum_dre - sum_drm) / sum_drg;
1633 map_dri(ipix, iphibar) = map_drg(ipix, iphibar) *
norm;
1636 map_dri(ipix, iphibar) = 0.0;
1648 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1652 &ksel1, &kex1, &kex2, &ksel2);
1655 for (
int ipix = 0; ipix < npix; ++ipix) {
1658 if (map_drb(ipix, iphibar) != 0.0) {
1661 double sum_dri = 0.0;
1665 for (
int kphibar = ksel1; kphibar <= kex1; ++kphibar) {
1666 sum_dri += map_dri(ipix, kphibar);
1671 if (kex2 < nphibar) {
1672 for (
int kphibar = kex2; kphibar <= ksel2; ++kphibar) {
1673 sum_dri += map_dri(ipix, kphibar);
1678 map_drb(ipix, iphibar) *= sum_dri;
1687 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1688 double sum_dre = 0.0;
1689 double sum_drm = 0.0;
1690 double sum_drb = 0.0;
1691 for (
int ipix = 0; ipix < npix; ++ipix) {
1692 sum_dre += map_dre(ipix, iphibar);
1693 sum_drm += map_drm(ipix, iphibar);
1694 sum_drb += map_drb(ipix, iphibar);
1696 if (sum_drb > 0.0) {
1697 double norm = (sum_dre - sum_drm) / sum_drb;
1698 for (
int ipix = 0; ipix < npix; ++ipix) {
1699 map_drb(ipix, iphibar) *=
norm;
1703 for (
int ipix = 0; ipix < npix; ++ipix) {
1704 map_drb(ipix, iphibar) = 0.0;
1710 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1711 for (
int ipix = 0; ipix < npix; ++ipix) {
1712 if (map_drb(ipix, iphibar) < 0.0) {
1713 map_drb(ipix, iphibar) = 0.0;
1749 std::string msg =
"Observation \""+this->
name()+
"\" ("+this->
id()+
") "
1750 "does not contain a COMPTEL event cube. Please "
1751 "specify a COMPTEL observation containing and event "
1758 std::string msg =
"Specified DRM cube is incompatible with DRE. Please "
1759 "specify a DRM with a data-space definition that is "
1760 "identical to that of the DRE.";
1779 int npix = nchi * npsi;
1782 int navgr2 = int(navgr/2);
1785 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1786 for (
int ipix = 0; ipix < npix; ++ipix) {
1787 map_drb(ipix, iphibar) = 0.0;
1788 map_dri(ipix, iphibar) = 0.0;
1793 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1794 double sum_dre = 0.0;
1795 double sum_drm = 0.0;
1796 double sum_drg = 0.0;
1797 for (
int ipix = 0; ipix < npix; ++ipix) {
1798 sum_dre += map_dre(ipix, iphibar);
1799 sum_drm += map_drm(ipix, iphibar);
1800 sum_drg += map_drg(ipix, iphibar);
1802 if (sum_drg > 0.0) {
1803 double norm = (sum_dre - sum_drm) / sum_drg;
1804 for (
int ipix = 0; ipix < npix; ++ipix) {
1805 map_dri(ipix, iphibar) = map_drg(ipix, iphibar) *
norm;
1811 for (
int ichi = 0; ichi < nchi; ++ichi) {
1814 int kchi_min = ichi - navgr2;
1815 int kchi_max = ichi + navgr2;
1819 if (kchi_max >= nchi) {
1820 kchi_max = nchi - 1;
1824 for (
int ipsi = 0; ipsi < npsi; ++ipsi) {
1827 int kpsi_min = ipsi - navgr2;
1828 int kpsi_max = ipsi + navgr2;
1832 if (kpsi_max >= npsi) {
1833 kpsi_max = npsi - 1;
1837 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1845 &ksel1, &kex1, &kex2, &ksel2);
1848 double sum_dre = 0.0;
1849 double sum_drm = 0.0;
1850 double sum_dri = 0.0;
1853 for (
int kchi = kchi_min; kchi <= kchi_max; ++kchi) {
1854 for (
int kpsi = kpsi_min; kpsi <= kpsi_max; ++kpsi) {
1857 int kpix = kchi + kpsi * nchi;
1861 for (
int kphibar = ksel1; kphibar <= kex1; ++kphibar) {
1862 sum_dre += map_dre(kpix, kphibar);
1863 sum_drm += map_drm(kpix, kphibar);
1864 sum_dri += map_dri(kpix, kphibar);
1869 if (kex2 < nphibar) {
1870 for (
int kphibar = kex2; kphibar <= ksel2; ++kphibar) {
1871 sum_dre += map_dre(kpix, kphibar);
1872 sum_drm += map_drm(kpix, kphibar);
1873 sum_dri += map_dri(kpix, kphibar);
1881 int ipix = ichi + ipsi * nchi;
1882 if (sum_dri > 0.0) {
1883 double norm = (sum_dre - sum_drm) / sum_dri;
1884 map_drb(ipix, iphibar) = map_dri(ipix, iphibar) *
norm;
1887 map_drb(ipix, iphibar) = 0.0;
1897 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1898 double sum_dre = 0.0;
1899 double sum_drm = 0.0;
1900 double sum_drb = 0.0;
1901 for (
int ipix = 0; ipix < npix; ++ipix) {
1902 sum_dre += map_dre(ipix, iphibar);
1903 sum_drm += map_drm(ipix, iphibar);
1904 sum_drb += map_drb(ipix, iphibar);
1906 if (sum_drb > 0.0) {
1907 double norm = (sum_dre - sum_drm) / sum_drb;
1908 for (
int ipix = 0; ipix < npix; ++ipix) {
1909 map_drb(ipix, iphibar) *=
norm;
1913 for (
int ipix = 0; ipix < npix; ++ipix) {
1914 map_drb(ipix, iphibar) = 0.0;
1920 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1921 for (
int ipix = 0; ipix < npix; ++ipix) {
1922 if (map_drb(ipix, iphibar) < 0.0) {
1923 map_drb(ipix, iphibar) = 0.0;
1947 int npix =
drg.npix();
1948 int nphibar =
drg.nmaps();
1951 for (
int ipix = 0; ipix < npix; ++ipix) {
1952 double omega =
drg.solidangle(ipix);
1953 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1954 drg(ipix,iphibar) *= omega;
1992 int imax = nphibar - 1;
1995 int nexcl2 = int(nexcl/2);
1996 int nincl2 = int(nincl/2);
1999 *iex1 = iphibar - nexcl2 - 1;
2000 *iex2 = iphibar + nexcl2 + 1;
2001 *isel1 = iphibar - nincl2;
2002 *isel2 = iphibar + nincl2;
2015 if (*isel2 > imax) {
2028 if (*isel2 == imax) {
2029 *isel1 = nphibar - nincl;
COMPTEL event bin class interface definition.
const GCOMObservation g_obs_com_seed
#define G_COMPUTE_DRB_BGDLIXA
#define G_COMPUTE_DRB_PHINOR
#define G_COMPUTE_DRB_BGDLIXE
COMPTEL observation class interface definition.
COMPTEL instrument status class definition.
Implementation of support function used by COMPTEL classes.
Calibration database class interface definition.
Exception handler interface definition.
Abstract FITS extension base class definition.
FITS file class interface definition.
Mathematical function definitions.
Sky model class interface definition.
Constant spectral model class interface definition.
Model container class definition.
Observation registry class definition.
double norm(const GVector &vector)
Computes vector norm.
XML element node class interface definition.
void clear(void)
Clear COMPTEL Solar System Barycentre Data container.
void load(const GFilename &filename)
Load COMPTEL Solar System Barycentre Data FITS file.
bool is_empty(void) const
Signals if there are no Solar System Barycentre Data in container.
std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL Solar System Barycentre Data container.
COMPTEL Data Space class.
virtual void clear(void)
Clear COMPTEL Data Space.
int nchi(void) const
Return number of Chi bins.
const GSkyMap & map(void) const
Return DRI sky map.
int npsi(void) const
Return number of Psi bins.
int nphibar(void) const
Return number of Phibar bins.
void read(const GFitsImage &image)
Read COMPTEL Data Space from DRI FITS image.
virtual double size(void) const
Return size of event bin.
virtual double counts(void) const
Return number of counts in event bin.
COMPTEL event bin container class.
virtual int size(void) const
Return number of bins in event cube.
const GCOMDri & dre(void) const
Return reference to DRE data.
COMPTEL event list class.
COMPTEL Orbit Aspect Data container class.
void extend(const GCOMOads &oads)
Append Orbit Aspect Data container.
std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL Orbit Aspect Data container.
void clear(void)
Clear COMPTEL Orbit Aspect Data container.
int size(void) const
Return number of Orbit Aspect Data in container.
bool is_empty(void) const
Signals if there are no Orbit Aspect Data in container.
GCOMOad & insert(const int &index, const GCOMOad &oad)
Insert Orbit Aspect Data into container.
Interface class for COMPTEL observations.
void free_members(void)
Delete class members.
GCOMDri drm(const GModels &models) const
Compute DRM cube.
void init_members(void)
Initialise class members.
const GFilename & drename(void) const
Return DRE filename.
GFilename m_drgname
DRG filename.
bool is_unbinned(void) const
Check whether observation is unbinned.
void compute_drb_phinor(const GCOMDri &drm)
Compute DRB cube using PHINOR method.
GFilename m_drxname
DRX filename.
void compute_drb_bgdlixa(const GCOMDri &drm, const int &nrunav=3, const int &navgr=3, const int &nincl=13, const int &nexcl=0)
Compute DRB cube using BGDLIXA method.
const GFilename & drgname(void) const
Return DRG filename.
const GFilename & drxname(void) const
Return DRX filename.
double m_ontime
Ontime (sec)
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.
bool check_dri(const GCOMDri &map) const
Check if DRI is compatible with event cube.
const GCOMDri & drb(void) const
Return background model.
virtual double ontime(void) const
Return ontime.
virtual GCOMObservation * clone(void) const
Clone COMPTEL observation.
GCOMBvcs m_bvcs
Solar System Barycentre Data.
void read_attributes(const GFitsHDU *hdu)
Read observation attributes.
const int & phi_first(void) const
Return index of first Phibar layer to be used for likelihood fitting.
const GCOMOads & oads(void) const
Return Orbit Aspect Data.
int m_phi_last
Last Phibar layer to use for likelihood.
GFilename m_drename
DRE filename.
void load_drg(const GFilename &drgname)
Load geometry factors from DRG file.
virtual std::string instrument(void) const
Return instrument.
double m_livetime
Livetime (sec)
virtual void read(const GXmlElement &xml)
Read observation from XML element.
GSkyMap get_weighted_drg_map(void) const
Return weighted DRG map.
virtual void clear(void)
Clear COMPTEL observation.
double m_obs_id
Observation ID.
virtual void write(GXmlElement &xml) const
Write observation into XML element.
GCOMOads m_oads
Orbit Aspect Data.
int m_phi_first
First Phibar layer to use for likelihood.
GCOMObservation(void)
Void constructor.
GCOMTim m_tim
COMPTEL Good Time Intervals.
GCOMDri m_drg
Geometry factors.
virtual const GCOMResponse * response(void) const
Return response function.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print observation information.
void load(const GFilename &drename, const GFilename &drbname, const GFilename &drgname, const GFilename &drxname)
Load data for a binned observation.
GCOMDri m_drb
Background model.
bool is_binned(void) const
Check whether observation is binned.
void load_dre(const GFilename &drename)
Load event cube data from DRE file.
const int & phi_last(void) const
Return index of last Phibar layer to be used for likelihood fitting.
void write_attributes(GFitsHDU *hdu) const
Write observation attributes.
double m_ewidth
Energy width (MeV)
GFilename m_drbname
DRB filename.
GFilename m_evpname
EVP filename.
virtual bool use_event_for_likelihood(const int &index) const
Check whether bin should be used for likelihood analysis.
void compute_drb_bgdlixe(const GCOMDri &drm, const int &nrunav=3, const int &navgr=3, const int &nincl=13, const int &nexcl=0)
Compute DRB cube using BGDLIXE method.
const GCOMDri & drx(void) const
Return exposure.
double m_deadc
Deadtime correction.
const GCOMDri & drg(void) const
Return geometry factors.
virtual double livetime(void) const
Return livetime.
const GFilename & drbname(void) const
Return DRB filename.
void compute_drb(const std::string &method, const GCOMDri &drm, const int &nrunav=3, const int &navgr=3, const int &nincl=13, const int &nexcl=0)
Compute DRB cube.
GFilename m_timname
TIM filename.
GCOMResponse m_response
Response functions.
std::vector< GFilename > m_oadnames
OAD filenames.
virtual ~GCOMObservation(void)
Destructor.
std::string m_instrument
Instrument name.
GFilename m_bvcname
BVC filename.
void load_drx(const GFilename &drxname)
Load exposure from DRX file.
void copy_members(const GCOMObservation &obs)
Copy class members.
void load_drb(const GFilename &drbname)
Load background model from DRB file.
virtual GCOMObservation & operator=(const GCOMObservation &obs)
Assignment operator.
GCOMDri m_drx
Exposure map.
Interface for the COMPTEL instrument response function.
const std::string & rspname(void) const
Return response name.
void caldb(const GCaldb &caldb)
Set calibration database.
virtual void clear(void)
Clear instance.
void load(const std::string &rspname)
Load COMPTEL response.
const GGti & gti(void) const
Return Good Time Intervals.
virtual void clear(void)
Clear COMPTEL good time intervals.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL Good Time Intervals.
void load(const GFilename &filename, const std::string &usage="YES", const std::string &mode="NORMAL")
Load COMPTEL Good Time Intervals from FITS file.
Calibration database class.
double MeV(void) const
Return energy in MeV.
void gti(const GGti >i)
Set Good Time Intervals.
virtual void read(const GFits &file)=0
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
const GEnergy & emax(void) const
Return maximum energy.
const GEnergy & emin(void) const
Return minimum energy.
bool is_fits(void) const
Checks whether file is a FITS file.
bool is_empty(void) const
Signal if filename is empty.
void clear(void)
Clear file name.
Abstract FITS extension base class.
bool has_card(const int &cardno) const
Check existence of header card.
double real(const std::string &keyname) const
Return card value as double precision.
std::string string(const std::string &keyname) const
Return card value as string.
Abstract FITS image base class.
GFitsImage * image(const int &extno)
Get pointer to image HDU.
void close(void)
Close FITS file.
int size(void) const
Return number of Good Time Intervals.
const double & ontime(void) const
Returns ontime.
double eval(const GEvent &event, const GObservation &obs, const bool &gradients=false) const
Evaluate sum of all models.
Interface definition for the observation registry class.
Abstract observation base class.
const std::string & statistic(void) const
Return optimizer statistic.
virtual double model(const GModels &models, const GEvent &event, GVector *gradients=NULL) const
Return model value and (optionally) gradients.
const std::string & id(void) const
Return observation identifier.
const std::string & name(void) const
Return observation name.
virtual GEvents * events(void)
Return events.
void init_members(void)
Initialise class members.
virtual GObservation & operator=(const GObservation &obs)
Assignment operator.
GEvents * m_events
Pointer to event container.
void free_members(void)
Delete class members.
std::string m_name
Observation name.
Abstract instrument response base class.
const int & nmaps(void) const
Returns number of maps.
const int & nx(void) const
Returns number of pixels in x coordinate.
const int & npix(void) const
Returns number of pixels.
const int & ny(void) const
Returns number of pixels in y coordinate.
const GSkyProjection * projection(void) const
Returns pointer to sky projection.
Abstract sky projection base class.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
bool has_attribute(const std::string &name) const
Check if element has a given attribute.
virtual GXmlNode * append(const GXmlNode &node)
Append XML child node.
virtual void remove(const int &index)
Remove XML child node.
virtual GXmlElement * element(const int &index)
Return pointer to GXMLElement child.
virtual int elements(void) const
Return number of GXMLElement children of node.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
std::string xml_get_attr(const std::string &origin, const GXmlElement &xml, const std::string &name, const std::string &attribute)
Return attribute value for a given parameter in XML element.
int toint(const std::string &arg)
Convert string into integer value.
GXmlElement * xml_need_par(const std::string &origin, GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
GFilename xml_file_reduce(const GXmlElement &xml, const std::string &filename)
Reduce file name provided for writing as XML attribute.
void com_wcs_mer2car(GSkyMap &map)
Changes Mercator's projection to cartesian projection.
GChatter reduce(const GChatter &chatter)
Reduce chattiness by one level.
bool xml_has_par(const GXmlElement &xml, const std::string &name)
Checks if parameter with given name in XML element exists.
GFilename xml_file_expand(const GXmlElement &xml, const std::string &filename)
Expand file name provided as XML attribute for loading.