Commit 9e037e7d77f5a3021b335ddee7f5bf2b8fc165f3

Authored by knodlseder
1 parent 303e2207

update

pyext/GFits.i
1 /*************************************************************************** 1 /***************************************************************************
2 * GFits.i - FITS file access class SWIG file * 2 * GFits.i - FITS file access class SWIG file *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright : (C) 2008 by Jurgen Knodlseder * 4 + * copyright : (C) 2008-2010 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 *
@@ -34,10 +34,10 @@ @@ -34,10 +34,10 @@
34 class GFits { 34 class GFits {
35 public: 35 public:
36 // Constructors and destructors 36 // Constructors and destructors
37 - GFits(); 37 + GFits(void);
38 GFits(const std::string& filename); 38 GFits(const std::string& filename);
39 GFits(const GFits& fits); 39 GFits(const GFits& fits);
40 - ~GFits(); 40 + virtual ~GFits(void);
41 41
42 // Methods 42 // Methods
43 void clear(void); 43 void clear(void);
pyext/GFitsData.i
1 /*************************************************************************** 1 /***************************************************************************
2 * GFitsData.hpp - FITS data handling abstract base class SWIG interface * 2 * GFitsData.hpp - FITS data handling abstract base class SWIG interface *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright : (C) 2008 by Jurgen Knodlseder * 4 + * copyright : (C) 2008-2010 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 *
pyext/GFitsDblImage.i deleted
1 -/***************************************************************************  
2 - * GFitsDblImage.hpp - FITS double precision image class SWIG interface *  
3 - * ----------------------------------------------------------------------- *  
4 - * copyright : (C) 2008 by Jurgen Knodlseder *  
5 - * ----------------------------------------------------------------------- *  
6 - * *  
7 - * This program is free software; you can redistribute it and/or modify *  
8 - * it under the terms of the GNU General Public License as published by *  
9 - * the Free Software Foundation; either version 2 of the License, or *  
10 - * (at your option) any later version. *  
11 - * *  
12 - ***************************************************************************/  
13 -/**  
14 - * @file GFitsDblImage.i  
15 - * @brief GFitsDblImage class SWIG file.  
16 - * @author J. Knodlseder  
17 - */  
18 -%{  
19 -/* Put headers and other declarations here that are needed for compilation */  
20 -#include "GFitsDblImage.hpp"  
21 -%}  
22 -%feature("notabstract") GFitsDblImage;  
23 -  
24 -/***********************************************************************//**  
25 - * @class GFitsDblImage  
26 - *  
27 - * @brief Implements FITS double precision image SWIG interface  
28 - ***************************************************************************/  
29 -class GFitsDblImage : public GFitsImage {  
30 -  
31 -public:  
32 - // Constructors and destructors  
33 - GFitsDblImage();  
34 - GFitsDblImage(const GFitsDblImage& image);  
35 - ~GFitsDblImage();  
36 -  
37 - // Methods  
38 - void link(double* pixels);  
39 - void set_nullval(const double* value);  
40 -};  
41 -  
42 -  
43 -/***********************************************************************//**  
44 - * @brief GFitsDblImage class extension  
45 - ***************************************************************************/  
46 -%extend GFitsDblImage {  
47 - char *__str__() {  
48 - static char str_buffer[100001];  
49 - std::ostringstream buffer;  
50 - buffer << *self;  
51 - std::string str = buffer.str();  
52 - strncpy(str_buffer, (char*)str.c_str(), 100001);  
53 - str_buffer[100000] = '\0';  
54 - return str_buffer;  
55 - }  
56 - GFitsDblImage(int nx) {  
57 - int naxis = 1;  
58 - int naxes[] = {nx};  
59 - GFitsDblImage* image = new GFitsDblImage(naxis, naxes);  
60 - return image;  
61 - }  
62 - GFitsDblImage(int nx, int ny) {  
63 - int naxis = 2;  
64 - int naxes[] = {nx, ny};  
65 - GFitsDblImage* image = new GFitsDblImage(naxis, naxes);  
66 - return image;  
67 - }  
68 - GFitsDblImage(int nx, int ny, int nz) {  
69 - int naxis = 3;  
70 - int naxes[] = {nx, ny, nz};  
71 - GFitsDblImage* image = new GFitsDblImage(naxis, naxes);  
72 - return image;  
73 - }  
74 - GFitsDblImage(int nx, int ny, int nz, int nt) {  
75 - int naxis = 4;  
76 - int naxes[] = {nx, ny, nz, nt};  
77 - GFitsDblImage* image = new GFitsDblImage(naxis, naxes);  
78 - return image;  
79 - }  
80 - double get(const int& ix) {  
81 - return (*self)(ix);  
82 - }  
83 - void set(const int& ix, const double& value) {  
84 - (*self)(ix) = value;  
85 - }  
86 - double get(const int& ix, const int& iy) {  
87 - return (*self)(ix, iy);  
88 - }  
89 - void set(const int& ix, const int& iy, const double& value) {  
90 - (*self)(ix, iy) = value;  
91 - }  
92 - double get(const int& ix, const int& iy, const int& iz) {  
93 - return (*self)(ix, iy, iz);  
94 - }  
95 - void set(const int& ix, const int& iy, const int& iz, const double& value) {  
96 - (*self)(ix, iy, iz) = value;  
97 - }  
98 - double get(const int& ix, const int& iy, const int& iz, const int& it) {  
99 - return (*self)(ix, iy, iz, it);  
100 - }  
101 - void set(const int& ix, const int& iy, const int& iz, const int& it,  
102 - const double& value) {  
103 - (*self)(ix, iy, iz, it) = value;  
104 - }  
105 - GFitsDblImage copy() {  
106 - return (*self);  
107 - }  
108 -};  
pyext/GFitsHDU.i
1 /*************************************************************************** 1 /***************************************************************************
2 * GFitsHDU.i - FITS HDU handling class SWIG file * 2 * GFitsHDU.i - FITS HDU handling class SWIG file *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright : (C) 2008 by Jurgen Knodlseder * 4 + * copyright : (C) 2008-2010 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 *
@@ -36,23 +36,31 @@ @@ -36,23 +36,31 @@
36 class GFitsHDU { 36 class GFitsHDU {
37 public: 37 public:
38 // Constructors and destructors 38 // Constructors and destructors
39 - GFitsHDU(); 39 + GFitsHDU(void);
40 GFitsHDU(const GFitsImage& image); 40 GFitsHDU(const GFitsImage& image);
41 GFitsHDU(const GFitsAsciiTable& table); 41 GFitsHDU(const GFitsAsciiTable& table);
42 GFitsHDU(const GFitsBinTable& table); 42 GFitsHDU(const GFitsBinTable& table);
43 GFitsHDU(const GFitsHDU& hdu); 43 GFitsHDU(const GFitsHDU& hdu);
44 - ~GFitsHDU(); 44 + virtual ~GFitsHDU(void);
45 45
46 // Methods 46 // Methods
47 - std::string extname(void) const;  
48 - void extname(const std::string& extname);  
49 - int extno(void) const;  
50 - int exttype(void) const;  
51 - GFitsHeader* header(void) const;  
52 - GFitsData* data(void) const;  
53 - GFitsTableCol* column(const std::string& colname) const;  
54 - void primary(void);  
55 - 47 + std::string extname(void) const;
  48 + void extname(const std::string& extname);
  49 + int extno(void) const;
  50 + int exttype(void) const;
  51 + GFitsHeader* header(void) const;
  52 + GFitsData* data(void) const;
  53 + GFitsHeaderCard* card(const std::string& keyname) const;
  54 + GFitsHeaderCard* card(const int& cardno) const;
  55 + void card(const std::string& keyname, const std::string& value,
  56 + const std::string& comment);
  57 + void card(const std::string& keyname, const double& value,
  58 + const std::string& comment);
  59 + void card(const std::string& keyname, const int& value,
  60 + const std::string& comment);
  61 + GFitsTableCol* column(const std::string& colname) const;
  62 + GFitsTableCol* column(const int& colnum) const;
  63 + void primary(void);
56 }; 64 };
57 65
58 66
pyext/GFitsHeader.i
1 /*************************************************************************** 1 /***************************************************************************
2 * GFitsHeader.i - FITS header handling class SWIG file * 2 * GFitsHeader.i - FITS header handling class SWIG file *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright : (C) 2008 by Jurgen Knodlseder * 4 + * copyright : (C) 2008-2010 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 *
@@ -37,11 +37,13 @@ @@ -37,11 +37,13 @@
37 class GFitsHeader { 37 class GFitsHeader {
38 public: 38 public:
39 // Constructors and destructors 39 // Constructors and destructors
40 - GFitsHeader(); 40 + GFitsHeader(void);
41 GFitsHeader(const GFitsHeader& header); 41 GFitsHeader(const GFitsHeader& header);
42 - ~GFitsHeader(); 42 + virtual ~GFitsHeader(void);
43 43
44 // Methods 44 // Methods
  45 + void clear(void);
  46 + int size(void) const;
45 void update(const GFitsHeaderCard& card); 47 void update(const GFitsHeaderCard& card);
46 GFitsHeaderCard* card(const std::string& keyname); 48 GFitsHeaderCard* card(const std::string& keyname);
47 GFitsHeaderCard* card(const int& cardno); 49 GFitsHeaderCard* card(const int& cardno);
pyext/GFitsHeaderCard.i
1 /*************************************************************************** 1 /***************************************************************************
2 * GFitsHeaderCard.hpp - FITS header card class SWIG file * 2 * GFitsHeaderCard.hpp - FITS header card class SWIG file *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright : (C) 2008 by Jurgen Knodlseder * 4 + * copyright : (C) 2008-2010 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 *
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 class GFitsHeaderCard { 35 class GFitsHeaderCard {
36 public: 36 public:
37 // Constructors & Destructors 37 // Constructors & Destructors
38 - GFitsHeaderCard(); 38 + GFitsHeaderCard(void);
39 GFitsHeaderCard(const std::string& keyname, const std::string& value, 39 GFitsHeaderCard(const std::string& keyname, const std::string& value,
40 const std::string& comment); 40 const std::string& comment);
41 GFitsHeaderCard(const std::string& keyname, const double& value, 41 GFitsHeaderCard(const std::string& keyname, const double& value,
@@ -43,7 +43,7 @@ public: @@ -43,7 +43,7 @@ public:
43 GFitsHeaderCard(const std::string& keyname, const int& value, 43 GFitsHeaderCard(const std::string& keyname, const int& value,
44 const std::string& comment); 44 const std::string& comment);
45 GFitsHeaderCard(const GFitsHeaderCard& card); 45 GFitsHeaderCard(const GFitsHeaderCard& card);
46 - ~GFitsHeaderCard(); 46 + virtual ~GFitsHeaderCard(void);
47 47
48 // Methods to set card properties 48 // Methods to set card properties
49 void keyname(const std::string& keyname); 49 void keyname(const std::string& keyname);
pyext/GFitsImage.i
1 /*************************************************************************** 1 /***************************************************************************
2 * GFitsImage.i - FITS image abstract base class SWIG interface * 2 * GFitsImage.i - FITS image abstract base class SWIG interface *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright : (C) 2008 by Jurgen Knodlseder * 4 + * copyright : (C) 2008-2010 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 *
pyext/GFitsImageDbl.i
1 /*************************************************************************** 1 /***************************************************************************
2 * GFitsImageDbl.hpp - FITS double precision image class SWIG interface * 2 * GFitsImageDbl.hpp - FITS double precision image class SWIG interface *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright : (C) 2008 by Jurgen Knodlseder * 4 + * copyright : (C) 2008-2010 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 *
@@ -30,9 +30,9 @@ class GFitsImageDbl : public GFitsImage { @@ -30,9 +30,9 @@ class GFitsImageDbl : public GFitsImage {
30 30
31 public: 31 public:
32 // Constructors and destructors 32 // Constructors and destructors
33 - GFitsImageDbl(); 33 + GFitsImageDbl(void);
34 GFitsImageDbl(const GFitsImageDbl& image); 34 GFitsImageDbl(const GFitsImageDbl& image);
35 - ~GFitsImageDbl(); 35 + virtual ~GFitsImageDbl(void);
36 36
37 // Methods 37 // Methods
38 void link(double* pixels); 38 void link(double* pixels);
pyext/GFitsTable.i
1 /*************************************************************************** 1 /***************************************************************************
2 * GFitsTable.i - FITS table abstract base class SWIG interface * 2 * GFitsTable.i - FITS table abstract base class SWIG interface *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright : (C) 2008 by Jurgen Knodlseder * 4 + * copyright : (C) 2008-2010 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 *
@@ -29,16 +29,16 @@ @@ -29,16 +29,16 @@
29 class GFitsTable : public GFitsData { 29 class GFitsTable : public GFitsData {
30 public: 30 public:
31 // Constructors and destructors 31 // Constructors and destructors
32 - GFitsTable(); 32 + GFitsTable(void);
33 GFitsTable(int nrows); 33 GFitsTable(int nrows);
34 GFitsTable(const GFitsTable& table); 34 GFitsTable(const GFitsTable& table);
35 - virtual ~GFitsTable(); 35 + virtual ~GFitsTable(void);
36 36
37 // Methods 37 // Methods
38 void append_column(GFitsTableCol& column); 38 void append_column(GFitsTableCol& column);
39 void insert_column(int colnum, GFitsTableCol& column); 39 void insert_column(int colnum, GFitsTableCol& column);
40 - //void append_rows(const int& nrows);  
41 - //void insert_rows(const int& rownum, const int& nrows); 40 + void append_rows(const int& nrows);
  41 + void insert_rows(const int& rownum, const int& nrows);
42 GFitsTableCol* column(const std::string& colname); 42 GFitsTableCol* column(const std::string& colname);
43 GFitsTableCol* column(const int& colnum); 43 GFitsTableCol* column(const int& colnum);
44 int nrows(void) const; 44 int nrows(void) const;
pyext/GFitsTableCol.i
1 /*************************************************************************** 1 /***************************************************************************
2 * GFitsTableCol.i - FITS table column abstract base class SWIG file * 2 * GFitsTableCol.i - FITS table column abstract base class SWIG file *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright : (C) 2008 by Jurgen Knodlseder * 4 + * copyright : (C) 2008-2010 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 *
@@ -29,11 +29,11 @@ @@ -29,11 +29,11 @@
29 class GFitsTableCol { 29 class GFitsTableCol {
30 public: 30 public:
31 // Constructors and destructors 31 // Constructors and destructors
32 - GFitsTableCol(); 32 + GFitsTableCol(void);
33 GFitsTableCol(const std::string& name, const int& length, 33 GFitsTableCol(const std::string& name, const int& length,
34 const int& number, const int& width); 34 const int& number, const int& width);
35 GFitsTableCol(const GFitsTableCol& column); 35 GFitsTableCol(const GFitsTableCol& column);
36 - virtual ~GFitsTableCol(); 36 + virtual ~GFitsTableCol(void);
37 37
38 // Virtual Methods 38 // Virtual Methods
39 virtual std::string string(const int& row, const int& inx = 0) = 0; 39 virtual std::string string(const int& row, const int& inx = 0) = 0;