Commit 2a1986901b24886939eef19247100c83d41ae30b

Authored by Jürgen Knödlseder
1 parent a96dc02e

GSkyProjection::coordsys() method now returns CEL instead of EQU (#1829)

ChangeLog
@@ -32,6 +32,7 @@ @@ -32,6 +32,7 @@
32 Add GSkyDir::moon() method (#1855) 32 Add GSkyDir::moon() method (#1855)
33 Add GSkyDir::sun(), GSkyDir::precess() and GTime::julian_epoch() methods 33 Add GSkyDir::sun(), GSkyDir::precess() and GTime::julian_epoch() methods
34 (#1854) 34 (#1854)
  35 + GSkyProjection::coordsys() method now returns CEL instead of EQU (#1829)
35 Remove GModelSpatialDiffuseCube::maps() and 36 Remove GModelSpatialDiffuseCube::maps() and
36 GModelSpatialDiffuseCube::pixels() methods (#1761) 37 GModelSpatialDiffuseCube::pixels() methods (#1761)
37 Implement INTEGRAL/SPI instrument interface (#733, #734, #735, #736, 38 Implement INTEGRAL/SPI instrument interface (#733, #734, #735, #736,
@@ -226,6 +226,8 @@ the Sun for a given date and a specific epoch. To support the method, a @@ -226,6 +226,8 @@ the Sun for a given date and a specific epoch. To support the method, a
226 GSkyDir::precess() method was added that allows precessing a sky direction to 226 GSkyDir::precess() method was added that allows precessing a sky direction to
227 a specific epoch (#1854). 227 a specific epoch (#1854).
228 228
  229 +The GSkyProjection::coordsys() method now returns CEL instead of EQU (#1829).
  230 +
229 231
230 13. Support module 232 13. Support module
231 ------------------ 233 ------------------
doc/source/admin/release_history/1.7.rst
@@ -96,5 +96,7 @@ Clean up @@ -96,5 +96,7 @@ Clean up
96 Rename ``GModelSpatialDiffuseMap::set_mc_cone()`` to ``GModelSpatialDiffuseMap::mc_cone()`` and add ``mc_cone()``getter methods. 96 Rename ``GModelSpatialDiffuseMap::set_mc_cone()`` to ``GModelSpatialDiffuseMap::mc_cone()`` and add ``mc_cone()``getter methods.
97 * [`2893 <https://cta-redmine.irap.omp.eu/issues/2893>`_] - 97 * [`2893 <https://cta-redmine.irap.omp.eu/issues/2893>`_] -
98 Remove ``GCTAResponseCache::ndirs()``, ``GCTAResponseCache::nerecos()`` and ``GCTAResponseCache::netrues()`` methods. 98 Remove ``GCTAResponseCache::ndirs()``, ``GCTAResponseCache::nerecos()`` and ``GCTAResponseCache::netrues()`` methods.
  99 +* [`1829 <https://cta-redmine.irap.omp.eu/issues/1829>`_] -
  100 + ``GSkyProjection::coordsys()`` method now returns ``CEL`` instead of ``EQU``.
99 * [`1761 <https://cta-redmine.irap.omp.eu/issues/1761>`_] - 101 * [`1761 <https://cta-redmine.irap.omp.eu/issues/1761>`_] -
100 Remove ``GModelSpatialDiffuseCube::maps()`` and ``GModelSpatialDiffuseCube::pixels()`` methods. 102 Remove ``GModelSpatialDiffuseCube::maps()`` and ``GModelSpatialDiffuseCube::pixels()`` methods.
include/GHealpix.hpp
1 /*************************************************************************** 1 /***************************************************************************
2 * GHealpix.hpp - Healpix projection class * 2 * GHealpix.hpp - Healpix projection class *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2010-2015 by Juergen Knoedlseder * 4 + * copyright (C) 2010-2020 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -51,7 +51,7 @@ public: @@ -51,7 +51,7 @@ public:
51 GHealpix(void); 51 GHealpix(void);
52 GHealpix(const int& nside, 52 GHealpix(const int& nside,
53 const std::string& ordering = "NESTED", 53 const std::string& ordering = "NESTED",
54 - const std::string& coordsys = "EQU"); 54 + const std::string& coordsys = "CEL");
55 explicit GHealpix(const GFitsHDU& hdu); 55 explicit GHealpix(const GFitsHDU& hdu);
56 GHealpix(const GHealpix& wcs); 56 GHealpix(const GHealpix& wcs);
57 virtual ~GHealpix(void); 57 virtual ~GHealpix(void);
include/GSkyProjection.hpp
1 /*************************************************************************** 1 /***************************************************************************
2 * GSkyProjection.hpp - Abstract sky projection base class * 2 * GSkyProjection.hpp - Abstract sky projection base class *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2010-2014 by Juergen Knoedlseder * 4 + * copyright (C) 2010-2020 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -85,7 +85,7 @@ protected: @@ -85,7 +85,7 @@ protected:
85 virtual bool compare(const GSkyProjection& proj) const = 0; 85 virtual bool compare(const GSkyProjection& proj) const = 0;
86 86
87 // Protected members 87 // Protected members
88 - int m_coordsys; //!< 0=EQU, 1=GAL 88 + int m_coordsys; //!< 0=CEL, 1=GAL
89 }; 89 };
90 90
91 #endif /* GSKYPROJECTION_HPP */ 91 #endif /* GSKYPROJECTION_HPP */
src/sky/GException_sky.cpp
1 /*************************************************************************** 1 /***************************************************************************
2 * GException_sky.cpp - sky exception handlers * 2 * GException_sky.cpp - sky exception handlers *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2010-2015 by Jurgen Knodlseder * 4 + * copyright (C) 2010-2020 by Jurgen Knodlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * 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, @@ -187,7 +187,7 @@ GException::wcs_bad_coords::wcs_bad_coords(std::string origin,
187 // Set origin and message 187 // Set origin and message
188 m_origin = origin; 188 m_origin = origin;
189 m_message = "Invalid WCS coordinate system ("+coordsys+"). " 189 m_message = "Invalid WCS coordinate system ("+coordsys+"). "
190 - "Should be one of EQU/CEL/GAL/ECL/HEL/SGL."; 190 + "Should be one of CEL/GAL/ECL/HEL/SGL.";
191 191
192 // Return 192 // Return
193 return; 193 return;
src/sky/GHealpix.cpp
1 /*************************************************************************** 1 /***************************************************************************
2 * GHealpix.cpp - Healpix projection class * 2 * GHealpix.cpp - Healpix projection class *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2010-2015 by Juergen Knoedlseder * 4 + * copyright (C) 2010-2020 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -114,7 +114,7 @@ GHealpix::GHealpix(void) : GSkyProjection() @@ -114,7 +114,7 @@ GHealpix::GHealpix(void) : GSkyProjection()
114 * 114 *
115 * @param[in] nside Number of sides. 115 * @param[in] nside Number of sides.
116 * @param[in] order Pixel ordering ('RING' or 'NESTED'). 116 * @param[in] order Pixel ordering ('RING' or 'NESTED').
117 - * @param[in] coords Coordinate system ('EQU' or 'GAL'). 117 + * @param[in] coords Coordinate system ('CEL' or 'GAL').
118 * 118 *
119 * @exception GException::wcs_hpx_bad_nside 119 * @exception GException::wcs_hpx_bad_nside
120 * Invalid nside parameter. 120 * Invalid nside parameter.
@@ -370,7 +370,7 @@ void GHealpix::write(GFitsHDU&amp; hdu) const @@ -370,7 +370,7 @@ void GHealpix::write(GFitsHDU&amp; hdu) const
370 hdu.card("ORDERING", ordering(), 370 hdu.card("ORDERING", ordering(),
371 "Pixel ordering scheme, either RING or NESTED"); 371 "Pixel ordering scheme, either RING or NESTED");
372 hdu.card("COORDSYS", coordsys(), 372 hdu.card("COORDSYS", coordsys(),
373 - "Coordinate system, either EQU or GAL"); 373 + "Coordinate system, either CEL or GAL");
374 374
375 // Return 375 // Return
376 return; 376 return;
src/sky/GSkyProjection.cpp
1 /*************************************************************************** 1 /***************************************************************************
2 * GSkyProjection.cpp - Abstract sky projection base class * 2 * GSkyProjection.cpp - Abstract sky projection base class *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2010-2012 by Juergen Knoedlseder * 4 + * copyright (C) 2010-2020 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -141,7 +141,7 @@ GSkyProjection&amp; GSkyProjection::operator= (const GSkyProjection&amp; proj) @@ -141,7 +141,7 @@ GSkyProjection&amp; GSkyProjection::operator= (const GSkyProjection&amp; proj)
141 * @return Coordinate system string. 141 * @return Coordinate system string.
142 * 142 *
143 * Returns one of 143 * Returns one of
144 - * 'EQU' (equatorial), 144 + * 'CEL' (celestial),
145 * 'GAL' (galactic), 145 * 'GAL' (galactic),
146 ***************************************************************************/ 146 ***************************************************************************/
147 std::string GSkyProjection::coordsys(void) const 147 std::string GSkyProjection::coordsys(void) const
@@ -150,7 +150,7 @@ std::string GSkyProjection::coordsys(void) const @@ -150,7 +150,7 @@ std::string GSkyProjection::coordsys(void) const
150 std::string s_coordsys; 150 std::string s_coordsys;
151 switch (m_coordsys) { 151 switch (m_coordsys) {
152 case 0: 152 case 0:
153 - s_coordsys = "EQU"; 153 + s_coordsys = "CEL";
154 break; 154 break;
155 case 1: 155 case 1:
156 s_coordsys = "GAL"; 156 s_coordsys = "GAL";
@@ -211,7 +211,7 @@ void GSkyProjection::coordsys(const std::string&amp; coordsys) @@ -211,7 +211,7 @@ void GSkyProjection::coordsys(const std::string&amp; coordsys)
211 void GSkyProjection::init_members(void) 211 void GSkyProjection::init_members(void)
212 { 212 {
213 // Initialise members 213 // Initialise members
214 - m_coordsys = 0; // 0 means EQU 214 + m_coordsys = 0; // 0 means CEL
215 215
216 // Return 216 // Return
217 return; 217 return;
src/sky/GWcs.cpp
1 /*************************************************************************** 1 /***************************************************************************
2 * GWcs.cpp - Abstract world coordinate system base class * 2 * GWcs.cpp - Abstract world coordinate system base class *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2011-2019 by Juergen Knoedlseder * 4 + * copyright (C) 2011-2020 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -245,12 +245,12 @@ void GWcs::read(const GFitsHDU&amp; hdu) @@ -245,12 +245,12 @@ void GWcs::read(const GFitsHDU&amp; hdu)
245 if (xcoord == "RA--" && ycoord == "DEC-") { 245 if (xcoord == "RA--" && ycoord == "DEC-") {
246 m_lng = 0; 246 m_lng = 0;
247 m_lat = 1; 247 m_lat = 1;
248 - coords = "EQU"; 248 + coords = "CEL";
249 } 249 }
250 else if (xcoord == "DEC-" && ycoord == "RA--") { 250 else if (xcoord == "DEC-" && ycoord == "RA--") {
251 m_lng = 1; 251 m_lng = 1;
252 m_lat = 0; 252 m_lat = 0;
253 - coords = "EQU"; 253 + coords = "CEL";
254 } 254 }
255 else if (xcoord == "GLON" && ycoord == "GLAT") { 255 else if (xcoord == "GLON" && ycoord == "GLAT") {
256 m_lng = 0; 256 m_lng = 0;
test/test_GSky.cpp
@@ -733,26 +733,12 @@ void TestGSky::test_GSkyMap_healpix_construct(void) @@ -733,26 +733,12 @@ void TestGSky::test_GSkyMap_healpix_construct(void)
733 test_value(map1.ny(), 0, "Check for no Y-direction map pixels"); 733 test_value(map1.ny(), 0, "Check for no Y-direction map pixels");
734 test_value(map1.nmaps(), 1, "Check for one sky map"); 734 test_value(map1.nmaps(), 1, "Check for one sky map");
735 // 735 //
736 - GSkyMap map2("CEL", 1, "RING", 2); 736 + GSkyMap map2("CEL", 1, "NESTED", 2);
737 test_assert(!map2.is_empty(), "Check for non-empty sky map"); 737 test_assert(!map2.is_empty(), "Check for non-empty sky map");
738 test_value(map2.npix(), 12, "Check for 12 sky map pixels"); 738 test_value(map2.npix(), 12, "Check for 12 sky map pixels");
739 test_value(map2.nx(), 0, "Check for no X-direction map pixels"); 739 test_value(map2.nx(), 0, "Check for no X-direction map pixels");
740 test_value(map2.ny(), 0, "Check for no Y-direction map pixels"); 740 test_value(map2.ny(), 0, "Check for no Y-direction map pixels");
741 test_value(map2.nmaps(), 2, "Check for one sky map"); 741 test_value(map2.nmaps(), 2, "Check for one sky map");
742 - //  
743 - GSkyMap map3("EQU", 1, "RING", 1);  
744 - test_assert(!map3.is_empty(), "Check for non-empty sky map");  
745 - test_value(map3.npix(), 12, "Check for 12 sky map pixels");  
746 - test_value(map3.nx(), 0, "Check for no X-direction map pixels");  
747 - test_value(map3.ny(), 0, "Check for no Y-direction map pixels");  
748 - test_value(map3.nmaps(), 1, "Check for one sky map");  
749 - //  
750 - GSkyMap map4("EQU", 1, "NESTED", 2);  
751 - test_assert(!map4.is_empty(), "Check for non-empty sky map");  
752 - test_value(map4.npix(), 12, "Check for 12 sky map pixels");  
753 - test_value(map4.nx(), 0, "Check for no X-direction map pixels");  
754 - test_value(map4.ny(), 0, "Check for no Y-direction map pixels");  
755 - test_value(map4.nmaps(), 2, "Check for one sky map");  
756 742
757 // Test Healpix copy constructor 743 // Test Healpix copy constructor
758 GSkyMap ring1cpy = ring1; 744 GSkyMap ring1cpy = ring1;