From c2675d4fe5c7b3fb3edf5e758dafbcaefad62234 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Wed, 14 Jan 2015 01:23:47 +0100 Subject: [PATCH] Rename some of the base class methods and reduce further some code redundancies (see #1360 for details). --- src/ctbin/ctbin.cpp | 47 ++++++++++------------------------------------- src/ctbkgcube/ctbkgcube.cpp | 40 ++++++++-------------------------------- src/ctbutterfly/ctbutterfly.cpp | 20 ++++++-------------- src/ctexpcube/ctexpcube.cpp | 42 ++++++------------------------------------ src/ctlike/ctlike.cpp | 20 +++++--------------- src/ctmodel/ctmodel.cpp | 49 ++++++++++++++++--------------------------------- src/ctobssim/ctobssim.cpp | 12 +++++------- src/ctpsfcube/ctpsfcube.cpp | 58 ++++++++++++++-------------------------------------------- src/ctselect/ctselect.cpp | 22 ++++++---------------- src/ctskymap/ctskymap.cpp | 37 ++++++------------------------------- src/cttsmap/cttsmap.cpp | 36 +++++------------------------------- src/support/ctool.cpp | 694 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/support/ctool.hpp | 22 +++++++++++++--------- 13 files changed, 409 insertions(+), 690 deletions(-) diff --git a/src/ctbin/ctbin.cpp b/src/ctbin/ctbin.cpp index f676ec2..e017889 100644 --- a/src/ctbin/ctbin.cpp +++ b/src/ctbin/ctbin.cpp @@ -34,7 +34,7 @@ /* __ Method name definitions ____________________________________________ */ #define G_FILL_CUBE "ctbin::fill_cube(GCTAObservation*)" -#define G_GET_PARAMETERS "ctbin::get_parameters()" +#define G_GET_PARAMETERS "ctbin::get_parameters()" /* __ Debug definitions __________________________________________________ */ @@ -386,9 +386,6 @@ void ctbin::free_members(void) /***********************************************************************//** * @brief Get application parameters * - * @exception GException::invalid_value - * Parameter "inobs" is required for ctbin. - * * Get all task parameters from parameter file or (if required) by querying * the user. Most parameters are only required if no observation exists so * far in the observation container. In this case, a single CTA observation @@ -397,47 +394,22 @@ void ctbin::free_members(void) ***************************************************************************/ void ctbin::get_parameters(void) { - // If there are no observations in container then load them via user parameters + // If there are no observations in container then load them via user + // parameters if (m_obs.size() == 0) { - // Throw exception if no infile is given - if ((*this)["inobs"].filename() == "NONE" || - (*this)["inobs"].filename() == "") { - std::string msg = "A valid file needs to be specified for the " - "\"inobs\" parameter, yet \""+ - (*this)["inobs"].filename()+"\" was given." - " Specify a vaild observation definition or " - "event list FITS file to proceed."; - throw GException::invalid_value(G_GET_PARAMETERS, msg); - } + // Throw exception if no input observation file is given + require_inobs(G_GET_PARAMETERS); - // Build observation container without response (not needed) + // Get observation container without response (not needed) m_obs = get_observations(false); } // endif: there was no observation in the container - // Get parameters - m_usepnt = (*this)["usepnt"].boolean(); - - // Initialise event cube - GCTAEventCube cube; - - // Check if pointing should be used - if (m_usepnt) { - - // Build cube from user parameters and pointing information - cube = get_cube(m_obs); + // Create an event cube based on task parameters + GCTAEventCube cube = create_cube(m_obs); - } // endif: pointing used as map center - - else { - - // Build cube from user parameters - cube = get_cube(); - - } // endelse: m_usepnt was false - - // Get the skymap and initialise the pixels + // Get the skymap from the cube and initialise all pixels to zero m_cube = cube.map(); m_cube = 0.0; @@ -454,6 +426,7 @@ void ctbin::get_parameters(void) return; } + /***********************************************************************//** * @brief Fill events into counts cube * diff --git a/src/ctbkgcube/ctbkgcube.cpp b/src/ctbkgcube/ctbkgcube.cpp index f65c473..75d41f2 100644 --- a/src/ctbkgcube/ctbkgcube.cpp +++ b/src/ctbkgcube/ctbkgcube.cpp @@ -510,7 +510,6 @@ void ctbkgcube::free_members(void) * @brief Get application parameters * * @exception GException::invalid_value - * Parameter "inobs" is required for ctbkgcube. * No background model definition XML file specified. * * Get all task parameters from parameter file or (if required) by querying @@ -518,20 +517,12 @@ void ctbkgcube::free_members(void) ***************************************************************************/ void ctbkgcube::get_parameters(void) { - // If there are no observations in container then load them via user parameters + // If there are no observations in container then load them via user + // parameters if (m_obs.size() == 0) { - // Throw exception if no infile is given, since this tool needs an observation - // including events - if ((*this)["inobs"].filename() == "NONE" || - (*this)["inobs"].filename() == "") { - std::string msg = "A valid file needs to be specified for the " - "\"inobs\" parameter, yet \""+ - (*this)["inobs"].filename()+"\" was given." - " Specify a vaild observation definition or " - "event list FITS file to proceed."; - throw GException::invalid_value(G_GET_PARAMETERS, msg); - } + // Throw exception if no input observation file is given + require_inobs(G_GET_PARAMETERS); // Build observation container m_obs = get_observations(); @@ -561,31 +552,16 @@ void ctbkgcube::get_parameters(void) if ((gammalib::toupper(incube) == "NONE") || (gammalib::strip_whitespace(incube) == "")) { - // Check for usepnt flag - bool usepnt = (*this)["usepnt"].boolean(); - - // Check if pointing should be used - if (usepnt) { - - // build cube from user parameters and pointing information - m_bkgcube = get_cube(m_obs); - - } // endif: pointing used as map center - - else { - - // Build cube from user parameters - m_bkgcube = get_cube(); - - } // endelse: m_usepnt was false + // Create an event cube based on task parameters + m_bkgcube = create_cube(m_obs); } // endif: filename was not valid // ... otherwise setup the background cube from the counts map else { - // Set background cube from counts map - m_bkgcube = set_from_cntmap(incube); + // Load event cube from filename + m_bkgcube.load(incube); } // endelse: cube was loaded from file diff --git a/src/ctbutterfly/ctbutterfly.cpp b/src/ctbutterfly/ctbutterfly.cpp index 501a544..396aaa3 100644 --- a/src/ctbutterfly/ctbutterfly.cpp +++ b/src/ctbutterfly/ctbutterfly.cpp @@ -453,7 +453,6 @@ void ctbutterfly::free_members(void) * @brief Get application parameters * * @exception GException::invalid_value - * Parameter "inobs" is required for ctbutterfly. * Test source not found or no RA/DEC parameters found for test * source. * @@ -465,19 +464,12 @@ void ctbutterfly::free_members(void) ***************************************************************************/ void ctbutterfly::get_parameters(void) { - // If there are no observations in container then load them via user parameters + // If there are no observations in container then load them via user + // parameters if (m_obs.size() == 0) { - // Throw exception if no infile is given - if ((*this)["inobs"].filename() == "NONE" || - (*this)["inobs"].filename() == "") { - std::string msg = "A valid file needs to be specified for the " - "\"inobs\" parameter, yet \""+ - (*this)["inobs"].filename()+"\" was given." - " Specify a vaild observation definition or " - "event list FITS file to proceed."; - throw GException::invalid_value(G_GET_PARAMETERS, msg); - } + // Throw exception if no input observation file is given + require_inobs(G_GET_PARAMETERS); // Build observation container m_obs = get_observations(); @@ -506,8 +498,8 @@ void ctbutterfly::get_parameters(void) throw GException::invalid_value(G_GET_PARAMETERS, msg); } - // Get energy binning information - m_ebounds = get_ebounds(); + // Create energy boundaries from user parameters + m_ebounds = create_ebounds(); // Get matrix file name and load if possible std::string matrixfilename = (*this)["matrix"].filename(); diff --git a/src/ctexpcube/ctexpcube.cpp b/src/ctexpcube/ctexpcube.cpp index 521714a..fa4c134 100644 --- a/src/ctexpcube/ctexpcube.cpp +++ b/src/ctexpcube/ctexpcube.cpp @@ -350,13 +350,9 @@ void ctexpcube::free_members(void) /***********************************************************************//** * @brief Get application parameters - * @exception GException::invalid_value - * Parameter "inobs" is required for ctexpcube. * * Get all task parameters from parameter file or (if required) by querying * the user. The parameters are read in the correct order. - * - * @todo Setup exposure cube from counts map ***************************************************************************/ void ctexpcube::get_parameters(void) { @@ -364,16 +360,8 @@ void ctexpcube::get_parameters(void) // parameters if (m_obs.size() == 0) { - // Throw exception if no infile is given - if ((*this)["inobs"].filename() == "NONE" || - (*this)["inobs"].filename() == "") { - std::string msg = "A valid file needs to be specified for the " - "\"inobs\" parameter, yet \""+ - (*this)["inobs"].filename()+"\" was given." - " Specify a vaild observation definition or " - "event list FITS file to proceed."; - throw GException::invalid_value(G_GET_PARAMETERS, msg); - } + // Throw exception if no input observation file is given + require_inobs(G_GET_PARAMETERS); // Build observation container m_obs = get_observations(); @@ -388,27 +376,9 @@ void ctexpcube::get_parameters(void) // Check for filename validity if ((incube == "NONE") || (gammalib::strip_whitespace(incube) == "")) { - - // Initialise event cube - GCTAEventCube cube; - - // Check for usepnt flag - bool usepnt = (*this)["usepnt"].boolean(); - - // Check if pointing should be used - if (usepnt) { - - // build cube from user parameters and pointing information - cube = get_cube(m_obs); - - } // endif: pointing used as map center - - else { - - // Build cube from user parameters - cube = get_cube(); - } // endelse: m_usepnt was false + // Create an event cube based on task parameters + GCTAEventCube cube = create_cube(m_obs); // Define exposure cube m_expcube = GCTAExposure(cube); @@ -418,8 +388,8 @@ void ctexpcube::get_parameters(void) // ... otherwise setup the exposure cube from the counts map else { - // Set exposure cube from counts map - GCTAEventCube cube = set_from_cntmap(incube); + // Load event cube from filename + GCTAEventCube cube(incube); // Define exposure cube m_expcube = GCTAExposure(cube); diff --git a/src/ctlike/ctlike.cpp b/src/ctlike/ctlike.cpp index 91617e9..5766de3 100644 --- a/src/ctlike/ctlike.cpp +++ b/src/ctlike/ctlike.cpp @@ -341,9 +341,6 @@ void ctlike::save(void) /***********************************************************************//** * @brief Get application parameters * - * @exception GException::invalid_value - * Parameter "inobs" is required for ctlike. - * * Get all required task parameters from the parameter file or (if specified) * by querying the user. Observation dependent parameters will only be read * if the observation container is actually empty. Observation dependent @@ -360,21 +357,14 @@ void ctlike::save(void) ***************************************************************************/ void ctlike::get_parameters(void) { - // If there are no observations in container then load them via user parameters + // If there are no observations in container then load them via user + // parameters if (m_obs.size() == 0) { - // Throw exception if no infile is given - if ((*this)["inobs"].filename() == "NONE" || - (*this)["inobs"].filename() == "") { - std::string msg = "A valid file needs to be specified for the " - "\"inobs\" parameter, yet \""+ - (*this)["inobs"].filename()+"\" was given." - " Specify a vaild observation definition or " - "event list FITS file to proceed."; - throw GException::invalid_value(G_GET_PARAMETERS, msg); - } + // Throw exception if no input observation file is given + require_inobs(G_GET_PARAMETERS); - // Build observation container + // Get observation container m_obs = get_observations(); } // endif: there was no observation in the container diff --git a/src/ctmodel/ctmodel.cpp b/src/ctmodel/ctmodel.cpp index c02316c..2532cba 100644 --- a/src/ctmodel/ctmodel.cpp +++ b/src/ctmodel/ctmodel.cpp @@ -33,6 +33,7 @@ #include "GTools.hpp" /* __ Method name definitions ____________________________________________ */ +#define G_GET_PARAMETERS "ctmodel::get_parameters()" /* __ Debug definitions __________________________________________________ */ @@ -411,13 +412,11 @@ void ctmodel::free_members(void) ***************************************************************************/ void ctmodel::get_parameters(void) { - // If there are no observations in container then load them via user parameters - if (m_obs.size() == 0) { - - // Build observation container - m_obs = get_observations(); - - } // endif: there was no observation in the container + // If there are no observations in container then load them via user + // parameters + if (m_obs.size() == 0) { + m_obs = get_observations(); + } // Read model definition file if required if (m_obs.models().size() == 0) { @@ -441,34 +440,18 @@ void ctmodel::get_parameters(void) // Read cube definition file std::string incube = (*this)["incube"].filename(); - // If no cube file has been specified then read all parameters that - // are necessary to create the cube from scratch (see method ctool::get_cube()) - if ((incube == "NONE") || (gammalib::strip_whitespace(incube) == "")) { - - // Get parameters - bool usepnt = (*this)["usepnt"].boolean(); - - // Initialise event cube - GCTAEventCube cube; - - // Check if pointing should be used - if (usepnt) { - - // buld cube from user parameters and pointing information - m_cube = get_cube(m_obs); - - } // endif: pointing used as map center - - else { - - // Build cube from user parameters - m_cube = get_cube(); - - } // endelse: m_usepnt was false + // If no cube file has been specified then create a cube from + // the task parameters ... + if ((incube == "NONE") || + (gammalib::strip_whitespace(incube) == "")) { + + // Create cube from scratch + m_cube = create_cube(m_obs); - } // endif: incube file was not vaild + } - // ... else: build map information from file + // ... otherwise load the cube from file and reset all bins + // to zero else { // Load cube from given file diff --git a/src/ctobssim/ctobssim.cpp b/src/ctobssim/ctobssim.cpp index ff22ffb..6a44f21 100644 --- a/src/ctobssim/ctobssim.cpp +++ b/src/ctobssim/ctobssim.cpp @@ -559,13 +559,11 @@ void ctobssim::free_members(void) ***************************************************************************/ void ctobssim::get_parameters(void) { - // If there are no observations in container then load them via user parameters + // If there are no observations in container then load them via user + // parameters if (m_obs.size() == 0) { - - // Build observation container - m_obs = get_observations(); - - } // endif: there was no observation in the container + m_obs = get_observations(); + } // Read model definition file if required if (m_obs.models().size() == 0) { @@ -581,7 +579,7 @@ void ctobssim::get_parameters(void) // dumped into the log file if (read_ahead()) { m_outevents = (*this)["outevents"].filename(); - m_prefix = (*this)["prefix"].string(); + m_prefix = (*this)["prefix"].string(); } // Initialise random number generators. We initialise here one random diff --git a/src/ctpsfcube/ctpsfcube.cpp b/src/ctpsfcube/ctpsfcube.cpp index 3f31154..0e88fe4 100644 --- a/src/ctpsfcube/ctpsfcube.cpp +++ b/src/ctpsfcube/ctpsfcube.cpp @@ -341,29 +341,17 @@ void ctpsfcube::free_members(void) /***********************************************************************//** * @brief Get application parameters * - * @exception GException::invalid_value - * Parameter "inobs" is required for ctbin. - * * Get all task parameters from parameter file or (if required) by querying * the user. The parameters are read in the correct order. - * - * @todo Setup PSF cube from counts map ***************************************************************************/ void ctpsfcube::get_parameters(void) { - // If there are no observations in container then load them via user parameters + // If there are no observations in container then load them via user + // parameters if (m_obs.size() == 0) { - // Throw exception if no infile is given - if ((*this)["inobs"].filename() == "NONE" || - (*this)["inobs"].filename() == "") { - std::string msg = "A valid file needs to be specified for the " - "\"inobs\" parameter, yet \""+ - (*this)["inobs"].filename()+"\" was given." - " Specify a vaild observation definition or " - "event list FITS file to proceed."; - throw GException::invalid_value(G_GET_PARAMETERS, msg); - } + // Throw exception if no input observation file is given + require_inobs(G_GET_PARAMETERS); // Build observation container m_obs = get_observations(); @@ -374,46 +362,28 @@ void ctpsfcube::get_parameters(void) std::string incube = (*this)["incube"].filename(); // Get additional binning parameters - double dmax = (*this)["amax"].real(); - int ndbins = (*this)["anumbins"].integer(); + double amax = (*this)["amax"].real(); + int anumbins = (*this)["anumbins"].integer(); // Check for filename validity if ((incube == "NONE") || (gammalib::strip_whitespace(incube) == "")) { - // Get parameters - bool usepnt = (*this)["usepnt"].boolean(); - - // Initialise event cube - GCTAEventCube cube; - - // Check if pointing should be used - if (usepnt) { - - // Build cube from user parameters and pointing information - cube = get_cube(m_obs); - - } // endif: pointing used as map center - - else { - - // Build cube from user parameters - cube = get_cube(); - - } // endelse: m_usepnt was false + // Create an event cube based on task parameters + GCTAEventCube cube = create_cube(m_obs); - // Define psf cube - m_psfcube = GCTAMeanPsf(cube, dmax, ndbins); + // Define psf cube + m_psfcube = GCTAMeanPsf(cube, amax, anumbins); } // ... otherwise setup the exposure cube from the counts map else { - // Set exposure cube from counts map - GCTAEventCube cube = set_from_cntmap(incube); + // Load event cube from filename + GCTAEventCube cube(incube); - // Define psf cube - m_psfcube = GCTAMeanPsf(cube, dmax, ndbins); + // Define psf cube + m_psfcube = GCTAMeanPsf(cube, amax, anumbins); } // endelse: cube loaded from file diff --git a/src/ctselect/ctselect.cpp b/src/ctselect/ctselect.cpp index dd4d016..08646be 100644 --- a/src/ctselect/ctselect.cpp +++ b/src/ctselect/ctselect.cpp @@ -456,10 +456,7 @@ void ctselect::free_members(void) /***********************************************************************//** * @brief Get application parameters * - * @exception GException::invalid_value - * Parameter "inobs" is required for ctselect. - * - * Get all task parameters from parameter file or (if required) by querying + * Get all user parameters from parameter file or (if required) by querying * the user. Times are assumed to be in the native CTA MJD format. * * This method also loads observations if no observations are yet allocated. @@ -468,21 +465,14 @@ void ctselect::free_members(void) ***************************************************************************/ void ctselect::get_parameters(void) { - // If there are no observations in container then load them via user parameters + // If there are no observations in container then load them via user + // parameters if (m_obs.size() == 0) { - // Throw exception if no infile is given - if ((*this)["inobs"].filename() == "NONE" || - (*this)["inobs"].filename() == "") { - std::string msg = "A valid file needs to be specified for the " - "\"inobs\" parameter, yet \""+ - (*this)["inobs"].filename()+"\" was given." - " Specify a vaild observation definition or " - "event list FITS file to proceed."; - throw GException::invalid_value(G_GET_PARAMETERS, msg); - } + // Throw exception if no input observation file is given + require_inobs(G_GET_PARAMETERS); - // Build observation container without response (not needed) + // Get observation container without response (not needed) m_obs = get_observations(false); } // endif: there was no observation in the container diff --git a/src/ctskymap/ctskymap.cpp b/src/ctskymap/ctskymap.cpp index a07bda9..69bd7d2 100644 --- a/src/ctskymap/ctskymap.cpp +++ b/src/ctskymap/ctskymap.cpp @@ -319,9 +319,6 @@ void ctskymap::save(void) /***********************************************************************//** * @brief Get application parameters * - * @exception GException::invalid_value - * Parameter "inobs" is required for ctskymap. - * * Get all task parameters from parameter file or (if required) by querying * the user. Most parameters are only required if no observation exists so * far in the observation container. In this case, a single CTA observation @@ -334,39 +331,16 @@ void ctskymap::get_parameters(void) // parameters if (m_obs.size() == 0) { - // Throw exception if no infile is given - if ((*this)["inobs"].filename() == "NONE" || - (*this)["inobs"].filename() == "") { - std::string msg = "A valid file needs to be specified for the " - "\"inobs\" parameter, yet \""+ - (*this)["inobs"].filename()+"\" was given." - " Specify a vaild observation definition or " - "event list FITS file to proceed."; - throw GException::invalid_value(G_GET_PARAMETERS, msg); - } + // Throw exception if no input observation file is given + require_inobs(G_GET_PARAMETERS); - // Build observation container without response (not needed) + // Get observation container without response (not needed) m_obs = get_observations(false); } // endif: there was no observation in the container - // Get parameters - bool usepnt = (*this)["usepnt"].boolean(); - - // Check if pointing should be used - if (usepnt) { - - // buld map from user parameters and pointing information - m_skymap = get_map(m_obs); - - } // endif: pointing used as map center - - else { - - // Build cube from user parameters - m_skymap = get_map(); - - } // endelse: m_usepnt was false + // Create sky map based on task parameters + m_skymap = create_map(m_obs); // Get remaining parameters m_emin = (*this)["emin"].real(); @@ -381,6 +355,7 @@ void ctskymap::get_parameters(void) return; } + /***********************************************************************//** * @brief Map events into a sky map * diff --git a/src/cttsmap/cttsmap.cpp b/src/cttsmap/cttsmap.cpp index 8b55e24..4a17dc4 100644 --- a/src/cttsmap/cttsmap.cpp +++ b/src/cttsmap/cttsmap.cpp @@ -470,9 +470,6 @@ void cttsmap::free_members(void) /***********************************************************************//** * @brief Get application parameters * - * @exception GException::invalid_value - * Parameter "inobs" is required for cttsmap. - * * @exception GException::invalid_value * Test source not found or no RA/DEC parameters found for test * source. @@ -489,18 +486,10 @@ void cttsmap::get_parameters(void) // parameters if (m_obs.size() == 0) { - // Throw exception if no infile is given - if ((*this)["inobs"].filename() == "NONE" || - (*this)["inobs"].filename() == "") { - std::string msg = "A valid file needs to be specified for the " - "\"inobs\" parameter, yet \""+ - (*this)["inobs"].filename()+"\" was given." - " Specify a vaild observation definition or " - "event list FITS file to proceed."; - throw GException::invalid_value(G_GET_PARAMETERS, msg); - } + // Throw exception if no input observation file is given + require_inobs(G_GET_PARAMETERS); - // Build observation container + // Get observation container m_obs = get_observations(); } // endif: there was no observation in the container @@ -547,23 +536,8 @@ void cttsmap::get_parameters(void) (*m_testsource)["DEC"].fix(); } - // Get sky map binning from user parameters and check if pointing - // should be used - GSkymap map; - bool usepnt = (*this)["usepnt"].boolean(); - if (usepnt) { - - // Build cube from user parameters and pointing information - map = get_map(m_obs); - - } // endif: pointing used as map center - - else { - - // Build cube from user parameters - map = get_map(); - - } // endelse: m_usepnt was false + // Create sky map based on task parameters + GSkymap map = create_map(m_obs); // Initialise maps from user parameters init_maps(map); diff --git a/src/support/ctool.cpp b/src/support/ctool.cpp index 5c20de9..c4b211b 100644 --- a/src/support/ctool.cpp +++ b/src/support/ctool.cpp @@ -47,10 +47,8 @@ /* __ Method name definitions ____________________________________________ */ -#define G_GET_EBOUNDS "ctool::get_ebounds()" -#define G_SET_FROM_CNTMAP "ctool::set_from_cntmap(std::string&)" #define G_GET_MEAN_POINTING "ctool::get_mean_pointing(GObservations&)" -#define G_GET_CUBE "ctool::get_cube(GObservations&)" +#define G_CREATE_EBOUNDS "ctool::create_ebounds()" /* __ Debug definitions __________________________________________________ */ @@ -277,255 +275,6 @@ void ctool::free_members(void) /***********************************************************************//** - * @brief Build a CTA observation with an empty event list - * - * Creates an empty CTA observation from user parameters. An empty event list - * including RoI, GTI and energy boundary information is attached to the - * observation. The method also sets the pointing direction using the ra and - * dec parameter, the ROI based on ra, dec and rad, a single GTI based on - * tmin and tmax, and a single energy boundary based on emin and emax. The - * method furthermore sets the ontime, livetime and deadtime correction - * factor. - * - * The following parameters are read: - * ra - Right Ascension of pointing and RoI centre (deg) - * dec - Declination of pointing and RoI centre (deg) - * rad - Radius of RoI (deg) - * deadc - Deadtime correction factor - * tmin - Start time - * tmax - Stop time - * emin - Minimum energy (TeV) - * emax - Maximum energy (TeV) - ***************************************************************************/ -GCTAObservation ctool::setup_obs(void) -{ - // Get CTA observation parameters - double ra = (*this)["ra"].real(); - double dec = (*this)["dec"].real(); - double rad = (*this)["rad"].real(); - double deadc = (*this)["deadc"].real(); - double t_min = (*this)["tmin"].real(); - double t_max = (*this)["tmax"].real(); - double e_min = (*this)["emin"].real(); - double e_max = (*this)["emax"].real(); - - // Allocate CTA observation and empty event list - GCTAObservation obs; - GCTAEventList list; - - // Set pointing direction - GCTAPointing pnt; - GSkyDir skydir; - skydir.radec_deg(ra, dec); - pnt.dir(skydir); - - // Set ROI - GCTAInstDir instdir(skydir); - GCTARoi roi(instdir, rad); - - // Set GTI - GGti gti(m_cta_ref); - GTime tstart; - GTime tstop; - tstart.set(t_min, m_cta_ref); - tstop.set(t_max, m_cta_ref); - gti.append(tstart, tstop); - - // Set energy boundaries - GEbounds ebounds; - GEnergy emin; - GEnergy emax; - emin.TeV(e_min); - emax.TeV(e_max); - ebounds.append(emin, emax); - - // Set CTA event list attributes - list.roi(roi); - list.gti(gti); - list.ebounds(ebounds); - - // Attach event list to CTA observation - obs.events(list); - - // Set observation ontime, livetime and deadtime correction factor - obs.pointing(pnt); - obs.ontime(gti.ontime()); - obs.livetime(gti.ontime()*deadc); - obs.deadc(deadc); - - // Return CTA observation - return obs; - -} - - -/***********************************************************************//** - * @brief Build a skymap based on user parameters - * - * Creates an empty skymap from input user parameters. - * - * The following parameters are read: - * proj - Coordinate projection - * coordsys - Coordinate system - * binsz - Bin size (deg) - * nxpix - Number of pixels in Right Ascension or longitude - * nypix - Number of pixels in Declination or latitude - ***************************************************************************/ -GSkymap ctool::get_map() -{ - // Read task parameters - double xref = (*this)["xref"].real(); - double yref = (*this)["yref"].real(); - std::string proj = (*this)["proj"].string(); - std::string coordsys = (*this)["coordsys"].string(); - double binsz = (*this)["binsz"].real(); - int nxpix = (*this)["nxpix"].integer(); - int nypix = (*this)["nypix"].integer(); - - // Initialise sky map - GSkymap map = GSkymap(proj, coordsys, xref, yref, -binsz, binsz, - nxpix, nypix, 1); - - // Return sky map - return map; -} - - -/***********************************************************************//** - * @brief Build a skymap based on user parameters - * - * @param[in] obs Observation container. - * - * Creates an empty skymap from input user parameters. The reference - * coordinate is extracted from the mean pointing of the CTA observations - * in the observation container (see get_mean_pointing()). - * - * The following parameters are read: - * proj - Coordinate projection - * coordsys - Coordinate system - * binsz - Bin size (deg) - * nxpix - Number of pixels in Right Ascension or longitude - * nypix - Number of pixels in Declination or latitude - ***************************************************************************/ -GSkymap ctool::get_map(const GObservations& obs) -{ - // Read task parameters - std::string proj = (*this)["proj"].string(); - std::string coordsys = (*this)["coordsys"].string(); - double binsz = (*this)["binsz"].real(); - int nxpix = (*this)["nxpix"].integer(); - int nypix = (*this)["nypix"].integer(); - - // Initialise reference coordinates - double xref = 0.0; - double yref = 0.0; - - // Get pointing from observations - GSkyDir pnt = get_mean_pointing(obs); - - // Use correct coordinate system - if (gammalib::toupper(coordsys) == "GAL") { - xref = pnt.l_deg(); - yref = pnt.b_deg(); - } - else { - xref = pnt.ra_deg(); - yref = pnt.dec_deg(); - } - - // Initialise sky map - GSkymap map = GSkymap(proj, coordsys, xref, yref, -binsz, binsz, - nxpix, nypix, 1); - - // Return sky map - return map; -} - - -/***********************************************************************//** - * @brief Get the energy boundaries - * - * @exception GException::invalid_value - * No valid energy boundary extension found. - * - * Get the energy boundaries according to the user parameters. The method - * supports loading of energy boundary information from the EBOUNDS or - * ENERGYBINS extension, or setting energy boundaries using a linear - * or logarithmical spacing. - * - * The following parameters are read: - * ebinalg - Energy binning algorithm - * emin - Minimum energy (if ebinalg != FILE) - * emax - Maximum energy (if ebinalg != FILE) - * enumbins - Number of energy bins (if ebinalg != FILE) - ***************************************************************************/ -GEbounds ctool::get_ebounds(void) -{ - // Allocate energy boundaries - GEbounds ebounds; - - // Get energy binning algorithm - std::string ebinalg = (*this)["ebinalg"].string(); - - // If energy binning algorithm is of type "FILE" (case sensitive), then - // read energy boundaries from FITS file ... - if (ebinalg == "FILE") { - - // Get filename - std::string ebinfile = (*this)["ebinfile"].filename(); - - // Open energy boundary file using the EBOUNDS or ENERGYBINS - // extension. Throw an exception if opening fails. - GFits file(ebinfile); - if (file.contains("EBOUNDS")) { - file.close(); - ebounds.load(ebinfile,"EBOUNDS"); - } - else if (file.contains("ENERGYBINS")) { - file.close(); - ebounds.load(ebinfile,"ENERGYBINS"); - } - else { - file.close(); - std::string msg = "No extension with name \"EBOUNDS\" or" - " \"ENERGYBINS\" found in FITS file" - " \""+ebinfile+"\".\n" - "An \"EBOUNDS\" or \"ENERGYBINS\" extension" - " is required if the parameter \"ebinalg\"" - " is set to \"FILE\"."; - throw GException::invalid_value(G_GET_EBOUNDS, msg); - } - - } // endif: ebinalg was "FILE" - - // ... otherwise use a linear or a logarithmically-spaced energy binning - else { - - // Get task parameters - double emin = (*this)["emin"].real(); - double emax = (*this)["emax"].real(); - int enumbins = (*this)["enumbins"].integer(); - - // Initialise log mode for ebinning - bool log = true; - - // Check if algorithm is linear - if (ebinalg == "LIN") { - log = false; - } - - // Setup energy bins - ebounds = GEbounds(enumbins, GEnergy(emin, "TeV"), - GEnergy(emax, "TeV"), log); - - } // endelse: ebinalg was not "FILE" - - // Return energy boundaries - return ebounds; -} - - -/***********************************************************************//** * @brief Get observation container * * @param[in] get_response Indicates whether response information should @@ -546,11 +295,10 @@ GObservations ctool::get_observations(const bool& get_response) // If no observation definition file has been specified then read all // parameters that are necessary to create an observation from scratch - // (see method setup_obs) if ((filename == "NONE") || (gammalib::strip_whitespace(filename) == "")) { // Setup a new CTA observation - GCTAObservation cta_obs = setup_obs(); + GCTAObservation cta_obs = create_cta_obs(); // Get response if required if (get_response) { @@ -622,110 +370,152 @@ GObservations ctool::get_observations(const bool& get_response) /***********************************************************************//** - * @brief Derives mean pointing from CTA observations + * @brief Create energy boundaries from user parameters * - * @param[in] obs Observation container. - * @return Pointing direction. + * @exception GException::invalid_value + * No valid energy boundary extension found. * - * Computes the mean pointing direction from all CTA observations in the - * observation container. + * Get the energy boundaries according to the user parameters. The method + * supports loading of energy boundary information from the EBOUNDS or + * ENERGYBINS extension, or setting energy boundaries using a linear + * or logarithmical spacing. * - * @todo This method does not work properly for wrap arounds in Right - * Ascension. It certainly will also lead to bad results near the - * celestial pole. + * The following parameters are read: + * ebinalg - Energy binning algorithm + * emin - Minimum energy (if ebinalg != FILE) + * emax - Maximum energy (if ebinalg != FILE) + * enumbins - Number of energy bins (if ebinalg != FILE) ***************************************************************************/ -GSkyDir ctool::get_mean_pointing(const GObservations& obs) +GEbounds ctool::create_ebounds(void) { - // Initialise values - double xref = 0.0; - double yref = 0.0; - int n_pnt = 0; + // Allocate energy boundaries + GEbounds ebounds; - // Loop over all observations to compute mean pointings - for (int i = 0; i < obs.size(); ++i) { + // Get energy binning algorithm + std::string ebinalg = (*this)["ebinalg"].string(); - // If we have a CTA observation then extract the pointing direction - const GCTAObservation* cta_obs = dynamic_cast(obs[i]); - if (cta_obs != NULL) { + // If energy binning algorithm is of type "FILE" (case sensitive), then + // read energy boundaries from FITS file ... + if (ebinalg == "FILE") { - // Get pointing - const GCTAPointing& pnt = cta_obs->pointing(); + // Get filename + std::string ebinfile = (*this)["ebinfile"].filename(); - // Add to coordinates - xref += pnt.dir().ra_deg(); - yref += pnt.dir().dec_deg(); - n_pnt += 1; + // Open energy boundary file using the EBOUNDS or ENERGYBINS + // extension. Throw an exception if opening fails. + GFits file(ebinfile); + if (file.contains("EBOUNDS")) { + file.close(); + ebounds.load(ebinfile,"EBOUNDS"); + } + else if (file.contains("ENERGYBINS")) { + file.close(); + ebounds.load(ebinfile,"ENERGYBINS"); + } + else { + file.close(); + std::string msg = "No extension with name \"EBOUNDS\" or" + " \"ENERGYBINS\" found in FITS file" + " \""+ebinfile+"\".\n" + "An \"EBOUNDS\" or \"ENERGYBINS\" extension" + " is required if the parameter \"ebinalg\"" + " is set to \"FILE\"."; + throw GException::invalid_value(G_CREATE_EBOUNDS, msg); + } + + } // endif: ebinalg was "FILE" - } // endif: cta observation was valid + // ... otherwise use a linear or a logarithmically-spaced energy binning + else { - } // endfor: loop over all observations + // Get task parameters + double emin = (*this)["emin"].real(); + double emax = (*this)["emax"].real(); + int enumbins = (*this)["enumbins"].integer(); - // Signal if no pointing is found - if (n_pnt < 1) { - std::string msg = "No valid CTA observation has been found in " - "observation list, hence no pointing information " - "could be extracted. Use the \"usepnt=no\" " - "option and specify the pointing explicitly."; - throw GException::invalid_value(G_GET_MEAN_POINTING, msg); - } + // Initialise log mode for ebinning + bool log = true; - // Calculate mean coordinates - double ra = xref / double(n_pnt); - double dec = yref / double(n_pnt); + // Check if algorithm is linear + if (ebinalg == "LIN") { + log = false; + } - // Initialise sky dir - GSkyDir dir = GSkyDir(); - dir.radec_deg(ra,dec); + // Setup energy bins + ebounds = GEbounds(enumbins, GEnergy(emin, "TeV"), + GEnergy(emax, "TeV"), log); - // Return sky direction - return dir; + } // endelse: ebinalg was not "FILE" + + // Return energy boundaries + return ebounds; } /***********************************************************************//** - * @brief Build CTA event cube based on user parameters + * @brief Create a skymap from user parameters + * + * @param[in] obs Observation container. * - * Creates an empty CTA event cube from input user parameters. It appends a - * dummy GTI to the event cube. + * Creates an empty skymap from input user parameters. The reference + * coordinate is extracted from the mean pointing of the CTA observations + * in the observation container (see get_mean_pointing()). * * The following parameters are read: - * xref - Reference in Right Ascension or longitude (deg) - * yref - Reference in Declination or latitude (deg) + * usepnt - Use pointing for reference coordinate? + * xref - Reference in Right Ascension or longitude (if usepnt=no) + * yref - Reference in Declination or latitude (if usepnt=no) * proj - Coordinate projection * coordsys - Coordinate system * binsz - Bin size (deg) * nxpix - Number of pixels in Right Ascension or longitude * nypix - Number of pixels in Declination or latitude - * ebinalg - Energy binning algorithm - * emin - Minimum energy (if ebinalg != FILE) - * emax - Maximum energy (if ebinalg != FILE) - * enumbins - Number of energy bins (if ebinalg != FILE) ***************************************************************************/ -GCTAEventCube ctool::get_cube(void) +GSkymap ctool::create_map(const GObservations& obs) { - // Get skymap - GSkymap map = get_map(); + // Read task parameters + double xref = 0.0; + double yref = 0.0; + bool usepnt = (*this)["usepnt"].boolean(); + if (!usepnt) { + xref = (*this)["xref"].real(); + yref = (*this)["yref"].real(); + } + std::string proj = (*this)["proj"].string(); + std::string coordsys = (*this)["coordsys"].string(); + double binsz = (*this)["binsz"].real(); + int nxpix = (*this)["nxpix"].integer(); + int nypix = (*this)["nypix"].integer(); - // Set energy boundaries - GEbounds ebounds = get_ebounds(); + // If requested, get pointing from observations + if (usepnt) { + + // Get mean pointing + GSkyDir pnt = get_mean_pointing(obs); - // Set dummy GTI that is needed for event cube creation - GGti gti; - gti.append(GTime(0.0), GTime(0.1234)); + // Use correct coordinate system + if (gammalib::toupper(coordsys) == "GAL") { + xref = pnt.l_deg(); + yref = pnt.b_deg(); + } + else { + xref = pnt.ra_deg(); + yref = pnt.dec_deg(); + } - // Extend skymap to the requested number of maps - map.nmaps(ebounds.size()); + } // endif: got mean pointing as reference - // Build event cube from given information - GCTAEventCube cube = GCTAEventCube(map, ebounds, gti); + // Initialise sky map + GSkymap map = GSkymap(proj, coordsys, xref, yref, -binsz, binsz, + nxpix, nypix, 1); - // Return cube - return cube; + // Return sky map + return map; } /***********************************************************************//** - * @brief Build CTA event cube based on user parameters + * @brief Create a CTA event cube from user parameters * * @param[in] obs Observation container. * @@ -746,13 +536,13 @@ GCTAEventCube ctool::get_cube(void) * emax - Maximum energy (if ebinalg != FILE) * enumbins - Number of energy bins (if ebinalg != FILE) ***************************************************************************/ -GCTAEventCube ctool::get_cube(const GObservations& obs) +GCTAEventCube ctool::create_cube(const GObservations& obs) { // Get skymap - GSkymap map = get_map(obs); + GSkymap map = create_map(obs); // Set energy boundaries - GEbounds ebounds = get_ebounds(); + GEbounds ebounds = create_ebounds(); // Set dummy GTI that is needed for event cube creation GGti gti; @@ -770,82 +560,108 @@ GCTAEventCube ctool::get_cube(const GObservations& obs) /***********************************************************************//** - * @brief Get current resident set size (physical memory use) in Bytes + * @brief Create a CTA observation from user parameters * - * @return Physical memory use in Bytes. + * Creates an empty CTA observation from user parameters. An empty event list + * including RoI, GTI and energy boundary information is attached to the + * observation. The method also sets the pointing direction using the ra and + * dec parameter, the ROI based on ra, dec and rad, a single GTI based on + * tmin and tmax, and a single energy boundary based on emin and emax. The + * method furthermore sets the ontime, livetime and deadtime correction + * factor. + * + * The following parameters are read: + * ra - Right Ascension of pointing and RoI centre (deg) + * dec - Declination of pointing and RoI centre (deg) + * rad - Radius of RoI (deg) + * deadc - Deadtime correction factor + * tmin - Start time + * tmax - Stop time + * emin - Minimum energy (TeV) + * emax - Maximum energy (TeV) ***************************************************************************/ -size_t ctool::get_current_rss(void) +GCTAObservation ctool::create_cta_obs(void) { - // Initialize resident set size - size_t rss = 0; + // Get CTA observation parameters + double ra = (*this)["ra"].real(); + double dec = (*this)["dec"].real(); + double rad = (*this)["rad"].real(); + double deadc = (*this)["deadc"].real(); + double t_min = (*this)["tmin"].real(); + double t_max = (*this)["tmax"].real(); + double e_min = (*this)["emin"].real(); + double e_max = (*this)["emax"].real(); - // Determine resident set size (architecture dependent) - // OSX - #if defined(__APPLE__) && defined(__MACH__) - #ifdef MACH_TASK_BASIC_INFO - struct mach_task_basic_info info; - mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT; - if (task_info(mach_task_self( ), MACH_TASK_BASIC_INFO, - (task_info_t)&info, &infoCount) == KERN_SUCCESS) { - rss = (size_t)info.resident_size; - } - #else - struct task_basic_info info; - mach_msg_type_number_t info_count = TASK_BASIC_INFO_COUNT; - if (task_info(mach_task_self(), TASK_BASIC_INFO, - (task_info_t)&info, &info_count) == KERN_SUCCESS) { - rss = (size_t)info.resident_size; - } - #endif - // Linux - #elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__) - FILE* fp = NULL; - if ((fp = fopen( "/proc/self/statm", "r" )) != NULL) { - if (fscanf( fp, "%*s%ld", &rss ) == 1) { - rss *= (size_t)sysconf(_SC_PAGESIZE); - } - fclose(fp); - } - // AIX, BSD, Solaris, and Unknown OS - #else - rss = 0; - #endif + // Allocate CTA observation and empty event list + GCTAObservation obs; + GCTAEventList list; + + // Set pointing direction + GCTAPointing pnt; + GSkyDir skydir; + skydir.radec_deg(ra, dec); + pnt.dir(skydir); + + // Set ROI + GCTAInstDir instdir(skydir); + GCTARoi roi(instdir, rad); + + // Set GTI + GGti gti(m_cta_ref); + GTime tstart; + GTime tstop; + tstart.set(t_min, m_cta_ref); + tstop.set(t_max, m_cta_ref); + gti.append(tstart, tstop); + + // Set energy boundaries + GEbounds ebounds; + GEnergy emin; + GEnergy emax; + emin.TeV(e_min); + emax.TeV(e_max); + ebounds.append(emin, emax); + + // Set CTA event list attributes + list.roi(roi); + list.gti(gti); + list.ebounds(ebounds); + + // Attach event list to CTA observation + obs.events(list); + + // Set observation ontime, livetime and deadtime correction factor + obs.pointing(pnt); + obs.ontime(gti.ontime()); + obs.livetime(gti.ontime()*deadc); + obs.deadc(deadc); + + // Return CTA observation + return obs; - // Return resident set size - return rss; } /***********************************************************************//** - * @brief Get a CTA ebent cube from from file - * - * @param[in] filename FITS file of count cube. + * @brief Throws exception in inobs parameter is not valid * - * @exception GException::invalid_value - * Counts map not of WCS type - * - * Gets an event cube from a FITS file. This function is used in many ctools - * to obtain a skymap definition from an event cube. - * - * @todo Is it necessary to restrict this method to WCS coordinates? + * @param[in] method Method name. ***************************************************************************/ -GCTAEventCube ctool::set_from_cntmap(const std::string filename) +void ctool::require_inobs(const std::string& method) { - // Allocate CTA observation - GCTAEventCube cube; - - // Load counts map in CTA observation - cube.load(filename); - - // Check for valid WCS coordinate system - const GWcs* wcs = dynamic_cast(cube.map().projection()); - if (wcs == NULL) { - std::string msg = "Counts map project is not of WCS type."; - throw GException::invalid_value(G_SET_FROM_CNTMAP, msg); + // Throw exception if no infile is given + if ((*this)["inobs"].filename() == "NONE" || + (*this)["inobs"].filename() == "") { + std::string msg = "A valid file needs to be specified for the " + "\"inobs\" parameter, yet \""+ + (*this)["inobs"].filename()+"\" was given." + " Specify a valid observation definition or " + "FITS file to proceed."; + throw GException::invalid_value(method, msg); } - // Return cube - return cube; + // Return + return; } @@ -921,3 +737,111 @@ void ctool::set_obs_response(GCTAObservation* obs) // Return return; } + + +/***********************************************************************//** + * @brief Derives mean pointing from CTA observations + * + * @param[in] obs Observation container. + * @return Pointing direction. + * + * Computes the mean pointing direction from all CTA observations in the + * observation container. + * + * @todo This method does not work properly for wrap arounds in Right + * Ascension. It certainly will also lead to bad results near the + * celestial pole. + ***************************************************************************/ +GSkyDir ctool::get_mean_pointing(const GObservations& obs) +{ + // Initialise values + double xref = 0.0; + double yref = 0.0; + int n_pnt = 0; + + // Loop over all observations to compute mean pointings + for (int i = 0; i < obs.size(); ++i) { + + // If we have a CTA observation then extract the pointing direction + const GCTAObservation* cta_obs = dynamic_cast(obs[i]); + if (cta_obs != NULL) { + + // Get pointing + const GCTAPointing& pnt = cta_obs->pointing(); + + // Add to coordinates + xref += pnt.dir().ra_deg(); + yref += pnt.dir().dec_deg(); + n_pnt += 1; + + } // endif: cta observation was valid + + } // endfor: loop over all observations + + // Signal if no pointing is found + if (n_pnt < 1) { + std::string msg = "No valid CTA observation has been found in " + "observation list, hence no pointing information " + "could be extracted. Use the \"usepnt=no\" " + "option and specify the pointing explicitly."; + throw GException::invalid_value(G_GET_MEAN_POINTING, msg); + } + + // Calculate mean coordinates + double ra = xref / double(n_pnt); + double dec = yref / double(n_pnt); + + // Initialise sky dir + GSkyDir dir = GSkyDir(); + dir.radec_deg(ra,dec); + + // Return sky direction + return dir; +} + + +/***********************************************************************//** + * @brief Get current resident set size (physical memory use) in Bytes + * + * @return Physical memory use in Bytes. + ***************************************************************************/ +size_t ctool::get_current_rss(void) +{ + // Initialize resident set size + size_t rss = 0; + + // Determine resident set size (architecture dependent) + // OSX + #if defined(__APPLE__) && defined(__MACH__) + #ifdef MACH_TASK_BASIC_INFO + struct mach_task_basic_info info; + mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT; + if (task_info(mach_task_self( ), MACH_TASK_BASIC_INFO, + (task_info_t)&info, &infoCount) == KERN_SUCCESS) { + rss = (size_t)info.resident_size; + } + #else + struct task_basic_info info; + mach_msg_type_number_t info_count = TASK_BASIC_INFO_COUNT; + if (task_info(mach_task_self(), TASK_BASIC_INFO, + (task_info_t)&info, &info_count) == KERN_SUCCESS) { + rss = (size_t)info.resident_size; + } + #endif + // Linux + #elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__) + FILE* fp = NULL; + if ((fp = fopen( "/proc/self/statm", "r" )) != NULL) { + if (fscanf( fp, "%*s%ld", &rss ) == 1) { + rss *= (size_t)sysconf(_SC_PAGESIZE); + } + fclose(fp); + } + // AIX, BSD, Solaris, and Unknown OS + #else + rss = 0; + #endif + + // Return resident set size + return rss; +} diff --git a/src/support/ctool.hpp b/src/support/ctool.hpp index 665e2be..0f9a46c 100644 --- a/src/support/ctool.hpp +++ b/src/support/ctool.hpp @@ -66,18 +66,22 @@ protected: void copy_members(const ctool& app); void free_members(void); const bool& read_ahead(void) const; - GCTAObservation setup_obs(void); - GSkymap get_map(void); - GSkymap get_map(const GObservations& obs); - GEbounds get_ebounds(void); GObservations get_observations(const bool& get_response = true); - GCTAEventCube get_cube(void); - GCTAEventCube get_cube(const GObservations& obs); - GSkyDir get_mean_pointing(const GObservations& obs); - size_t get_current_rss(void); - GCTAEventCube set_from_cntmap(const std::string filename); + + // Protected methods that create objects from user parameters + GEbounds create_ebounds(void); + GSkymap create_map(const GObservations& obs); + GCTAEventCube create_cube(const GObservations& obs); + GCTAObservation create_cta_obs(void); + + // Protected methods that check user parameters + void require_inobs(const std::string& method); + + // Protected support methods void set_response(GObservations& obs); void set_obs_response(GCTAObservation* obs); + GSkyDir get_mean_pointing(const GObservations& obs); + size_t get_current_rss(void); // Protected members bool m_read_ahead; //!< Read ahead parameters -- libgit2 0.21.4