Commit d149c935a79af494c4725f5648167129dd2d42d4

Authored by Jürgen Knödlseder
1 parent 1ec55e88

Add GSkyDir::GSkyDir(GVector) constructor

@@ -35,6 +35,7 @@ The following methods have been added: @@ -35,6 +35,7 @@ The following methods have been added:
35 - GSkyDir::sun() - Set sky position of Sun 35 - GSkyDir::sun() - Set sky position of Sun
36 - GSkyDir::moon() - Set sky position of Moon 36 - GSkyDir::moon() - Set sky position of Moon
37 - GSkyDir::rotate() - Rotate sky direction (radians variant) 37 - GSkyDir::rotate() - Rotate sky direction (radians variant)
  38 +- GSkyDir::GSkyDir(GVector&) - Sky direction vector constructor
38 - GSkyMap::extract() - Extract section of sky map 39 - GSkyMap::extract() - Extract section of sky map
39 - GModelSpatial::flux() - Extract flux from sky region 40 - GModelSpatial::flux() - Extract flux from sky region
40 - GCTAObservation::remove_response_cache(string&) - Remove response cache for model 41 - GCTAObservation::remove_response_cache(string&) - Remove response cache for model
include/GSkyDir.hpp
@@ -68,6 +68,7 @@ class GSkyDir : public GBase { @@ -68,6 +68,7 @@ class GSkyDir : public GBase {
68 public: 68 public:
69 // Constructors and destructors 69 // Constructors and destructors
70 GSkyDir(void); 70 GSkyDir(void);
  71 + explicit GSkyDir(const GVector& vector);
71 GSkyDir(const GSkyDir& dir); 72 GSkyDir(const GSkyDir& dir);
72 virtual ~GSkyDir(void); 73 virtual ~GSkyDir(void);
73 74
pyext/GSkyDir.i
@@ -39,6 +39,7 @@ class GSkyDir : public GBase { @@ -39,6 +39,7 @@ class GSkyDir : public GBase {
39 public: 39 public:
40 // Constructors and destructors 40 // Constructors and destructors
41 GSkyDir(void); 41 GSkyDir(void);
  42 + explicit GSkyDir(const GVector& vector);
42 GSkyDir(const GSkyDir& dir); 43 GSkyDir(const GSkyDir& dir);
43 virtual ~GSkyDir(void); 44 virtual ~GSkyDir(void);
44 45
src/sky/GSkyDir.cpp
@@ -67,6 +67,27 @@ GSkyDir::GSkyDir(void) @@ -67,6 +67,27 @@ GSkyDir::GSkyDir(void)
67 67
68 68
69 /***********************************************************************//** 69 /***********************************************************************//**
  70 + * @brief Vector constructor
  71 + *
  72 + * @param[in] vector Sky vector.
  73 + *
  74 + * Constructs a sky direction from a 3-element celestial vector. See the
  75 + * celvector() method for more information.
  76 + ***************************************************************************/
  77 +GSkyDir::GSkyDir(const GVector& vector)
  78 +{
  79 + // Initialise members
  80 + init_members();
  81 +
  82 + // Set sky direction from vector
  83 + celvector(vector);
  84 +
  85 + // Return
  86 + return;
  87 +}
  88 +
  89 +
  90 +/***********************************************************************//**
70 * @brief Copy constructor 91 * @brief Copy constructor
71 * 92 *
72 * @param[in] dir Sky direction. 93 * @param[in] dir Sky direction.