diff --git a/doc/source/users/reference_manual/ctlike.rst b/doc/source/users/reference_manual/ctlike.rst index 82c0f47..dcdcd4e 100644 --- a/doc/source/users/reference_manual/ctlike.rst +++ b/doc/source/users/reference_manual/ctlike.rst @@ -48,13 +48,13 @@ the spatial model parameters can be kept fixed during that computation ctlike generates an output model XML file that contains the values of the best fitting model parameters. For all free parameters, an ``error`` attribute is added that provides the statistical uncertainty in the parameter estimate. -In addition, the entire output of the covariance matrix to a separate file in CSV -format can be queried (parameter ``outcovmat``). The parameter order given in the -file header corresponds to the arrangement of the covariance matrix entries. If computation of the Test Statistics has been requested for a model component, a ``ts`` attribute providing the Test Statistics value is added. The output model can be used as an input model for other ctools. +In addition, the covariance matrix can be saved into a file by specifying a +file name for the ``outcovmat`` parameter. If the file name ends with ``.fits`` +or ``.fit`` a FITS file is written, otherwise a CSV file is written. General parameters @@ -89,7 +89,7 @@ General parameters the maximum likelihood fit. ``(outcovmat = NONE) [string]`` - Output CSV file to store covariance matrix. + Output FITS or CSV file to store covariance matrix. ``(stat = POISSON) [string]`` Fitting statistics (POISSON or GAUSSIAN; only affects binned analysis). diff --git a/src/ctlike/ctlike.cpp b/src/ctlike/ctlike.cpp index 8e796bf..ecde28a 100644 --- a/src/ctlike/ctlike.cpp +++ b/src/ctlike/ctlike.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctlike - Maximum likelihood fitting tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2016 by Juergen Knoedlseder * + * copyright (C) 2010-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -321,8 +321,13 @@ void ctlike::run(void) /***********************************************************************//** * @brief Save results * - * This method saves the fit results into a XML file and a CSV file. If - * the filename parameters are "NONE", the files are not saved. + * This method saves the fit results and the covariance matrix. The fit + * results are written into a XML file while the covariance matrix is written + * into either a FITS or a CSV file, depending on the file type extension + * (an extension of `.fits` or `.fit` produce a FITS file, any other + * extension produces a CSV file). + * + * If the filenames are `NONE` no information is saved. ***************************************************************************/ void ctlike::save(void) { diff --git a/src/ctlike/ctlike.hpp b/src/ctlike/ctlike.hpp index a769741..9793838 100644 --- a/src/ctlike/ctlike.hpp +++ b/src/ctlike/ctlike.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * ctlike - Maximum likelihood fitting tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2016 by Juergen Knoedlseder * + * copyright (C) 2010-2017 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -68,17 +68,17 @@ protected: double reoptimize_lm(void); // User parameters - bool m_refit; //!< Refitting - GFilename m_outmodel; //!< Source model output XML file name - GFilename m_outcovmat; //!< Covariance matrix output CSV file name - bool m_apply_edisp; //!< Apply energy dispersion? - bool m_fix_spat_for_ts; //!< Fix spatial parameters for TS computation? - GChatter m_chatter; //!< Chattiness + bool m_refit; //!< Refitting + GFilename m_outmodel; //!< Source model output XML file name + GFilename m_outcovmat; //!< Covariance matrix output file name + bool m_apply_edisp; //!< Apply energy dispersion? + bool m_fix_spat_for_ts; //!< Fix spatial parameters for TS computation? + GChatter m_chatter; //!< Chattiness // Members - int m_max_iter; //!< Maximum number of iterations - int m_max_stall; //!< Maximum number of stalls - double m_logL; //!< Maximum log likelihood + int m_max_iter; //!< Maximum number of iterations + int m_max_stall; //!< Maximum number of stalls + double m_logL; //!< Maximum log likelihood }; #endif /* CTLIKE_HPP */