Commit 5831f0d510e51461a2fe480f854a687d58129500
1 parent
5a703fb2
Set OBS_ID in ctobssim (#1836)
Showing
5 changed files
with
17 additions
and
2 deletions
ChangeLog
NEWS
| ... | ... | @@ -89,6 +89,9 @@ ctobssim - CTA observation simulation |
| 89 | 89 | Use t-type parameters for "tmin" and "tmax" to all specifying times in various |
| 90 | 90 | formats (#1864). |
| 91 | 91 | |
| 92 | +Set the OBS_ID keyword to the number that is used for creating the FITS file | |
| 93 | +(#1836). | |
| 94 | + | |
| 92 | 95 | |
| 93 | 96 | ctphase - Event phase computation |
| 94 | 97 | --------------------------------- | ... | ... |
doc/source/admin/release_history/1.5.rst
| ... | ... | @@ -54,6 +54,8 @@ Improvements |
| 54 | 54 | Enhance efficiency of computations in :ref:`ctmodel` |
| 55 | 55 | * [`1927 <https://cta-redmine.irap.omp.eu/issues/1927>`_] - |
| 56 | 56 | Add ``NODES`` method to :ref:`csspec` to support non-CTA analysis |
| 57 | +* [`1836 <https://cta-redmine.irap.omp.eu/issues/1836>`_] - | |
| 58 | + Set ``OBS_ID`` in :ref:`ctobssim` | |
| 57 | 59 | |
| 58 | 60 | |
| 59 | 61 | New features | ... | ... |
src/ctbin/ctbin.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * ctbin - Event binning tool * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2010-2017 by Juergen Knoedlseder * | |
| 4 | + * copyright (C) 2010-2018 by Juergen Knoedlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software: you can redistribute it and/or modify * |
| ... | ... | @@ -770,7 +770,6 @@ void ctbin::obs_cube(void) |
| 770 | 770 | |
| 771 | 771 | // Set CTA observation attributes |
| 772 | 772 | obs.pointing(pointing); |
| 773 | - obs.obs_id(0); | |
| 774 | 773 | obs.ra_obj(dir.ra_deg()); //!< Dummy |
| 775 | 774 | obs.dec_obj(dir.dec_deg()); //!< Dummy |
| 776 | 775 | obs.ontime(m_ontime); | ... | ... |
src/ctobssim/ctobssim.cpp
| ... | ... | @@ -1676,6 +1676,11 @@ void ctobssim::save_fits(void) |
| 1676 | 1676 | // Get CTA observation from observation container |
| 1677 | 1677 | GCTAObservation* obs = dynamic_cast<GCTAObservation*>(m_obs[0]); |
| 1678 | 1678 | |
| 1679 | + // Store OBS_ID | |
| 1680 | + char buffer[256]; | |
| 1681 | + std::sprintf(buffer, "%6.6d", m_startindex); | |
| 1682 | + obs->id(std::string(buffer)); | |
| 1683 | + | |
| 1679 | 1684 | // Log filename |
| 1680 | 1685 | log_value(NORMAL, "Event list file", m_outevents); |
| 1681 | 1686 | |
| ... | ... | @@ -1728,6 +1733,11 @@ void ctobssim::save_xml(void) |
| 1728 | 1733 | // Store output file name in observation |
| 1729 | 1734 | obs->eventfile(outfile); |
| 1730 | 1735 | |
| 1736 | + // Store OBS_ID | |
| 1737 | + char buffer[256]; | |
| 1738 | + std::sprintf(buffer, "%6.6d", i + m_startindex); | |
| 1739 | + obs->id(std::string(buffer)); | |
| 1740 | + | |
| 1731 | 1741 | // Log filename |
| 1732 | 1742 | log_value(NORMAL, "Event list file", outfile); |
| 1733 | 1743 | ... | ... |