Commit dde1b854c40d9e6a60278725ba5b965b05646a1a

Authored by knodlseder
1 parent fdfb897d

add constructor from FITS file

include/GFits.hpp
... ... @@ -43,6 +43,7 @@ class GFits {
43 43 public:
44 44 // Constructors and destructors
45 45 GFits();
  46 + GFits(const std::string& filename);
46 47 GFits(const GFits& fits);
47 48 ~GFits();
48 49  
... ...
pyext/GFits.i
... ... @@ -35,6 +35,7 @@ class GFits {
35 35 public:
36 36 // Constructors and destructors
37 37 GFits();
  38 + GFits(const std::string& filename);
38 39 GFits(const GFits& fits);
39 40 ~GFits();
40 41  
... ...
src/fits/GFits.cpp
... ... @@ -46,7 +46,7 @@
46 46 ***************************************************************************/
47 47 GFits::GFits()
48 48 {
49   - // Initialise class members for clean destruction
  49 + // Initialise class members
50 50 init_members();
51 51  
52 52 // Return
... ... @@ -55,13 +55,31 @@ GFits::GFits()
55 55  
56 56  
57 57 /***********************************************************************//**
  58 + * @brief Constructor from FITS file
  59 + *
  60 + * @param[in] filename FITS file name
  61 + ***************************************************************************/
  62 +GFits::GFits(const std::string& filename)
  63 +{
  64 + // Initialise class members
  65 + init_members();
  66 +
  67 + // Open specified FITS file
  68 + open(filename);
  69 +
  70 + // Return
  71 + return;
  72 +}
  73 +
  74 +
  75 +/***********************************************************************//**
58 76 * @brief Copy constructor
59 77 *
60 78 * @param[in] fits FITS file from which the instance should be built.
61 79 ***************************************************************************/
62 80 GFits::GFits(const GFits& fits)
63 81 {
64   - // Initialise class members for clean destruction
  82 + // Initialise class members
65 83 init_members();
66 84  
67 85 // Copy members
... ...