Commit f54b67a746728a4250f37aed0950a294649b4f72
1 parent
342c1007
Add GCTAEventList::ipix() and GCTAEventList::ieng() setter methods (#2171)
Showing
6 changed files
with
56 additions
and
12 deletions
ChangeLog
| 1 | -2017-07-25 | |
| 1 | +2017-07-27 | |
| 2 | 2 | |
| 3 | 3 | * Version 1.4.0 released |
| 4 | 4 | ========================= |
| 5 | 5 | |
| 6 | + Add GCTAEventBin::ipix() and ieng() setter methods (#2171) | |
| 6 | 7 | Write response information into simulated observation definition file (#2170) |
| 7 | 8 | Normalise phase curves by default (#2154) |
| 8 | 9 | Support Python list slicing for container classes (#2128) | ... | ... |
NEWS
| 1 | 1 | New Features and Important Changes in GammaLib 1.4.0 |
| 2 | 2 | |
| 3 | -25 July 2017 | |
| 3 | +27 July 2017 | |
| 4 | 4 | |
| 5 | 5 | |
| 6 | 6 | 1. Introduction |
| ... | ... | @@ -29,6 +29,8 @@ The following methods have been added: |
| 29 | 29 | - GModelTemporalPhaseCurve::normalize() |
| 30 | 30 | - GModelTemporalPhaseCurve::value(double&) |
| 31 | 31 | - GOptimizerPars::append(GOptimizerPar&) |
| 32 | +- GCTAEventList::ipix(int&) | |
| 33 | +- GCTAEventList::ieng(int&) | |
| 32 | 34 | - GLATEventList::append(GLATEventAtom&) |
| 33 | 35 | - GLATEventList::reserve(int&) |
| 34 | 36 | - GLATEventList::remove(int&,int&) |
| ... | ... | @@ -153,6 +155,9 @@ The response information is now always written in the observation definition |
| 153 | 155 | XML file if it is available, and not only if it has been read in previously |
| 154 | 156 | from another XML file (#2170). |
| 155 | 157 | |
| 158 | +Add GCTAEventList::ipix() and GCTAEventList::ieng() setter methods (#2171). | |
| 159 | + | |
| 160 | + | |
| 156 | 161 | |
| 157 | 162 | 21. COMPTEL interface |
| 158 | 163 | --------------------- | ... | ... |
doc/source/admin/release_history/1.4.rst
| ... | ... | @@ -20,6 +20,8 @@ Bug fixes |
| 20 | 20 | Improvements |
| 21 | 21 | ------------ |
| 22 | 22 | |
| 23 | +* [`2171 <https://cta-redmine.irap.omp.eu/issues/2171>`_] - | |
| 24 | + Add ``GCTAEventList::ipix()`` and ``GCTAEventList::ieng()`` setter methods | |
| 23 | 25 | * [`2170 <https://cta-redmine.irap.omp.eu/issues/2170>`_] - |
| 24 | 26 | Write response information into simulated observation definition file |
| 25 | 27 | * [`2154 <https://cta-redmine.irap.omp.eu/issues/2154>`_] - | ... | ... |
inst/cta/include/GCTAEventBin.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GCTAEventBin.hpp - CTA event bin class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2010-2016 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2010-2017 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -86,6 +86,8 @@ public: |
| 86 | 86 | void dir(const GCTAInstDir& dir); |
| 87 | 87 | void energy(const GEnergy& energy); |
| 88 | 88 | void time(const GTime& time); |
| 89 | + void ipix(const int& ipix); | |
| 90 | + void ieng(const int& ieng); | |
| 89 | 91 | void solidangle(const double& solidangle); |
| 90 | 92 | void ewidth(const GEnergy& ewidth); |
| 91 | 93 | void ontime(const double& ontime); |
| ... | ... | @@ -140,6 +142,21 @@ const int& GCTAEventBin::ipix(void) const |
| 140 | 142 | |
| 141 | 143 | |
| 142 | 144 | /***********************************************************************//** |
| 145 | + * @brief Set the spatial pixel index | |
| 146 | + * | |
| 147 | + * @param[in] ipix Spatial pixel index. | |
| 148 | + * | |
| 149 | + * Sets the spatial index of the event bin in the event cube. | |
| 150 | + ***************************************************************************/ | |
| 151 | +inline | |
| 152 | +void GCTAEventBin::ipix(const int& ipix) | |
| 153 | +{ | |
| 154 | + m_ipix = ipix; | |
| 155 | + return; | |
| 156 | +} | |
| 157 | + | |
| 158 | + | |
| 159 | +/***********************************************************************//** | |
| 143 | 160 | * @brief Return the energy layer index |
| 144 | 161 | * |
| 145 | 162 | * @return Energy layer index. |
| ... | ... | @@ -153,4 +170,19 @@ const int& GCTAEventBin::ieng(void) const |
| 153 | 170 | return (m_ieng); |
| 154 | 171 | } |
| 155 | 172 | |
| 173 | + | |
| 174 | +/***********************************************************************//** | |
| 175 | + * @brief Set the energy layer index | |
| 176 | + * | |
| 177 | + * @param[in] ieng Energy layer index. | |
| 178 | + * | |
| 179 | + * Sets the energy layer of the event bin in the event cube. | |
| 180 | + ***************************************************************************/ | |
| 181 | +inline | |
| 182 | +void GCTAEventBin::ieng(const int& ieng) | |
| 183 | +{ | |
| 184 | + m_ieng = ieng; | |
| 185 | + return; | |
| 186 | +} | |
| 187 | + | |
| 156 | 188 | #endif /* GCTAEVENTBIN_HPP */ | ... | ... |
inst/cta/pyext/GCTAEventBin.i
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GCTAEventBin.i - CTA event bin class * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2011-2016 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2011-2017 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -67,6 +67,8 @@ public: |
| 67 | 67 | void dir(const GCTAInstDir& dir); |
| 68 | 68 | void energy(const GEnergy& energy); |
| 69 | 69 | void time(const GTime& time); |
| 70 | + void ipix(const int& ipix); | |
| 71 | + void ieng(const int& ieng); | |
| 70 | 72 | void solidangle(const double& solidangle); |
| 71 | 73 | void ewidth(const GEnergy& ewidth); |
| 72 | 74 | void ontime(const double& ontime); | ... | ... |
inst/cta/test/test_CTA.cpp
| ... | ... | @@ -1479,6 +1479,8 @@ void TestGCTAObservation::test_event_bin(void) |
| 1479 | 1479 | bin.energy(GEnergy(2.0, "TeV")); |
| 1480 | 1480 | bin.time(GTime(87.3)); |
| 1481 | 1481 | bin.counts(4.0); |
| 1482 | + bin.ipix(5); | |
| 1483 | + bin.ieng(7); | |
| 1482 | 1484 | bin.solidangle(3.14); |
| 1483 | 1485 | bin.ewidth(GEnergy(7.0, "GeV")); |
| 1484 | 1486 | bin.ontime(101.0); |
| ... | ... | @@ -1502,8 +1504,8 @@ void TestGCTAObservation::test_event_bin(void) |
| 1502 | 1504 | test_value(bin.time().secs(), 87.3, 1.0e-10, "Check time() for filled bin"); |
| 1503 | 1505 | test_value(bin.counts(), 4.0, 1.0e-10, "Check counts() for filled bin"); |
| 1504 | 1506 | test_value(bin.error(), 2.0, 1.0e-10, "Check error() for filled bin"); |
| 1505 | - test_value(bin.ipix(), -1, "Check ipix() for filled bin"); | |
| 1506 | - test_value(bin.ieng(), -1, "Check ieng() for filled bin"); | |
| 1507 | + test_value(bin.ipix(), 5, "Check ipix() for filled bin"); | |
| 1508 | + test_value(bin.ieng(), 7, "Check ieng() for filled bin"); | |
| 1507 | 1509 | test_value(bin.solidangle(), 3.14, 1.0e-10, |
| 1508 | 1510 | "Check solidangle() for filled bin"); |
| 1509 | 1511 | test_value(bin.ewidth().GeV(), 7.0, 1.0e-10, |
| ... | ... | @@ -1528,8 +1530,8 @@ void TestGCTAObservation::test_event_bin(void) |
| 1528 | 1530 | test_value(bin2.time().secs(), 87.3, 1.0e-10, "Check time() for copied bin"); |
| 1529 | 1531 | test_value(bin2.counts(), 4.0, 1.0e-10, "Check counts() for copied bin"); |
| 1530 | 1532 | test_value(bin2.error(), 2.0, 1.0e-10, "Check error() for copied bin"); |
| 1531 | - test_value(bin2.ipix(), -1, "Check ipix() for copied bin"); | |
| 1532 | - test_value(bin2.ieng(), -1, "Check ieng() for copied bin"); | |
| 1533 | + test_value(bin2.ipix(), 5, "Check ipix() for copied bin"); | |
| 1534 | + test_value(bin2.ieng(), 7, "Check ieng() for copied bin"); | |
| 1533 | 1535 | test_value(bin2.solidangle(), 3.14, 1.0e-10, |
| 1534 | 1536 | "Check solidangle() for copied bin"); |
| 1535 | 1537 | test_value(bin2.ewidth().GeV(), 7.0, 1.0e-10, |
| ... | ... | @@ -1555,8 +1557,8 @@ void TestGCTAObservation::test_event_bin(void) |
| 1555 | 1557 | "Check time() for assigned bin"); |
| 1556 | 1558 | test_value(bin3.counts(), 4.0, 1.0e-10, "Check counts() for assigned bin"); |
| 1557 | 1559 | test_value(bin3.error(), 2.0, 1.0e-10, "Check error() for assigned bin"); |
| 1558 | - test_value(bin3.ipix(), -1, "Check ipix() for assigned bin"); | |
| 1559 | - test_value(bin3.ieng(), -1, "Check ieng() for assigned bin"); | |
| 1560 | + test_value(bin3.ipix(), 5, "Check ipix() for assigned bin"); | |
| 1561 | + test_value(bin3.ieng(), 7, "Check ieng() for assigned bin"); | |
| 1560 | 1562 | test_value(bin3.solidangle(), 3.14, 1.0e-10, |
| 1561 | 1563 | "Check solidangle() for assigned bin"); |
| 1562 | 1564 | test_value(bin3.ewidth().GeV(), 7.0, 1.0e-10, |
| ... | ... | @@ -1582,8 +1584,8 @@ void TestGCTAObservation::test_event_bin(void) |
| 1582 | 1584 | "Check time() for cloned bin"); |
| 1583 | 1585 | test_value(bin4->counts(), 4.0, 1.0e-10, "Check counts() for cloned bin"); |
| 1584 | 1586 | test_value(bin4->error(), 2.0, 1.0e-10, "Check error() for cloned bin"); |
| 1585 | - test_value(bin4->ipix(), -1, "Check ipix() for cloned bin"); | |
| 1586 | - test_value(bin4->ieng(), -1, "Check ieng() for cloned bin"); | |
| 1587 | + test_value(bin4->ipix(), 5, "Check ipix() for cloned bin"); | |
| 1588 | + test_value(bin4->ieng(), 7, "Check ieng() for cloned bin"); | |
| 1587 | 1589 | test_value(bin4->solidangle(), 3.14, 1.0e-10, |
| 1588 | 1590 | "Check solidangle() for cloned bin"); |
| 1589 | 1591 | test_value(bin4->ewidth().GeV(), 7.0, 1.0e-10, | ... | ... |