From 2a1986901b24886939eef19247100c83d41ae30b Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Tue, 30 Jun 2020 17:59:48 +0200 Subject: [PATCH] GSkyProjection::coordsys() method now returns CEL instead of EQU (#1829) --- ChangeLog | 1 + NEWS | 2 ++ doc/source/admin/release_history/1.7.rst | 2 ++ include/GHealpix.hpp | 4 ++-- include/GSkyProjection.hpp | 4 ++-- src/sky/GException_sky.cpp | 4 ++-- src/sky/GHealpix.cpp | 6 +++--- src/sky/GSkyProjection.cpp | 8 ++++---- src/sky/GWcs.cpp | 6 +++--- test/test_GSky.cpp | 16 +--------------- 10 files changed, 22 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 74c123c..aa1e9c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,6 +32,7 @@ Add GSkyDir::moon() method (#1855) Add GSkyDir::sun(), GSkyDir::precess() and GTime::julian_epoch() methods (#1854) + GSkyProjection::coordsys() method now returns CEL instead of EQU (#1829) Remove GModelSpatialDiffuseCube::maps() and GModelSpatialDiffuseCube::pixels() methods (#1761) Implement INTEGRAL/SPI instrument interface (#733, #734, #735, #736, diff --git a/NEWS b/NEWS index d9fb0bf..1be13a4 100644 --- a/NEWS +++ b/NEWS @@ -226,6 +226,8 @@ the Sun for a given date and a specific epoch. To support the method, a GSkyDir::precess() method was added that allows precessing a sky direction to a specific epoch (#1854). +The GSkyProjection::coordsys() method now returns CEL instead of EQU (#1829). + 13. Support module ------------------ diff --git a/doc/source/admin/release_history/1.7.rst b/doc/source/admin/release_history/1.7.rst index 744a0a9..0f474b0 100644 --- a/doc/source/admin/release_history/1.7.rst +++ b/doc/source/admin/release_history/1.7.rst @@ -96,5 +96,7 @@ Clean up Rename ``GModelSpatialDiffuseMap::set_mc_cone()`` to ``GModelSpatialDiffuseMap::mc_cone()`` and add ``mc_cone()``getter methods. * [`2893 `_] - Remove ``GCTAResponseCache::ndirs()``, ``GCTAResponseCache::nerecos()`` and ``GCTAResponseCache::netrues()`` methods. +* [`1829 `_] - + ``GSkyProjection::coordsys()`` method now returns ``CEL`` instead of ``EQU``. * [`1761 `_] - Remove ``GModelSpatialDiffuseCube::maps()`` and ``GModelSpatialDiffuseCube::pixels()`` methods. diff --git a/include/GHealpix.hpp b/include/GHealpix.hpp index 61461ea..92b30eb 100644 --- a/include/GHealpix.hpp +++ b/include/GHealpix.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GHealpix.hpp - Healpix projection class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2020 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -51,7 +51,7 @@ public: GHealpix(void); GHealpix(const int& nside, const std::string& ordering = "NESTED", - const std::string& coordsys = "EQU"); + const std::string& coordsys = "CEL"); explicit GHealpix(const GFitsHDU& hdu); GHealpix(const GHealpix& wcs); virtual ~GHealpix(void); diff --git a/include/GSkyProjection.hpp b/include/GSkyProjection.hpp index 49e8821..3167c6a 100644 --- a/include/GSkyProjection.hpp +++ b/include/GSkyProjection.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GSkyProjection.hpp - Abstract sky projection base class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2014 by Juergen Knoedlseder * + * copyright (C) 2010-2020 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -85,7 +85,7 @@ protected: virtual bool compare(const GSkyProjection& proj) const = 0; // Protected members - int m_coordsys; //!< 0=EQU, 1=GAL + int m_coordsys; //!< 0=CEL, 1=GAL }; #endif /* GSKYPROJECTION_HPP */ diff --git a/src/sky/GException_sky.cpp b/src/sky/GException_sky.cpp index 0bbd881..092638f 100644 --- a/src/sky/GException_sky.cpp +++ b/src/sky/GException_sky.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GException_sky.cpp - sky exception handlers * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Jurgen Knodlseder * + * copyright (C) 2010-2020 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -187,7 +187,7 @@ GException::wcs_bad_coords::wcs_bad_coords(std::string origin, // Set origin and message m_origin = origin; m_message = "Invalid WCS coordinate system ("+coordsys+"). " - "Should be one of EQU/CEL/GAL/ECL/HEL/SGL."; + "Should be one of CEL/GAL/ECL/HEL/SGL."; // Return return; diff --git a/src/sky/GHealpix.cpp b/src/sky/GHealpix.cpp index a909dfc..1c74760 100644 --- a/src/sky/GHealpix.cpp +++ b/src/sky/GHealpix.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GHealpix.cpp - Healpix projection class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2020 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -114,7 +114,7 @@ GHealpix::GHealpix(void) : GSkyProjection() * * @param[in] nside Number of sides. * @param[in] order Pixel ordering ('RING' or 'NESTED'). - * @param[in] coords Coordinate system ('EQU' or 'GAL'). + * @param[in] coords Coordinate system ('CEL' or 'GAL'). * * @exception GException::wcs_hpx_bad_nside * Invalid nside parameter. @@ -370,7 +370,7 @@ void GHealpix::write(GFitsHDU& hdu) const hdu.card("ORDERING", ordering(), "Pixel ordering scheme, either RING or NESTED"); hdu.card("COORDSYS", coordsys(), - "Coordinate system, either EQU or GAL"); + "Coordinate system, either CEL or GAL"); // Return return; diff --git a/src/sky/GSkyProjection.cpp b/src/sky/GSkyProjection.cpp index 680079f..9da5dc0 100644 --- a/src/sky/GSkyProjection.cpp +++ b/src/sky/GSkyProjection.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GSkyProjection.cpp - Abstract sky projection base class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2020 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -141,7 +141,7 @@ GSkyProjection& GSkyProjection::operator= (const GSkyProjection& proj) * @return Coordinate system string. * * Returns one of - * 'EQU' (equatorial), + * 'CEL' (celestial), * 'GAL' (galactic), ***************************************************************************/ std::string GSkyProjection::coordsys(void) const @@ -150,7 +150,7 @@ std::string GSkyProjection::coordsys(void) const std::string s_coordsys; switch (m_coordsys) { case 0: - s_coordsys = "EQU"; + s_coordsys = "CEL"; break; case 1: s_coordsys = "GAL"; @@ -211,7 +211,7 @@ void GSkyProjection::coordsys(const std::string& coordsys) void GSkyProjection::init_members(void) { // Initialise members - m_coordsys = 0; // 0 means EQU + m_coordsys = 0; // 0 means CEL // Return return; diff --git a/src/sky/GWcs.cpp b/src/sky/GWcs.cpp index d676dbe..8218ffd 100644 --- a/src/sky/GWcs.cpp +++ b/src/sky/GWcs.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GWcs.cpp - Abstract world coordinate system base class * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2019 by Juergen Knoedlseder * + * copyright (C) 2011-2020 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -245,12 +245,12 @@ void GWcs::read(const GFitsHDU& hdu) if (xcoord == "RA--" && ycoord == "DEC-") { m_lng = 0; m_lat = 1; - coords = "EQU"; + coords = "CEL"; } else if (xcoord == "DEC-" && ycoord == "RA--") { m_lng = 1; m_lat = 0; - coords = "EQU"; + coords = "CEL"; } else if (xcoord == "GLON" && ycoord == "GLAT") { m_lng = 0; diff --git a/test/test_GSky.cpp b/test/test_GSky.cpp index 1dd3d98..6efca05 100644 --- a/test/test_GSky.cpp +++ b/test/test_GSky.cpp @@ -733,26 +733,12 @@ void TestGSky::test_GSkyMap_healpix_construct(void) test_value(map1.ny(), 0, "Check for no Y-direction map pixels"); test_value(map1.nmaps(), 1, "Check for one sky map"); // - GSkyMap map2("CEL", 1, "RING", 2); + GSkyMap map2("CEL", 1, "NESTED", 2); test_assert(!map2.is_empty(), "Check for non-empty sky map"); test_value(map2.npix(), 12, "Check for 12 sky map pixels"); test_value(map2.nx(), 0, "Check for no X-direction map pixels"); test_value(map2.ny(), 0, "Check for no Y-direction map pixels"); test_value(map2.nmaps(), 2, "Check for one sky map"); - // - GSkyMap map3("EQU", 1, "RING", 1); - test_assert(!map3.is_empty(), "Check for non-empty sky map"); - test_value(map3.npix(), 12, "Check for 12 sky map pixels"); - test_value(map3.nx(), 0, "Check for no X-direction map pixels"); - test_value(map3.ny(), 0, "Check for no Y-direction map pixels"); - test_value(map3.nmaps(), 1, "Check for one sky map"); - // - GSkyMap map4("EQU", 1, "NESTED", 2); - test_assert(!map4.is_empty(), "Check for non-empty sky map"); - test_value(map4.npix(), 12, "Check for 12 sky map pixels"); - test_value(map4.nx(), 0, "Check for no X-direction map pixels"); - test_value(map4.ny(), 0, "Check for no Y-direction map pixels"); - test_value(map4.nmaps(), 2, "Check for one sky map"); // Test Healpix copy constructor GSkyMap ring1cpy = ring1; -- libgit2 0.21.4