diff --git a/src/ctbin/ctbin.cpp b/src/ctbin/ctbin.cpp index bc28262..de35711 100644 --- a/src/ctbin/ctbin.cpp +++ b/src/ctbin/ctbin.cpp @@ -206,9 +206,8 @@ void ctbin::clear(void) ***************************************************************************/ void ctbin::execute(void) { - // Read ahead output filename so that it gets dumped correctly in the - // parameters log - m_outfile = (*this)["outfile"].filename(); + // Signal that some parameters should be read ahead + m_read_ahead = true; // Bin the event data run(); @@ -439,6 +438,12 @@ void ctbin::get_parameters(void) m_nxpix = (*this)["nxpix"].integer(); m_nypix = (*this)["nypix"].integer(); + // Optionally read ahead parameters so that they get correctly + // dumped into the log file + if (m_read_ahead) { + m_outfile = (*this)["outfile"].filename(); + } + // Return return; } @@ -614,7 +619,8 @@ void ctbin::init_members(void) // Initialise protected members m_obs.clear(); m_infiles.clear(); - m_use_xml = false; + m_use_xml = false; + m_read_ahead = false; // Set logger properties log.date(true); @@ -647,9 +653,10 @@ void ctbin::copy_members(const ctbin& app) m_nypix = app.m_nypix; // Copy protected members - m_obs = app.m_obs; - m_infiles = app.m_infiles; - m_use_xml = app.m_use_xml; + m_obs = app.m_obs; + m_infiles = app.m_infiles; + m_use_xml = app.m_use_xml; + m_read_ahead = app.m_read_ahead; // Return return; diff --git a/src/ctbin/ctbin.hpp b/src/ctbin/ctbin.hpp index e057f28..c945890 100644 --- a/src/ctbin/ctbin.hpp +++ b/src/ctbin/ctbin.hpp @@ -80,24 +80,25 @@ protected: const std::string& outfile) const; // User parameters - std::string m_evfile; //!< Input event list or XML file - std::string m_outfile; //!< Output counts map or XML file - std::string m_prefix; //!< Prefix for multiple counts maps - double m_emin; //!< Lower energy - double m_emax; //!< Upper energy - int m_enumbins; //!< Number of energy bins - std::string m_proj; //!< WCS projection - std::string m_coordsys; //!< Coordinate system - double m_xref; //!< Longitude reference coordinate - double m_yref; //!< Latitude reference coordinate - double m_binsz; //!< Pixel size - int m_nxpix; //!< Number of pixels in longitude - int m_nypix; //!< Number of pixels in latitude + std::string m_evfile; //!< Input event list or XML file + std::string m_outfile; //!< Output counts map or XML file + std::string m_prefix; //!< Prefix for multiple counts maps + double m_emin; //!< Lower energy + double m_emax; //!< Upper energy + int m_enumbins; //!< Number of energy bins + std::string m_proj; //!< WCS projection + std::string m_coordsys; //!< Coordinate system + double m_xref; //!< Longitude reference coordinate + double m_yref; //!< Latitude reference coordinate + double m_binsz; //!< Pixel size + int m_nxpix; //!< Number of pixels in longitude + int m_nypix; //!< Number of pixels in latitude // Protected members - GObservations m_obs; //!< Observation container - std::vector m_infiles; //!< Input event filenames - bool m_use_xml; //!< Use XML file instead of FITS file + GObservations m_obs; //!< Observation container + std::vector m_infiles; //!< Input event filenames + bool m_use_xml; //!< Use XML file instead of FITS file + bool m_read_ahead; //!< Read ahead parameters }; #endif /* CTBIN_HPP */