53#define G_COMPUTE_DRE "GCOMDri::compute_dre(GCOMObservation&, "\
54 "GCOMSelection&, double&)"
55#define G_COMPUTE_DRX "GCOMDri::compute_drx(GCOMObservation&, "\
56 "GCOMSelection&, double&)"
57#define G_COMPUTE_DRM "GCOMDri::compute_drm(GCOMObservation&, GModel&)"
58#define G_COMPUTE_TOF_CORRECTION "GCOMDri::compute_tof_correction()"
72const double r1 = 13.8;
127 const double& phimin,
128 const double& phibin,
267 const double& zetamin)
270 #if defined(G_DEBUG_COMPUTE_DRE)
271 std::cout <<
"GCOMDri::compute_dre" << std::endl;
272 std::cout <<
"====================" << std::endl;
277 if (events == NULL) {
278 std::string msg =
"No event list found in COMPTEL observation. Please "
279 "specify an observation that contains an event list.";
285 std::string msg =
"DRE cube has a non-positive Phibar bin size. Please "
286 "specify a DRE cube with a positive Phibar bin size.";
311 int num_used_events = 0;
312 int num_event_outside_sp = 0;
313 int num_energy_too_low = 0;
314 int num_energy_too_high = 0;
315 int num_eha_too_small = 0;
316 int num_phibar_too_low = 0;
317 int num_phibar_too_high = 0;
318 int num_outside_dre = 0;
319 int num_event_before_dre = 0;
320 int num_event_after_dre = 0;
321 int num_processed = 0;
327 bool terminate =
false;
344 for (
int i_oad = 0; i_oad < obs.
oads().
size(); ++i_oad) {
356 double theta_geocentre = double(oad.
gcel());
357 double phi_geocentre = double(oad.
gcaz());
358 sky_geocentre.
radec_deg(phi_geocentre, 90.0-theta_geocentre);
362 for (; i_evt < events->
size(); ++i_evt) {
368 if (event->time() > oad.
tstop()) {
380 num_event_before_dre++;
386 num_event_after_dre++;
394 if (event->time() < oad.
tstart()) {
395 num_event_outside_sp++;
401 num_energy_too_low++;
405 num_energy_too_high++;
417 num_phibar_too_low++;
420 else if (iphibar >=
nphibar()) {
421 num_phibar_too_high++;
426 #if defined(G_CHECK_EHA_COMPUTATION)
428 double theta_event = double(event->theta());
429 double phi_event = double(event->phi());
430 sky_event.
radec_deg(-phi_event, 90.0-theta_event);
432 if (std::abs(eha - event->eha()) > 1.5) {
433 std::string msg =
"Earth horizon angle from EVP dataset ("+
435 "differs from Earth horizon angle "
436 "computed from Orbit Aspect Data ("+
445 double ehamin = double(iphibar) *
m_phibin + zetamin;
446 if (event->eha() < ehamin) {
470 tdelta = ephem.
geo2ssb(ephemeris.
dir(), event->time(), oad.
pos()) +
471 event->time().utc2tt();
476 GTime time =
event->time() + tdelta;
480 double phase = ephemeris.
phase(time,
"UTC");
509 if (terminate || i_evt >= events->
size()) {
521 #if defined(G_DEBUG_COMPUTE_DRE)
525 std::cout <<
"Total number of events .......: " << events.
size() << std::endl;
526 std::cout <<
"Processed events .............: " << num_processed << std::endl;
527 std::cout <<
"Used events ..................: " << num_used_events << std::endl;
528 std::cout <<
"Events outside superpacket ...: " << num_event_outside_sp << std::endl;
529 std::cout <<
"Events before DRE GTI ........: " << num_event_before_dre << std::endl;
530 std::cout <<
"Events after DRE GTI .........: " << num_event_after_dre << std::endl;
531 std::cout <<
"Energy too low ...............: " << num_energy_too_low << std::endl;
532 std::cout <<
"Energy too high ..............: " << num_energy_too_high << std::endl;
533 std::cout <<
"Phibar too low ...............: " << num_phibar_too_low << std::endl;
534 std::cout <<
"Phibar too high ..............: " << num_phibar_too_high << std::endl;
535 std::cout <<
"Outside DRE cube .............: " << num_outside_dre << std::endl;
536 std::cout <<
"Earth horizon angle too small : " << num_eha_too_small << std::endl;
559 const double& zetamin)
562 #if defined(G_DEBUG_COMPUTE_DRG)
563 std::cout <<
"GCOMDri::compute_drg" << std::endl;
564 std::cout <<
"====================" << std::endl;
589 for (
int i_oad = 0; i_oad < obs.
oads().
size(); ++i_oad) {
605 double theta_geocentre = double(oad.
gcel());
606 double phi_geocentre = double(oad.
gcaz());
608 geocentre_comptel.
radec_deg(phi_geocentre, 90.0-theta_geocentre);
611 for (
int index = 0; index <
m_dri.
npix(); ++index) {
617 double theta = oad.
theta(sky);
618 double phi = oad.
phi(sky);
627 chipsi_comptel.
radec_deg(phi, 90.0-theta);
628 double eha = geocentre_comptel.
dist_deg(chipsi_comptel) - oad.
georad();
631 for (
int iphibar = 0; iphibar <
nphibar(); ++iphibar) {
634 double ehamin = double(iphibar) *
m_phibin + zetamin;
639 int inx = index + iphibar *
m_dri.
npix();
640 (*this)[inx] += geometry;
652 for (
int i = 0; i <
size(); ++i) {
666 #if defined(G_DEBUG_COMPUTE_DRG)
706 #if defined(G_DEBUG_COMPUTE_DRX)
707 std::cout <<
"GCOMDri::compute_drx" << std::endl;
708 std::cout <<
"====================" << std::endl;
712 const double tau = 0.2;
729 for (
int i_oad = 0; i_oad < obs.
oads().
size(); ++i_oad) {
740 for (
int index = 0; index <
m_dri.
npix(); ++index) {
746 double theta = oad.
theta(sky);
749 double exposure = 0.0;
760 exposure =
d1_area * costheta *
761 (1.0 - std::exp(-tau / costheta)) /
762 (1.0 - std::exp(-tau));
765 exposure =
d1_area * costheta / (1.0 - std::exp(-tau));
770 (*this)[index] += exposure;
777 for (
int i = 0; i <
size(); ++i) {
790 #if defined(G_DEBUG_COMPUTE_DRX)
819 for (
int iphibar = 0, i = 0; iphibar <
nphibar(); ++iphibar) {
820 for (
int ipix = 0; ipix < npix; ++ipix, ++i) {
821 m_dri(ipix, iphibar) = values[i];
846 const double& armmin,
847 const double& armmax)
const
850 double content = 0.0;
854 for (
int i = 0; i < phigeo.
npix(); ++i) {
859 for (
int iphibar = 0; iphibar < this->
nphibar(); ++iphibar) {
862 double phibar = this->
phimin() + (iphibar+0.5) * this->
phibin();
865 int offset = iphibar * phigeo.
npix();
868 for (
int i = 0; i < phigeo.
npix(); ++i) {
871 double arm = phibar - phigeo(i);
874 if (arm >= armmin && arm < armmax) {
875 content += (*this)[i + offset];
895 GFits fits(filename);
904 for (
int i = 0; i < fits.
size(); ++i) {
940 fits.
saveto(filename, clobber);
1010 double chimin = 0.0;
1011 double chimax = 0.0;
1012 double chibin = 0.0;
1013 double psimin = 0.0;
1014 double psimax = 0.0;
1015 double psibin = 0.0;
1018 chibin = wcs->
cdelt(0);
1019 chimin = wcs->
crval(0) - (wcs->
crpix(0)-0.5) * chibin;
1020 chimax = chimin +
m_dri.
nx() * chibin;
1021 psibin = wcs->
cdelt(1);
1022 psimin = wcs->
crval(1) - (wcs->
crpix(1)-0.5) * psibin;
1023 psimax = psimin +
m_dri.
ny() * psibin;
1030 result.append(
"=== GCOMDri ===");
1186 for (
int i = 0; i <
size(); ++i) {
1302 if (tstop > tstart) {
1395 hdu->
card(
"CTYPE3",
"Phibar",
"Compton scatter angle");
1396 hdu->
card(
"CRPIX3", 1.0,
"Pixel coordinate of reference point (starting from 1)");
1397 hdu->
card(
"CRVAL3", crval3,
"[deg] Coordinate value at reference point");
1398 hdu->
card(
"CDELT3",
m_phibin,
"[deg] Coordinate increment at reference point");
1416 hdu->
card(
"VISDAY", visday,
"[TJD] Data validity interval start day");
1417 hdu->
card(
"VISTIM", vistim,
"[tics] Data validity interval start time");
1418 hdu->
card(
"VIEDAY", vieday,
"[TJD] Data validity interval end day");
1419 hdu->
card(
"VIETIM", vietim,
"[tics] Data validity interval end time");
1438 std::string d1use =
"0000000";
1439 for (
int i = 0; i < 7; ++i) {
1444 hdu->
card(
"D1USE", d1use,
"D1 module usage");
1447 std::string d2use =
"00000000000000";
1448 for (
int i = 0; i < 14; ++i) {
1453 hdu->
card(
"D2USE", d2use,
"D2 module usage");
1459 hdu->
card(
"EHAMIN",
m_zetamin,
"[deg] Minimum Earth horizon - Phibar cut");
1482 hdu->
card(
"DRWFITIT",
m_drw_iter,
"DRW f_prompt fit iterations");
1507 const double& theta,
1513 const double xd1[] = {0.0,-42.3,-26.0,26.0, 42.3,26.0,-26.0};
1514 const double yd1[] = {0.0, 0.0, 39.1,39.1, 0.0,-39.1,-39.1};
1517 const double xd2[] = { 30.2, 0.0, -30.2, 45.3, 15.1, -15.1, -45.3,
1518 45.3, 15.1, -15.1, -45.3, 30.2, 0.0, -30.2};
1519 const double yd2[] = {-41.254,-41.254,-41.254,-15.1, -15.1, -15.1, -15.1,
1520 15.1, 15.1, 15.1 , 15.1, 41.254,41.254,41.254};
1524 const double delz = 158.0;
1530 const double r2 = 14.085;
1534 const double r2sq = r2 * r2;
1535 const double drsq =
r1sq - r2sq;
1539 double geometry = 0.0;
1544 double cosphi = std::cos(phi_rad);
1545 double sinphi = std::sin(phi_rad);
1546 double tantheta = std::tan(theta_rad);
1549 for (
int id1 = 0; id1 < 7; ++id1) {
1552 if (status.
d1status(tjd, id1+1) != 1) {
1557 double xd1_prj = xd1[id1] - delz * tantheta * cosphi;
1558 double yd1_prj = yd1[id1] - delz * tantheta * sinphi;
1561 for (
int id2 = 0; id2 < 14; ++id2) {
1569 int d2status = status.
d2status(tjd, id2+1);
1573 if ((d2status < 1) || ((d2status > 1) && (select.
fpmtflag() == 0))) {
1579 double dx = xd2[id2] - xd1_prj;
1580 double dy = yd2[id2] - yd1_prj;
1581 double dsq = dx * dx + dy * dy;
1582 double d = std::sqrt(dsq);
1593 double overlap = 0.0;
1594 if ((d2status > 1) && (select.
fpmtflag() == 2)) {
1598 xd2[id2], yd2[id2], r2,
1610 if (d <= r2 -
r1 + 0.1) {
1611 double gmt = (1.0 > overlap) ? 1.0 - overlap : 0.0;
1621 double d2 = 2.0 * d;
1622 double cbeta1 = (dsq + drsq) / (d2 *
r1);
1623 double cbeta2 = (dsq - drsq) / (d2 * r2);
1626 double sbeta1 = std::sqrt(1.0 - cbeta1 * cbeta1);
1627 double sbeta2 = std::sqrt(1.0 - cbeta2 * cbeta2);
1630 double beta1 = std::acos(cbeta1);
1631 double beta2 = std::acos(cbeta2);
1634 double gmt = (
r1sq * (beta1 - sbeta1 * cbeta1) +
1635 r2sq * (beta2 - sbeta2 * cbeta2)) * norm_geo -
1674 const double& x2,
const double& y2,
const double& r2)
const
1677 double surface = 0.0;
1680 double dx = x1 - x2;
1681 double dy = y1 - y2;
1682 double dsq = dx * dx + dy * dy;
1683 double d = std::sqrt(dsq);
1694 else if (r2 > (d+
r1)) {
1700 else if (d < (
r1+r2)) {
1703 double d2 = 2.0 * d;
1705 double r2sq = r2 * r2;
1706 double cbeta1 = (
r1sq - r2sq + dsq) / (d2 *
r1);
1707 double cbeta2 = (r2sq -
r1sq + dsq) / (d2 * r2);
1710 double sbeta1 = std::sqrt(1.0 - cbeta1 * cbeta1);
1711 double sbeta2 = std::sqrt(1.0 - cbeta2 * cbeta2);
1714 double beta1 = std::acos(cbeta1);
1715 double beta2 = std::acos(cbeta2);
1718 surface =
r1sq * (beta1 - sbeta1 * cbeta1) +
1719 r2sq * (beta2 - sbeta2 * cbeta2);
1748 const double& x2,
const double& y2,
const double& r2,
1749 const double& x3,
const double& y3,
const double& r3)
const
1752 const int steps = 25;
1753 const int size = steps*steps;
1754 static double o23_x[
size];
1755 static double o23_y[
size];
1756 static double last_x2 = 1.0e25;
1757 static double last_y2 = 1.0e25;
1758 static double last_x3 = 1.0e25;
1759 static double last_y3 = 1.0e25;
1760 static int no23 = 0;
1763 double overlap = 0.0;
1770 double dx12 = x1 - x2;
1771 double dy12 = y1 - y2;
1772 double d12 = std::sqrt(dx12*dx12 + dy12*dy12);
1773 if (d12 > (
r1+r2)) {
1779 double dx13 = x1 - x3;
1780 double dy13 = y1 - y3;
1781 double d13 = std::sqrt(dx13*dx13 + dy13*dy13);
1782 if (d13 > (
r1+r3)) {
1800 double step = 2.0 * r3 / double(steps-3);
1801 double stepsq = step * step;
1803 if ((last_x2 != x2) || (last_y2 != y2) || (last_x3 != x3) || (last_y3 != y3)) {
1813 double r2sq = r2 * r2;
1814 double r3sq = r3 * r3;
1816 double yy = y3 - r3 - step;
1817 for (
int i = 0; i < steps; ++i, yy += step) {
1818 double xx = x3 - r3 - step;
1819 for (
int j = 0; j < steps; ++j, xx += step) {
1820 double dx3 = xx - x3;
1821 double dy3 = yy - y3;
1822 if (dx3*dx3 + dy3*dy3 < r3sq) {
1823 double dx2 = xx - x2;
1824 double dy2 = yy - y2;
1825 if (dx2*dx2 + dy2*dy2 < r2sq) {
1838 for (
int i = 0; i < no23; ++i) {
1839 double dx1 = o23_x[i] - x1;
1840 double dy1 = o23_y[i] - y1;
1841 if (dx1*dx1 + dy1*dy1 <
r1sq) {
1849 if (overlap > 0.0) {
1866 const double tofcoreng[] = {0.8660, 1.7321, 5.4772, 17.3205};
1867 const double tofcor110[] = {1.14, 1.07, 1.02, 1.01};
1868 const double tofcor111[] = {1.17, 1.09, 1.03, 1.01};
1869 const double tofcor112[] = {1.21, 1.11, 1.05, 1.02};
1870 const double tofcor113[] = {1.26, 1.15, 1.07, 1.04};
1871 const double tofcor114[] = {1.32, 1.20, 1.11, 1.06};
1872 const double tofcor115[] = {1.40, 1.27, 1.17, 1.11};
1873 const double tofcor116[] = {1.50, 1.36, 1.24, 1.17};
1874 const double tofcor117[] = {1.63, 1.47, 1.35, 1.28};
1875 const double tofcor118[] = {1.79, 1.63, 1.51, 1.43};
1876 const double tofcor119[] = {2.01, 1.85, 1.73, 1.67};
1877 const double* tofcor[] = {tofcor110, tofcor111, tofcor112,
1878 tofcor113, tofcor114, tofcor115,
1879 tofcor116, tofcor117, tofcor118,
1884 std::string msg =
"Minimum of ToF selection window "+
1886 " is smaller than 110. No ToF correction is "
1887 "available for this value.";
1891 std::string msg =
"Minimum of ToF selection window "+
1893 " is larger than 119. No ToF correction is "
1894 "available for this value.";
1898 std::string msg =
"Maximum of ToF selection window "+
1900 " is not 130. No ToF correction is available for "
#define G_COMPUTE_TOF_CORRECTION
const double superpacket_duration
COMPTEL Data Space class definition.
COMPTEL event list class definition.
COMPTEL Orbit Aspect Data class definition.
COMPTEL Orbit Aspect Data container class definition.
COMPTEL observation class interface definition.
COMPTEL selection set class definition.
COMPTEL instrument status class definition.
Implementation of support function used by COMPTEL classes.
COMPTEL Good Time Intervals class definition.
Ephemerides class definition.
Abstract FITS image base class definition.
FITS file class interface definition.
Mathematical function definitions.
Sky model class interface definition.
Point source spatial model class interface definition.
Abstract spatial model base class interface definition.
Node array class interface definition.
double norm(const GVector &vector)
Computes vector norm.
Abstract world coordinate system base class definition.
bool is_empty(void) const
Signals if there are no Solar System Barycentre Data in container.
double tdelta(const GSkyDir &dir, const GTime &time) const
Return time difference between photon arrival time at CGRO and the Solar System Barycentre (SSB)
COMPTEL Data Space class.
void init_statistics(void)
Initialise computation statistics.
virtual void clear(void)
Clear COMPTEL Data Space.
GCOMDri & operator=(const GCOMDri &dri)
Assignment operator.
int m_num_skipped_superpackets
Number of skipped superpackets.
void save(const GFilename &filename, const bool &clobber=false) const
Save COMPTEL Data Space into DRI FITS file.
GFitsBinTable m_drw_table
DRW binary table to append to the FITS file.
double compute_overlap(const double &x1, const double &y1, const double &r1, const double &x2, const double &y2, const double &r2, const double &x3, const double &y3, const double &r3) const
Compute overlap between three circles.
virtual GCOMDri * clone(void) const
Clone COMPTEL Data Space.
int nchi(void) const
Return number of Chi bins.
void compute_drm(const GCOMObservation &obs, const GModel &model)
Compute DRM model.
double m_drw_fprompt
DRW fitted fprompt parameter.
double m_phibin
Phibar binsize (deg)
double m_phasecor
Pulsar phase correction.
void write_attributes(GFitsHDU *hdu) const
Write DRI attributes into FITS HDU.
GTime m_tstart
Selection start time.
virtual ~GCOMDri(void)
Destructor.
std::string m_drw_status
DRW fitting status.
double compute_surface(const double &x1, const double &y1, const double &r1, const double &x2, const double &y2, const double &r2) const
Compute surface of overlap between two circles.
std::string m_drw_method
DRW method.
void free_members(void)
Delete class members.
GGti m_gti
Good Time Intervals of data cube.
int m_num_used_superpackets
Number of used superpackets.
void compute_drx(const GCOMObservation &obs, const GCOMSelection &select=GCOMSelection())
Compute DRX exposure map.
void compute_drg(const GCOMObservation &obs, const GCOMSelection &select=GCOMSelection(), const double &zetamin=5.0)
Compute geometry cube.
double m_drw_e_fprompt
DRW fprompt parameter error.
void compute_tof_correction(void)
Compute ToF correction.
double compute_geometry(const int &tjd, const double &theta, const double &phi, const GCOMSelection &select, const GCOMStatus &status) const
Compute DRG geometry factor.
void init_members(void)
Initialise class members.
const double & phibin(void) const
Return Compton scatter angle bin of DRI cube.
void init_cube(void)
Initialise DRI cube.
void load(const GFilename &filename)
Load COMPTEL Data Space from DRI FITS file.
const GSkyMap & map(void) const
Return DRI sky map.
double m_zetamin
Minimum zeta angle.
const double & phimin(void) const
Return minimum Compton scatter angle of DRI cube.
GCOMDri(void)
Void constructor.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL Data Space.
GCOMSelection m_selection
Selection parameters.
GEbounds m_ebounds
Energy boundaries of data cube.
int npsi(void) const
Return number of Psi bins.
double m_phimin
Phibar minimum (deg)
void compute_dre(const GCOMObservation &obs, const GCOMSelection &select=GCOMSelection(), const double &zetamin=5.0)
Compute event cube.
std::string m_name
Data cube name.
GTime m_tstop
Selection stop time.
int size(void) const
Return number of bins.
int m_drw_iter
DRW fitting iterations.
int m_num_superpackets
Number of superpackets.
bool use_superpacket(const GCOMOad &oad, const GCOMTim &tim, const GCOMSelection &select)
Check if superpacket should be used.
bool m_has_selection
Signal that selection was applied.
void read_attributes(const GFitsHDU *hdu)
Read DRI attributes from FITS HDU.
void write(GFits &fits, const std::string &extname="") const
Write COMPTEL Data Space into FITS image.
double m_tofcor
ToF correction.
int nphibar(void) const
Return number of Phibar bins.
void read(const GFitsImage &image)
Read COMPTEL Data Space from DRI FITS image.
void copy_members(const GCOMDri &dri)
Copy class members.
double cone_content(const GSkyDir &dir, const double &armmin, const double &armmax) const
Compute content in cone.
COMPTEL event atom class.
COMPTEL event list class.
virtual int size(void) const
Return number of events in list.
COMPTEL Orbit Aspect Data class.
const int & tjd(void) const
Return Truncated Julian Days of Orbit Aspect Record.
double theta(const GSkyDir &sky) const
Return zenith angle of sky direction in COMPTEL coordinates.
const float & gcaz(void) const
Return Geocentre azimuth angle.
const GTime & tstart(void) const
Return start time of superpacket.
const float & gcel(void) const
Return Geocentre zenith angle.
const float & georad(void) const
Return apparent radius of Earth.
const GTime & tstop(void) const
Return stop time of superpacket.
const GVector & pos(void) const
Return telescope position vector (km)
double phi(const GSkyDir &sky) const
Return azimuth angle of sky direction in COMPTEL coordinates.
Interface class for COMPTEL observations.
const GCOMTim & tim(void) const
Return COMPTEL Good Time Intervals.
const GCOMOads & oads(void) const
Return Orbit Aspect Data.
const GCOMBvcs & bvcs(void) const
Return Solar System Barycentre Data.
COMPTEL selection set class.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL selection set.
const int & tof_min(void) const
Return minimum of ToF selection window.
const int & fpmtflag(void) const
Return failed PMT flag for D2 modules.
void read(const GFitsHDU &hdu)
Read selection set from FITS HDU keywords.
void write(GFitsHDU &hdu) const
Write selection set keywords into FITS HDU.
bool has_pulsar(void) const
Signals that pulsar selection should be performed.
bool use_event(const GCOMEventAtom &event) const
Check if event should be used.
double orbital_phase(const GTime &time) const
Return orbital phase for a given time.
void init_statistics(void) const
Initialise selection statistics.
const int & tof_max(void) const
Return maximum of ToF selection window.
const GPhases & pulsar_phases(void) const
Return pulsar phases.
const bool & use_d1(const int &id1) const
Return D1 module usage flag.
const bool & use_d2(const int &id2) const
Return D2 module usage flag.
virtual void clear(void)
Clear COMPTEL selection set.
const GPhases & orbital_phases(void) const
Return orbital phases.
const GPulsar & pulsar(void) const
Return pulsar.
COMPTEL instrument status class.
int d2status(const int &tjd, const int &module) const
Return D2 module status.
int d1status(const int &tjd, const int &module) const
Return D1 module status.
COMPTEL Good Time Intervals class.
void reduce(const GGti >i)
Reduces Good Time Intervals to intersection with intervals.
bool contains(const GTime &time) const
Check if time is comprised in the Good Time Intervals.
Energy boundaries container class.
const GEnergy & emax(void) const
Return maximum energy of all intervals.
std::string print(const GChatter &chatter=NORMAL) const
Print energy boundaries.
int size(void) const
Return number of energy boundaries.
void clear(void)
Clear energy boundaries.
const GEnergy & emin(void) const
Return minimum energy of all intervals.
Class that handles energies in a unit independent way.
double MeV(void) const
Return energy in MeV.
double geo2ssb(const GSkyDir &srcdir, const GTime &time) const
Get time difference between geocentric and SSB (seconds)
std::string extname(const std::string &defaultname="") const
Return extension name.
virtual void clear(void)
Clear binary table.
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.
GFitsHeaderCard & card(const int &cardno)
Return header card.
int integer(const std::string &keyname) const
Return card value as integer.
Abstract FITS image base class.
const int & nrows(void) const
Return number of rows in table.
void saveto(const GFilename &filename, const bool &clobber=false)
Saves to specified FITS file.
int size(void) const
Return number of HDUs in FITS file.
GFitsHDU * append(const GFitsHDU &hdu)
Append HDU to FITS file.
GFitsImage * image(const int &extno)
Get pointer to image HDU.
void close(void)
Close FITS file.
Good Time Interval class.
bool contains(const GTime &time) const
Checks whether Good Time Intervals contains time.
std::string print(const GChatter &chatter=NORMAL) const
Print Good Time Intervals.
void reference(const GTimeReference &ref)
Set time reference for Good Time Intervals.
const GTime & tstop(void) const
Returns latest stop time in Good Time Intervals.
int size(void) const
Return number of Good Time Intervals.
void reduce(const GTime &tstart, const GTime &tstop)
Reduce Good Time Intervals to specified interval.
const GTime & tstart(void) const
Returns earliest start time in Good Time Intervals.
void clear(void)
Clear Good Time Intervals.
virtual double eval(const GEvent &event, const GObservation &obs, const bool &gradients=false) const =0
void set_value(const double &value) const
Set indices and weighting factors for interpolation.
const int & inx_right(void) const
Returns right node index.
const int & inx_left(void) const
Returns left node index.
const double & wgt_right(void) const
Returns right node weight.
const double & wgt_left(void) const
Returns left node weight.
virtual GEvents * events(void)
Return events.
double length(void) const
Returns total length of phase intervals.
bool contains(const double &phase) const
Check whether phase is contained in phases.
bool is_empty(void) const
Signal if there are no phase intervals.
double phase(void) const
Returns pulse phase.
const GSkyDir & dir(void) const
Returns pulsar sky direction.
const GPulsarEphemeris & ephemeris(const GTime &time) const
Return pulsar ephemeris.
GGti validity(void) const
Return validity intervals of pulsar ephemerides.
void radec_deg(const double &ra, const double &dec)
Set equatorial sky direction (degrees)
double dist_deg(const GSkyDir &dir) const
Compute angular distance between sky directions in degrees.
const int & nmaps(void) const
Returns number of maps.
void clear(void)
Clear instance.
GSkyDir inx2dir(const int &index) const
Returns sky direction of pixel.
GSkyMap extract(const int &map, const int &nmaps=1) const
Extract maps into a new sky map object.
const int & nx(void) const
Returns number of pixels in x coordinate.
void read(const GFitsHDU &hdu)
Read skymap from FITS HDU.
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.
GFitsHDU * write(GFits &file, const std::string &extname="") const
Write sky map into FITS file.
bool contains(const GSkyDir &dir) const
Checks if sky direction falls in map.
int pix2inx(const GSkyPixel &pixel) const
Converts sky map pixel into pixel index.
GSkyPixel dir2pix(const GSkyDir &dir) const
Returns sky map pixel for a given sky direction.
std::string print(const GChatter &chatter=NORMAL) const
Print sky map.
void clear(void)
Clear time.
std::string utc(const int &precision=0) const
Return time as string in UTC time system.
const double & secs(void) const
Return time in seconds in native reference (TT)
Abstract world coordinate system base class.
double cdelt(const int &inx) const
Return pixel size.
double crpix(const int &inx) const
Return reference pixel.
double crval(const int &inx) const
Return value of reference pixel.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
const double & com_exd2r(const int &id2)
Return D2 module exclusion region radius.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
const double & com_exd2x(const int &id2)
Return D2 module exclusion region X position.
const std::string extname_dri
void com_wcs_mer2car(GSkyMap &map)
Changes Mercator's projection to cartesian projection.
const double & com_exd2y(const int &id2)
Return D2 module exclusion region Y position.
int com_tics(const GTime &time)
Convert GTime in COMPTEL tics.
GChatter reduce(const GChatter &chatter)
Reduce chattiness by one level.
void warning(const std::string &origin, const std::string &message)
Emits warning.
int com_tjd(const GTime &time)
Convert GTime in COMPTEL TJD.
GTime com_time(const int &tjd, const int &tics)
Convert TJD and COMPTEL tics in GTime object.