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_DRW "GCOMObservation::load_drw(GFilename&)"
59 #define G_LOAD_DRG "GCOMObservation::load_drg(GFilename&)"
60 #define G_DRM "GCOMObservation::drm(GModels&)"
61 #define G_COMPUTE_DRB "GCOMObservation::compute_drb(std::string&, GCOMDri&, "\
62 "int&, int&, int&, int&"
63 #define G_COMPUTE_DRB_PHINOR "GCOMObservation::compute_drb_phinor(GCOMDri&)"
64 #define G_COMPUTE_DRB_BGDLIXA "GCOMObservation::compute_drb_bgdlixa("\
65 "GCOMDri&, int&, int&, int&, int&)"
66 #define G_COMPUTE_DRB_BGDLIXE "GCOMObservation::compute_drb_bgdlixe("\
67 "GCOMDri&, int&, int&, int&, int&)"
68 #define G_COMPUTE_DRB_BGDLIXF "GCOMObservation::compute_drb_bgdlixf("\
69 "GCOMDri&, int&, int&, int&, int&)"
240 load(drename, drbname, drwname, drgname, drxname);
268 const std::vector<GFilename>& oadnames,
269 const std::vector<GFilename>& hkdnames,
276 load(evpname, timname, oadnames, hkdnames, bvcname);
403 if (comrsp == NULL) {
404 std::string cls = std::string(
typeid(&rsp).
name());
405 std::string msg =
"Response of type \""+cls+
"\" is "
406 "not a COMPTEL response. Please specify a COMPTEL "
407 "response as argument.";
465 int nevents = model_vector.
size();
468 for (
int i = 0; i < nevents; ++i) {
480 double model_value = model_vector[i] * bin->
size();
483 npred += model_value;
550 std::vector<GFilename> oadnames;
551 for (
int i = 0; i < xml.
elements(
"parameter"); ++i) {
553 if (element->
attribute(
"name") ==
"OAD") {
554 std::string oadname = element->
attribute(
"file");
561 std::vector<GFilename> hkdnames;
562 for (
int i = 0; i < xml.
elements(
"parameter"); ++i) {
564 if (element->
attribute(
"name") ==
"HKD") {
565 std::string hkdname = element->
attribute(
"file");
572 std::string bvcname =
"";
579 load(evpname, timname, oadnames, hkdnames, bvcname);
607 load(drename, drbname, drwname, drgname, drxname);
611 GFilename filename_expanded(iaqname_expanded);
612 if (filename_expanded.
is_fits()) {
711 for (
int i = 0; i < xml.
elements(
"parameter"); ++i) {
713 if (element->
attribute(
"name") ==
"OAD") {
861 const std::vector<GFilename>& oadnames,
862 const std::vector<GFilename>& hkdnames,
887 std::vector<GCOMOads>
oads;
890 for (
int i = 0; i < oadnames.size(); ++i) {
896 if (oad.
size() < 1) {
902 for (; index < oads.size(); ++index) {
903 if (oad[0].tstop() < oads[index][oads[index].size()-1].tstart()) {
909 if (index < oads.size()) {
910 oads.insert(oads.begin()+index, oad);
919 for (
int i = 0; i < oads.size(); ++i) {
924 for (
int i = 0; i < hkdnames.size(); ++i) {
930 if (hdks.
size() < 1) {
974 std::string msg =
"Events of type \""+cls+
"\" is not a COMPTEL event "
975 "cube. Please specify a COMPTEL event cube when "
976 "using this method.";
987 for (
int i = 0; i < drm_cube.
size(); ++i) {
1035 if (method ==
"PHINOR") {
1038 else if (method ==
"BGDLIXA") {
1041 else if (method ==
"BGDLIXE") {
1044 else if (method ==
"BGDLIXF") {
1048 std::string msg =
"Unknown background method \""+method+
"\". "
1049 "Specify either \"PHINOR\", \"BGDLIXA\" or "
1074 result.append(
"=== GCOMObservation ===");
1094 result.append(
" - ");
1283 GFits fits(drename);
1332 GFits fits(drbname);
1348 std::string msg =
"DRB data cube \""+drbname+
"\" incompatible with "
1379 GFits fits(drwname);
1392 std::string msg =
"DRW data cube \""+drwname+
"\" incompatible with "
1421 GFits fits(drgname);
1437 std::string msg =
"DRG data cube \""+drgname+
"\" incompatible with "
1460 GFits fits(drxname);
1498 bool same_dimension = ((map.
nx() == ref.
nx()) &&
1499 (map.
ny() == ref.
ny()) &&
1503 bool same_projection =
false;
1506 if ((proj_ref == NULL) && (proj_map == NULL)) {
1507 same_projection =
true;
1509 else if ((proj_ref != NULL) && (proj_map != NULL)) {
1510 same_projection = (*proj_map == *proj_ref);
1514 return (same_dimension && same_projection);
1582 std::string msg =
"Observation \""+this->
name()+
"\" ("+this->
id()+
") "
1583 "does not contain a COMPTEL event cube. Please "
1584 "specify a COMPTEL observation containing and event "
1591 std::string msg =
"Specified DRM cube is incompatible with DRE. Please "
1592 "specify a DRM with a data-space definition that is "
1593 "identical to that of the DRE.";
1611 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1612 double sum_dre = 0.0;
1613 double sum_drm = 0.0;
1614 double sum_drg = 0.0;
1615 for (
int ipix = 0; ipix < npix; ++ipix) {
1616 sum_dre += map_dre(ipix, iphibar);
1617 sum_drm += map_drm(ipix, iphibar);
1618 sum_drg += map_drg(ipix, iphibar);
1620 if (sum_drg > 0.0) {
1621 double norm = (sum_dre - sum_drm) / sum_drg;
1622 for (
int ipix = 0; ipix < npix; ++ipix) {
1623 map_drb(ipix, iphibar) = map_drg(ipix, iphibar) *
norm;
1627 for (
int ipix = 0; ipix < npix; ++ipix) {
1628 map_drb(ipix, iphibar) = 0.0;
1634 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1635 for (
int ipix = 0; ipix < npix; ++ipix) {
1636 if (map_drb(ipix, iphibar) < 0.0) {
1637 map_drb(ipix, iphibar) = 0.0;
1674 std::string msg =
"Observation \""+this->
name()+
"\" ("+this->
id()+
") "
1675 "does not contain a COMPTEL event cube. Please "
1676 "specify a COMPTEL observation containing and event "
1683 std::string msg =
"Specified DRM cube is incompatible with DRE. Please "
1684 "specify a DRM with a data-space definition that is "
1685 "identical to that of the DRE.";
1704 int npix = nchi * npsi;
1707 int navgr2 = int(navgr/2);
1710 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1711 for (
int ipix = 0; ipix < npix; ++ipix) {
1712 map_drb(ipix, iphibar) = 0.0;
1713 map_dri(ipix, iphibar) = 0.0;
1718 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1719 double sum_dre = 0.0;
1720 double sum_drm = 0.0;
1721 double sum_drg = 0.0;
1722 for (
int ipix = 0; ipix < npix; ++ipix) {
1723 sum_dre += map_dre(ipix, iphibar);
1724 sum_drm += map_drm(ipix, iphibar);
1725 sum_drg += map_drg(ipix, iphibar);
1727 if (sum_drg > 0.0) {
1728 double norm = (sum_dre - sum_drm) / sum_drg;
1729 for (
int ipix = 0; ipix < npix; ++ipix) {
1730 map_dri(ipix, iphibar) = map_drg(ipix, iphibar) *
norm;
1743 for (
int ichi = 0; ichi < nchi; ++ichi) {
1746 int kchi_min = ichi - nrunav;
1747 int kchi_max = ichi + nrunav;
1751 if (kchi_max >= nchi) {
1752 kchi_max = nchi - 1;
1756 for (
int ipsi = 0; ipsi < npsi; ++ipsi) {
1759 int kpsi_min = ipsi - nrunav;
1760 int kpsi_max = ipsi + nrunav;
1764 if (kpsi_max >= npsi) {
1765 kpsi_max = npsi - 1;
1769 double sum_dre = 0.0;
1770 double sum_drm = 0.0;
1771 double sum_dri = 0.0;
1774 for (
int kchi = kchi_min; kchi <= kchi_max; ++kchi) {
1775 for (
int kpsi = kpsi_min; kpsi <= kpsi_max; ++kpsi) {
1776 int kpix = kchi + kpsi * nchi;
1777 for (
int kphibar = 0; kphibar < nphibar; ++kphibar) {
1778 if (map_drg(kpix, kphibar) != 0.0) {
1779 sum_dre += map_dre(kpix, kphibar);
1780 sum_drm += map_drm(kpix, kphibar);
1781 sum_dri += map_dri(kpix, kphibar);
1788 if (sum_dri != 0.0) {
1789 int ipix = ichi + ipsi * nchi;
1790 double norm = (sum_dre - sum_drm) / sum_dri;
1791 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1792 map_dri(ipix, iphibar) *=
norm;
1809 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1813 &ksel1, &kex1, &kex2, &ksel2);
1816 for (
int ipix = 0; ipix < npix; ++ipix) {
1819 map_drb(ipix, iphibar) = 0.0;
1822 if (map_dri(ipix, iphibar) != 0.0) {
1825 double sum_dri = 0.0;
1829 for (
int kphibar = ksel1; kphibar <= kex1; ++kphibar) {
1830 sum_dri += map_dri(ipix, kphibar);
1835 if (kex2 < nphibar) {
1836 for (
int kphibar = kex2; kphibar <= ksel2; ++kphibar) {
1837 sum_dri += map_dri(ipix, kphibar);
1842 if (sum_dri != 0.0) {
1843 map_drb(ipix, iphibar) = map_dri(ipix, iphibar) / sum_dri;
1862 for (
int ichi = 0; ichi < nchi; ++ichi) {
1865 int kchi_min = ichi - navgr2;
1866 int kchi_max = ichi + navgr2;
1870 if (kchi_max >= nchi) {
1871 kchi_max = nchi - 1;
1875 for (
int ipsi = 0; ipsi < npsi; ++ipsi) {
1878 int kpsi_min = ipsi - navgr2;
1879 int kpsi_max = ipsi + navgr2;
1883 if (kpsi_max >= npsi) {
1884 kpsi_max = npsi - 1;
1888 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1891 double sum_dre = 0.0;
1892 double sum_drm = 0.0;
1893 double sum_drg = 0.0;
1896 for (
int kchi = kchi_min; kchi <= kchi_max; ++kchi) {
1897 for (
int kpsi = kpsi_min; kpsi <= kpsi_max; ++kpsi) {
1898 int kpix = kchi + kpsi * nchi;
1899 sum_dre += map_dre(kpix, iphibar);
1900 sum_drm += map_drm(kpix, iphibar);
1901 sum_drg += map_drg(kpix, iphibar);
1906 int ipix = ichi + ipsi * nchi;
1907 if (sum_drg > 0.0) {
1908 double norm = (sum_dre - sum_drm) / sum_drg;
1909 map_dri(ipix, iphibar) = map_drg(ipix, iphibar) *
norm;
1912 map_dri(ipix, iphibar) = 0.0;
1924 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1928 &ksel1, &kex1, &kex2, &ksel2);
1931 for (
int ipix = 0; ipix < npix; ++ipix) {
1934 if (map_drb(ipix, iphibar) != 0.0) {
1937 double sum_dri = 0.0;
1941 for (
int kphibar = ksel1; kphibar <= kex1; ++kphibar) {
1942 sum_dri += map_dri(ipix, kphibar);
1947 if (kex2 < nphibar) {
1948 for (
int kphibar = kex2; kphibar <= ksel2; ++kphibar) {
1949 sum_dri += map_dri(ipix, kphibar);
1954 map_drb(ipix, iphibar) *= sum_dri;
1963 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1964 double sum_dre = 0.0;
1965 double sum_drm = 0.0;
1966 double sum_drb = 0.0;
1967 for (
int ipix = 0; ipix < npix; ++ipix) {
1968 sum_dre += map_dre(ipix, iphibar);
1969 sum_drm += map_drm(ipix, iphibar);
1970 sum_drb += map_drb(ipix, iphibar);
1972 if (sum_drb > 0.0) {
1973 double norm = (sum_dre - sum_drm) / sum_drb;
1974 for (
int ipix = 0; ipix < npix; ++ipix) {
1975 map_drb(ipix, iphibar) *=
norm;
1979 for (
int ipix = 0; ipix < npix; ++ipix) {
1980 map_drb(ipix, iphibar) = 0.0;
1986 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
1987 for (
int ipix = 0; ipix < npix; ++ipix) {
1988 if (map_drb(ipix, iphibar) < 0.0) {
1989 map_drb(ipix, iphibar) = 0.0;
2025 std::string msg =
"Observation \""+this->
name()+
"\" ("+this->
id()+
") "
2026 "does not contain a COMPTEL event cube. Please "
2027 "specify a COMPTEL observation containing and event "
2034 std::string msg =
"Specified DRM cube is incompatible with DRE. Please "
2035 "specify a DRM with a data-space definition that is "
2036 "identical to that of the DRE.";
2055 int npix = nchi * npsi;
2058 int navgr2 = int(navgr/2);
2061 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
2062 for (
int ipix = 0; ipix < npix; ++ipix) {
2063 map_drb(ipix, iphibar) = 0.0;
2064 map_dri(ipix, iphibar) = 0.0;
2069 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
2070 double sum_dre = 0.0;
2071 double sum_drm = 0.0;
2072 double sum_drg = 0.0;
2073 for (
int ipix = 0; ipix < npix; ++ipix) {
2074 sum_dre += map_dre(ipix, iphibar);
2075 sum_drm += map_drm(ipix, iphibar);
2076 sum_drg += map_drg(ipix, iphibar);
2078 if (sum_drg > 0.0) {
2079 double norm = (sum_dre - sum_drm) / sum_drg;
2080 for (
int ipix = 0; ipix < npix; ++ipix) {
2081 map_dri(ipix, iphibar) = map_drg(ipix, iphibar) *
norm;
2087 for (
int ichi = 0; ichi < nchi; ++ichi) {
2090 int kchi_min = ichi - navgr2;
2091 int kchi_max = ichi + navgr2;
2095 if (kchi_max >= nchi) {
2096 kchi_max = nchi - 1;
2100 for (
int ipsi = 0; ipsi < npsi; ++ipsi) {
2103 int kpsi_min = ipsi - navgr2;
2104 int kpsi_max = ipsi + navgr2;
2108 if (kpsi_max >= npsi) {
2109 kpsi_max = npsi - 1;
2113 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
2121 &ksel1, &kex1, &kex2, &ksel2);
2124 double sum_dre = 0.0;
2125 double sum_drm = 0.0;
2126 double sum_dri = 0.0;
2129 for (
int kchi = kchi_min; kchi <= kchi_max; ++kchi) {
2130 for (
int kpsi = kpsi_min; kpsi <= kpsi_max; ++kpsi) {
2133 int kpix = kchi + kpsi * nchi;
2137 for (
int kphibar = ksel1; kphibar <= kex1; ++kphibar) {
2138 sum_dre += map_dre(kpix, kphibar);
2139 sum_drm += map_drm(kpix, kphibar);
2140 sum_dri += map_dri(kpix, kphibar);
2145 if (kex2 < nphibar) {
2146 for (
int kphibar = kex2; kphibar <= ksel2; ++kphibar) {
2147 sum_dre += map_dre(kpix, kphibar);
2148 sum_drm += map_drm(kpix, kphibar);
2149 sum_dri += map_dri(kpix, kphibar);
2157 int ipix = ichi + ipsi * nchi;
2158 if (sum_dri > 0.0) {
2159 double norm = (sum_dre - sum_drm) / sum_dri;
2160 map_drb(ipix, iphibar) = map_dri(ipix, iphibar) *
norm;
2163 map_drb(ipix, iphibar) = 0.0;
2173 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
2174 double sum_dre = 0.0;
2175 double sum_drm = 0.0;
2176 double sum_drb = 0.0;
2177 for (
int ipix = 0; ipix < npix; ++ipix) {
2178 sum_dre += map_dre(ipix, iphibar);
2179 sum_drm += map_drm(ipix, iphibar);
2180 sum_drb += map_drb(ipix, iphibar);
2182 if (sum_drb > 0.0) {
2183 double norm = (sum_dre - sum_drm) / sum_drb;
2184 for (
int ipix = 0; ipix < npix; ++ipix) {
2185 map_drb(ipix, iphibar) *=
norm;
2189 for (
int ipix = 0; ipix < npix; ++ipix) {
2190 map_drb(ipix, iphibar) = 0.0;
2196 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
2197 for (
int ipix = 0; ipix < npix; ++ipix) {
2198 if (map_drb(ipix, iphibar) < 0.0) {
2199 map_drb(ipix, iphibar) = 0.0;
2236 std::string msg =
"Observation \""+this->
name()+
"\" ("+this->
id()+
") "
2237 "does not contain a COMPTEL event cube. Please "
2238 "specify a COMPTEL observation containing and event "
2245 std::string msg =
"Specified DRM cube is incompatible with DRE. Please "
2246 "specify a DRM with a data-space definition that is "
2247 "identical to that of the DRE.";
2266 int npix = nchi * npsi;
2269 int navgr2 = int(navgr/2);
2272 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
2273 for (
int ipix = 0; ipix < npix; ++ipix) {
2274 map_drb(ipix, iphibar) = 0.0;
2275 map_dri(ipix, iphibar) = 0.0;
2280 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
2281 double sum_dre = 0.0;
2282 double sum_drm = 0.0;
2283 double sum_drw = 0.0;
2284 for (
int ipix = 0; ipix < npix; ++ipix) {
2285 sum_dre += map_dre(ipix, iphibar);
2286 sum_drm += map_drm(ipix, iphibar);
2287 sum_drw += map_drw(ipix, iphibar);
2289 if (sum_drw > 0.0) {
2290 double norm = (sum_dre - sum_drm) / sum_drw;
2291 for (
int ipix = 0; ipix < npix; ++ipix) {
2292 map_dri(ipix, iphibar) = map_drw(ipix, iphibar) *
norm;
2298 for (
int ichi = 0; ichi < nchi; ++ichi) {
2301 int kchi_min = ichi - navgr2;
2302 int kchi_max = ichi + navgr2;
2306 if (kchi_max >= nchi) {
2307 kchi_max = nchi - 1;
2311 for (
int ipsi = 0; ipsi < npsi; ++ipsi) {
2314 int kpsi_min = ipsi - navgr2;
2315 int kpsi_max = ipsi + navgr2;
2319 if (kpsi_max >= npsi) {
2320 kpsi_max = npsi - 1;
2324 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
2332 &ksel1, &kex1, &kex2, &ksel2);
2335 double sum_dre = 0.0;
2336 double sum_drm = 0.0;
2337 double sum_dri = 0.0;
2340 for (
int kchi = kchi_min; kchi <= kchi_max; ++kchi) {
2341 for (
int kpsi = kpsi_min; kpsi <= kpsi_max; ++kpsi) {
2344 int kpix = kchi + kpsi * nchi;
2348 for (
int kphibar = ksel1; kphibar <= kex1; ++kphibar) {
2349 sum_dre += map_dre(kpix, kphibar);
2350 sum_drm += map_drm(kpix, kphibar);
2351 sum_dri += map_dri(kpix, kphibar);
2356 if (kex2 < nphibar) {
2357 for (
int kphibar = kex2; kphibar <= ksel2; ++kphibar) {
2358 sum_dre += map_dre(kpix, kphibar);
2359 sum_drm += map_drm(kpix, kphibar);
2360 sum_dri += map_dri(kpix, kphibar);
2368 int ipix = ichi + ipsi * nchi;
2369 if (sum_dri > 0.0) {
2370 double norm = (sum_dre - sum_drm) / sum_dri;
2371 map_drb(ipix, iphibar) = map_dri(ipix, iphibar) *
norm;
2374 map_drb(ipix, iphibar) = 0.0;
2384 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
2385 double sum_dre = 0.0;
2386 double sum_drm = 0.0;
2387 double sum_drb = 0.0;
2388 for (
int ipix = 0; ipix < npix; ++ipix) {
2389 sum_dre += map_dre(ipix, iphibar);
2390 sum_drm += map_drm(ipix, iphibar);
2391 sum_drb += map_drb(ipix, iphibar);
2393 if (sum_drb > 0.0) {
2394 double norm = (sum_dre - sum_drm) / sum_drb;
2395 for (
int ipix = 0; ipix < npix; ++ipix) {
2396 map_drb(ipix, iphibar) *=
norm;
2400 for (
int ipix = 0; ipix < npix; ++ipix) {
2401 map_drb(ipix, iphibar) = 0.0;
2407 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
2408 for (
int ipix = 0; ipix < npix; ++ipix) {
2409 if (map_drb(ipix, iphibar) < 0.0) {
2410 map_drb(ipix, iphibar) = 0.0;
2434 int npix = drg.
npix();
2435 int nphibar = drg.
nmaps();
2438 for (
int ipix = 0; ipix < npix; ++ipix) {
2440 for (
int iphibar = 0; iphibar < nphibar; ++iphibar) {
2441 drg(ipix,iphibar) *= omega;
2479 int imax = nphibar - 1;
2482 int nexcl2 = int(nexcl/2);
2483 int nincl2 = int(nincl/2);
2486 *iex1 = iphibar - nexcl2 - 1;
2487 *iex2 = iphibar + nexcl2 + 1;
2488 *isel1 = iphibar - nincl2;
2489 *isel2 = iphibar + nincl2;
2502 if (*isel2 > imax) {
2515 if (*isel2 == imax) {
2516 *isel1 = nphibar - nincl;
virtual void clear(void)
Clear COMPTEL observation.
const std::string & statistic(void) const
Return optimizer statistic.
double eval(const GEvent &event, const GObservation &obs, const bool &gradients=false) const
Evaluate sum of all models.
const std::string & rspname(void) const
Return response name.
COMPTEL instrument status class definition.
Abstract FITS image base class.
void load(const GFilename &drename, const GFilename &drbname, const GFilename &drwname, const GFilename &drgname, const GFilename &drxname)
Load data for a binned observation.
virtual void clear(void)
Clear instance.
const GCOMOads & oads(void) const
Return Orbit Aspect Data.
bool has_card(const int &cardno) const
Check existence of header card.
const int & ny(void) const
Returns number of pixels in y coordinate.
virtual double size(void) const =0
double norm(const GVector &vector)
Computes vector norm.
const GSkyProjection * projection(void) const
Returns pointer to sky projection.
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.
std::string m_name
Observation name.
double m_obs_id
Observation ID.
GFilename m_bvcname
BVC filename.
XML element node class interface definition.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL Good Time Intervals.
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.
void copy_members(const GCOMObservation &obs)
Copy class members.
Model container class definition.
GFilename m_drbname
DRB filename.
void init_members(void)
Initialise class members.
Abstract FITS extension base class.
double m_deadc
Deadtime correction.
GFilename m_timname
TIM filename.
const GCOMDri & drx(void) const
Return exposure.
std::vector< GFilename > m_oadnames
OAD filenames.
GEvents * m_events
Pointer to event container.
Abstract interface for the event bin class.
const GFilename & drxname(void) const
Return DRX filename.
virtual int size(void) const
Return number of bins in event cube.
const GFilename & drbname(void) const
Return DRB filename.
std::vector< GFilename > m_hkdnames
HKD filenames.
virtual double ontime(void) const
Return ontime.
const GCOMDri & drw(void) const
Return weighting cube.
GFilename m_evpname
EVP filename.
bool is_empty(void) const
Signal if filename is empty.
void caldb(const GCaldb &caldb)
Set calibration database.
COMPTEL observation class interface definition.
GCOMDri m_drx
Exposure map.
void gti(const GGti >i)
Set Good Time Intervals.
bool is_unbinned(void) const
Check whether observation is unbinned.
const GCOMDri & drb(void) const
Return background model.
std::string m_id
Observation identifier.
bool is_empty(void) const
Signals if there are no Orbit Aspect Data in container.
GCOMDri m_drg
Geometry factors.
Interface for the COMPTEL instrument response function.
double MeV(void) const
Return energy in MeV.
virtual int elements(void) const
Return number of GXMLElement children of node.
void load_drw(const GFilename &drwname)
Load weighting cube from DRW file.
void load_dre(const GFilename &drename)
Load event cube data from DRE file.
std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL Orbit Aspect Data container.
void free_members(void)
Delete class members.
int size(void) const
Return number of Orbit Aspect Data in container.
#define G_COMPUTE_DRB_BGDLIXA
void clear(void)
Clear COMPTEL Orbit Aspect Data container.
const int & phi_first(void) const
Return index of first Phibar layer to be used for likelihood fitting.
virtual double npred(const GModel &model) const
Return total number of predicted counts for one model.
FITS file class interface definition.
int nchi(void) const
Return number of Chi bins.
#define G_COMPUTE_DRB_BGDLIXE
GCOMTim m_tim
COMPTEL Good Time Intervals.
GFilename xml_file_reduce(const GXmlElement &xml, const std::string &filename)
Reduce file name provided for writing as XML attribute.
const GFilename & drgname(void) const
Return DRG filename.
void clear(void)
Clear Housekeeping Data collection.
bool is_empty(void) const
Signals if there are no Solar System Barycentre Data in container.
Implementation of support function used by COMPTEL classes.
int size(void) const
Return number of Good Time Intervals.
const GCOMObservation g_obs_com_seed
virtual std::string print(const GChatter &chatter=NORMAL) const
Print observation information.
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.
COMPTEL event bin class interface definition.
const GFilename & rspname(void) const
Return response cache filename.
void free_members(void)
Delete class members.
GCOMDri m_drb
Background model.
virtual const GCOMResponse * response(void) const
Return response function.
GCOMDri drm(const GModels &models) const
Compute DRM cube.
Abstract FITS extension base class definition.
GFilename m_rspname
Response cache filename.
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.
double real(const std::string &keyname) const
Return card value as double precision.
const GCOMDri & drg(void) const
Return geometry factors.
Calibration database class.
bool is_empty(void) const
Signals if there are no Housekeeping Data containers in collection.
virtual void read(const GFits &file)=0
GCOMBvcs m_bvcs
Solar System Barycentre Data.
const std::string & id(void) const
Return observation identifier.
GFilename m_drwname
DRW filename.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
const int & nmaps(void) const
Returns number of maps.
void compute_drb_phinor(const GCOMDri &drm)
Compute DRB cube using PHINOR method.
const GFilename & drename(void) const
Return DRE filename.
virtual void write(GXmlElement &xml) const
Write observation into XML element.
virtual void read(const GXmlElement &xml)
Read observation from XML element.
virtual double model(const GModels &models, const GEvent &event, GVector *gradients=NULL) const
Return model value and (optionally) gradients.
COMPTEL Housekeeping Data collection class.
void com_wcs_mer2car(GSkyMap &map)
Changes Mercator's projection to cartesian projection.
void load_drb(const GFilename &drbname)
Load background model from DRB file.
const GSkyMap & map(void) const
Return DRI sky map.
bool has_attribute(const std::string &name) const
Check if element has a given attribute.
double m_ontime
Ontime (sec)
GXmlElement * xml_need_par(const std::string &origin, GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
bool is_binned(void) const
Check whether observation is binned.
bool exists(void) const
Checks whether file exists.
Constant spectral model class interface definition.
Interface definition for the observation registry class.
const std::string & name(void) const
Return observation name.
void read_attributes(const GFitsHDU *hdu)
Read observation attributes.
Observation registry class definition.
void load_cache(const GFilename &filename)
Load response cache.
virtual void clear(void)
Clear COMPTEL good time intervals.
virtual std::string instrument(void) const
Return instrument.
void save_cache(const GFilename &filename) const
Save response cache.
#define G_COMPUTE_DRB_BGDLIXF
void extend(const GCOMHkds &hkds)
Extend Housekeeping Data collection.
std::string print(const GChatter &chatter=NORMAL) const
Print Housekeeping Data collection.
bool is_fits(void) const
Checks whether file is a FITS file.
const GFilename & drwname(void) const
Return DRW filename.
double m_livetime
Livetime (sec)
void init_members(void)
Initialise class members.
Abstract observation base class.
virtual GCOMObservation * clone(void) const
Clone COMPTEL observation.
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.
COMPTEL event bin container class.
void extend(const GCOMOads &oads)
Append Orbit Aspect Data container.
#define G_COMPUTE_DRB_PHINOR
Calibration database class interface definition.
int nphibar(void) const
Return number of Phibar bins.
bool xml_has_par(const GXmlElement &xml, const std::string &name)
Checks if parameter with given name in XML element exists.
const GCOMDri & dre(void) const
Return reference to DRE data.
GFitsImage * image(const int &extno)
Get pointer to image HDU.
std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL Solar System Barycentre Data container.
double m_ewidth
Energy width (MeV)
virtual GXmlElement * element(const int &index)
Return pointer to GXMLElement child.
void clear(void)
Clear file name.
int size(void) const
Return number of Housekeeping parameters in collection.
Sky model class interface definition.
virtual double counts(void) const
Return number of counts in event bin.
Abstract event container class.
virtual void clear(void)
Clear COMPTEL Data Space.
const GEnergy & emin(void) const
Return minimum energy.
GCOMOads m_oads
Orbit Aspect Data.
void load_drx(const GFilename &drxname)
Load exposure from DRX file.
void read(const GFitsImage &image)
Read COMPTEL Data Space from DRI FITS image.
Interface class for COMPTEL observations.
GChatter reduce(const GChatter &chatter)
Reduce chattiness by one level.
GSkyMap get_weighted_drg_map(void) const
Return weighted DRG map.
int npsi(void) const
Return number of Psi bins.
void clear(void)
Clear COMPTEL Solar System Barycentre Data container.
virtual bool use_event_for_likelihood(const int &index) const
Check whether bin should be used for likelihood analysis.
void load(const GFilename &filename, const std::string &usage="YES", const std::string &mode="NORMAL")
Load COMPTEL Good Time Intervals from FITS file.
virtual GObservation & operator=(const GObservation &obs)
Assignment operator.
virtual GEvents * events(void)
Return events.
std::string string(const std::string &keyname) const
Return card value as string.
Exception handler interface definition.
COMPTEL event list class.
const int & nx(void) const
Returns number of pixels in x coordinate.
COMPTEL Data Space class.
virtual double livetime(void) const
Return livetime.
COMPTEL Orbit Aspect Data container class.
GCOMHkds m_hkds
Housekeeping Data.
int m_phi_last
Last Phibar layer to use for likelihood.
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.
void write_attributes(GFitsHDU *hdu) const
Write observation attributes.
const int & size(void) const
Return size of vector.
double solidangle(const int &index) const
Returns solid angle of pixel.
Abstract sky projection base class.
virtual GXmlNode * append(const GXmlNode &node)
Append XML child node.
Abstract instrument response base class.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
virtual double size(void) const
Return size of event bin.
virtual GCOMObservation & operator=(const GCOMObservation &obs)
Assignment operator.
GCOMDri m_drw
Weighting cube.
const int & npix(void) const
Returns number of pixels.
void load(const GFilename &filename)
Load COMPTEL Solar System Barycentre Data FITS file.
bool check_dri(const GCOMDri &map) const
Check if DRI is compatible with event cube.
GCOMObservation(void)
Void constructor.
Abstract event bin container class.
void close(void)
Close FITS file.
int m_phi_first
First Phibar layer to use for likelihood.
const int & phi_last(void) const
Return index of last Phibar layer to be used for likelihood fitting.
const GEnergy & emax(void) const
Return maximum energy.
GFilename m_drxname
DRX filename.
virtual ~GCOMObservation(void)
Destructor.
GModel * append(const GModel &model)
Append model to container.
const GGti & gti(void) const
Return Good Time Intervals.
void load_drg(const GFilename &drgname)
Load geometry factors from DRG file.
const double & ontime(void) const
Returns ontime.
GCOMResponse m_response
Response functions.
GFilename m_drgname
DRG filename.
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
std::string m_instrument
Instrument name.
Mathematical function definitions.
GFilename m_drename
DRE filename.
void load(const std::string &rspname)
Load COMPTEL response.
GFilename xml_file_expand(const GXmlElement &xml, const std::string &filename)
Expand file name provided as XML attribute for loading.
virtual void remove(const int &index)
Remove XML child node.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.