Commit bba94d665afc257200145f88bf94002eca69163f

Authored by Jürgen Knödlseder
1 parent 62d51bbb

GFitsImage naxes constructor now takes std::vector as argument.

This replaces two arguments:
- naxis: the dimension of the image
- naxes: a pointer to an array containing the number of pixels for each dimension
ChangeLog
... ... @@ -3,6 +3,7 @@
3 3 * Version 1.1.0 released
4 4 =========================
5 5  
  6 + Use std::vector for naxes argument in GFitsImage (#1779).
6 7 GCTACubePsf and GCTACubeEdisp now save 4D images.
7 8 Change interpolation scheme in GCTABackground3D.
8 9 Add GCsv::append() method (#1773).
... ...
... ... @@ -103,6 +103,18 @@ The return value has been changed for the following methods:
103 103 - GFits::filename() returns now GFilename instead of std::string
104 104 - GCTAObservation::eventtype() returns now std::string instead of const std::string&
105 105  
  106 +The interface for the following methods has been changed:
  107 +- GFitsImage naxes constructor
  108 +- GFitsImageByte naxes constructor
  109 +- GFitsImageDouble naxes constructor
  110 +- GFitsImageFloat naxes constructor
  111 +- GFitsImageLong naxes constructor
  112 +- GFitsImageLongLong naxes constructor
  113 +- GFitsImageSByte naxes constructor
  114 +- GFitsImageShort naxes constructor
  115 +- GFitsImageULong naxes constructor
  116 +- GFitsImageUShort naxes constructor
  117 +
106 118  
107 119 3. Configuration
108 120 -----------------
... ... @@ -133,6 +145,9 @@ FITS column.
133 145  
134 146 GFits now uses the GFilename class to store the FITS filename (fixes #1649).
135 147  
  148 +The GFitsImage naxes constructor now takes a std::vector as argument instead
  149 +of a pointer to an array and a dimension (#1779).
  150 +
136 151  
137 152 7. Linear algebra module
138 153 ------------------------
... ...
include/GFitsImage.hpp
1 1 /***************************************************************************
2 2 * GFitsImage.hpp - Abstract FITS image base class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2008-2014 by Juergen Knoedlseder *
  4 + * copyright (C) 2008-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -28,6 +28,8 @@
28 28 #define GFITSIMAGE_HPP
29 29  
30 30 /* __ Includes ___________________________________________________________ */
  31 +#include <vector>
  32 +#include <string>
31 33 #include "GFitsHDU.hpp"
32 34  
33 35  
... ... @@ -47,7 +49,7 @@ public:
47 49 GFitsImage(const int& bitpix, const int& nx, const int& ny);
48 50 GFitsImage(const int& bitpix, const int& nx, const int& ny, const int& nz);
49 51 GFitsImage(const int& bitpix, const int& nx, const int& ny, const int& nz, const int& nt);
50   - GFitsImage(const int& bitpix, const int& naxis, const int* naxes);
  52 + GFitsImage(const int& bitpix, const std::vector<int>& naxes);
51 53 GFitsImage(const GFitsImage& image);
52 54 virtual ~GFitsImage(void);
53 55  
... ...
include/GFitsImageByte.hpp
1 1 /***************************************************************************
2 2 * GFitsImageByte.hpp - FITS Byte image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2014 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -45,7 +45,7 @@ public:
45 45 GFitsImageByte(const int& nx, const int& ny, const unsigned char* pixels = NULL);
46 46 GFitsImageByte(const int& nx, const int& ny, const int& nz, const unsigned char* pixels = NULL);
47 47 GFitsImageByte(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned char* pixels = NULL);
48   - GFitsImageByte(const int& naxis, const int* naxes, const unsigned char* pixels = NULL);
  48 + GFitsImageByte(const std::vector<int>& naxes, const unsigned char* pixels = NULL);
49 49 GFitsImageByte(const GFitsImageByte& image);
50 50 virtual ~GFitsImageByte(void);
51 51  
... ...
include/GFitsImageDouble.hpp
1 1 /***************************************************************************
2 2 * GFitsImageDouble.hpp - Double precision FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2008-2014 by Juergen Knoedlseder *
  4 + * copyright (C) 2008-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -45,7 +45,7 @@ public:
45 45 GFitsImageDouble(const int& nx, const int& ny, const double* pixels = NULL);
46 46 GFitsImageDouble(const int& nx, const int& ny, const int& nz, const double* pixels = NULL);
47 47 GFitsImageDouble(const int& nx, const int& ny, const int& nz, const int& nt, const double* pixels = NULL);
48   - GFitsImageDouble(const int& naxis, const int* naxes, const double* pixels = NULL);
  48 + GFitsImageDouble(const std::vector<int>& naxes, const double* pixels = NULL);
49 49 GFitsImageDouble(const GFitsImageDouble& image);
50 50 virtual ~GFitsImageDouble(void);
51 51  
... ...
include/GFitsImageFloat.hpp
1 1 /***************************************************************************
2 2 * GFitsImageFloat.hpp - Single precision FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2014 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -45,7 +45,7 @@ public:
45 45 GFitsImageFloat(const int& nx, const int& ny, const float* pixels = NULL);
46 46 GFitsImageFloat(const int& nx, const int& ny, const int& nz, const float* pixels = NULL);
47 47 GFitsImageFloat(const int& nx, const int& ny, const int& nz, const int& nt, const float* pixels = NULL);
48   - GFitsImageFloat(const int& naxis, const int* naxes, const float* pixels = NULL);
  48 + GFitsImageFloat(const std::vector<int>& naxes, const float* pixels = NULL);
49 49 GFitsImageFloat(const GFitsImageFloat& image);
50 50 virtual ~GFitsImageFloat(void);
51 51  
... ...
include/GFitsImageLong.hpp
1 1 /***************************************************************************
2 2 * GFitsImageLong.hpp - Long integer FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2014 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -45,7 +45,7 @@ public:
45 45 GFitsImageLong(const int& nx, const int& ny, const long* pixels = NULL);
46 46 GFitsImageLong(const int& nx, const int& ny, const int& nz, const long* pixels = NULL);
47 47 GFitsImageLong(const int& nx, const int& ny, const int& nz, const int& nt, const long* pixels = NULL);
48   - GFitsImageLong(const int& naxis, const int* naxes, const long* pixels = NULL);
  48 + GFitsImageLong(const std::vector<int>& naxes, const long* pixels = NULL);
49 49 GFitsImageLong(const GFitsImageLong& image);
50 50 virtual ~GFitsImageLong(void);
51 51  
... ...
include/GFitsImageLongLong.hpp
1 1 /***************************************************************************
2 2 * GFitsImageLongLong.hpp - Long long integer FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2014 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -45,7 +45,7 @@ public:
45 45 GFitsImageLongLong(const int& nx, const int& ny, const long long* pixels = NULL);
46 46 GFitsImageLongLong(const int& nx, const int& ny, const int& nz, const long long* pixels = NULL);
47 47 GFitsImageLongLong(const int& nx, const int& ny, const int& nz, const int& nt, const long long* pixels = NULL);
48   - GFitsImageLongLong(const int& naxis, const int* naxes, const long long* pixels = NULL);
  48 + GFitsImageLongLong(const std::vector<int>& naxes, const long long* pixels = NULL);
49 49 GFitsImageLongLong(const GFitsImageLongLong& image);
50 50 virtual ~GFitsImageLongLong(void);
51 51  
... ...
include/GFitsImageSByte.hpp
1 1 /***************************************************************************
2 2 * GFitsImageSByte.hpp - Signed Byte FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2014 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -45,7 +45,7 @@ public:
45 45 GFitsImageSByte(const int& nx, const int& ny, const char* pixels = NULL);
46 46 GFitsImageSByte(const int& nx, const int& ny, const int& nz, const char* pixels = NULL);
47 47 GFitsImageSByte(const int& nx, const int& ny, const int& nz, const int& nt, const char* pixels = NULL);
48   - GFitsImageSByte(const int& naxis, const int* naxes, const char* pixels = NULL);
  48 + GFitsImageSByte(const std::vector<int>& naxes, const char* pixels = NULL);
49 49 GFitsImageSByte(const GFitsImageSByte& image);
50 50 virtual ~GFitsImageSByte(void);
51 51  
... ...
include/GFitsImageShort.hpp
1 1 /***************************************************************************
2 2 * GFitsImageShort.hpp - Short integer FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2014 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -45,7 +45,7 @@ public:
45 45 GFitsImageShort(const int& nx, const int& ny, const short* pixels = NULL);
46 46 GFitsImageShort(const int& nx, const int& ny, const int& nz, const short* pixels = NULL);
47 47 GFitsImageShort(const int& nx, const int& ny, const int& nz, const int& nt, const short* pixels = NULL);
48   - GFitsImageShort(const int& naxis, const int* naxes, const short* pixels = NULL);
  48 + GFitsImageShort(const std::vector<int>& naxes, const short* pixels = NULL);
49 49 GFitsImageShort(const GFitsImageShort& image);
50 50 virtual ~GFitsImageShort(void);
51 51  
... ...
include/GFitsImageULong.hpp
1 1 /***************************************************************************
2 2 * GFitsImageULong.hpp - Unsigned long image FITS class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2014 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -45,7 +45,7 @@ public:
45 45 GFitsImageULong(const int& nx, const int& ny, const unsigned long* pixels = NULL);
46 46 GFitsImageULong(const int& nx, const int& ny, const int& nz, const unsigned long* pixels = NULL);
47 47 GFitsImageULong(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned long* pixels = NULL);
48   - GFitsImageULong(const int& naxis, const int* naxes, const unsigned long* pixels = NULL);
  48 + GFitsImageULong(const std::vector<int>& naxes, const unsigned long* pixels = NULL);
49 49 GFitsImageULong(const GFitsImageULong& image);
50 50 virtual ~GFitsImageULong(void);
51 51  
... ...
include/GFitsImageUShort.hpp
1 1 /***************************************************************************
2 2 * GFitsImageUShort.hpp - Unsigned short FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2014 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -45,7 +45,7 @@ public:
45 45 GFitsImageUShort(const int& nx, const int& ny, const unsigned short* pixels = NULL);
46 46 GFitsImageUShort(const int& nx, const int& ny, const int& nz, const unsigned short* pixels = NULL);
47 47 GFitsImageUShort(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned short* pixels = NULL);
48   - GFitsImageUShort(const int& naxis, const int* naxes, const unsigned short* pixels = NULL);
  48 + GFitsImageUShort(const std::vector<int>& naxes, const unsigned short* pixels = NULL);
49 49 GFitsImageUShort(const GFitsImageUShort& image);
50 50 virtual ~GFitsImageUShort(void);
51 51  
... ...
pyext/GFitsImage.i
1 1 /***************************************************************************
2 2 * GFitsImage.i - Abstract FITS image base class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2008-2015 by Juergen Knoedlseder *
  4 + * copyright (C) 2008-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -37,6 +37,13 @@
37 37 #include "GFitsImageUShort.hpp"
38 38 #include "GTools.hpp"
39 39 %}
  40 +/*
  41 +%include "std_vector.i"
  42 +namespace std {
  43 + %template(FitsImageIntVector) vector<int>;
  44 +}
  45 +*/
  46 +
40 47  
41 48 /***********************************************************************//**
42 49 * @brief Tuple to index conversion to provide pixel access.
... ... @@ -100,7 +107,7 @@ public:
100 107 GFitsImage(const int& bitpix, const int& nx, const int& ny);
101 108 GFitsImage(const int& bitpix, const int& nx, const int& ny, const int& nz);
102 109 GFitsImage(const int& bitpix, const int& nx, const int& ny, const int& nz, const int& nt);
103   - GFitsImage(const int& bitpix, const int& naxis, const int* naxes);
  110 + GFitsImage(const int& bitpix, const std::vector<int>& naxes);
104 111 GFitsImage(const GFitsImage& image);
105 112 virtual ~GFitsImage(void);
106 113  
... ...
pyext/GFitsImageByte.i
1 1 /***************************************************************************
2 2 * GFitsImageByte.i - FITS Byte image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2015 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -29,6 +29,7 @@
29 29 #include "GException.hpp"
30 30 %}
31 31  
  32 +
32 33 /***********************************************************************//**
33 34 * @class GFitsImageByte
34 35 *
... ... @@ -42,7 +43,7 @@ public:
42 43 GFitsImageByte(const int& nx, const int& ny, const unsigned char* pixels = NULL);
43 44 GFitsImageByte(const int& nx, const int& ny, const int& nz, const unsigned char* pixels = NULL);
44 45 GFitsImageByte(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned char* pixels = NULL);
45   - GFitsImageByte(const int& naxis, const int* naxes, const unsigned char* pixels = NULL);
  46 + GFitsImageByte(const std::vector<int>& naxes, const unsigned char* pixels = NULL);
46 47 GFitsImageByte(const GFitsImageByte& image);
47 48 virtual ~GFitsImageByte(void);
48 49  
... ...
pyext/GFitsImageDouble.i
1 1 /***************************************************************************
2 2 * GFitsImageDouble.i - Double precision FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2015 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -43,7 +43,7 @@ public:
43 43 GFitsImageDouble(const int& nx, const int& ny, const double* pixels = NULL);
44 44 GFitsImageDouble(const int& nx, const int& ny, const int& nz, const double* pixels = NULL);
45 45 GFitsImageDouble(const int& nx, const int& ny, const int& nz, const int& nt, const double* pixels = NULL);
46   - GFitsImageDouble(const int& naxis, const int* naxes, const double* pixels = NULL);
  46 + GFitsImageDouble(const std::vector<int>& naxes, const double* pixels = NULL);
47 47 GFitsImageDouble(const GFitsImageDouble& image);
48 48 virtual ~GFitsImageDouble(void);
49 49  
... ...
pyext/GFitsImageFloat.i
1 1 /***************************************************************************
2 2 * GFitsImageFloat.i - Single precision FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2015 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -43,7 +43,7 @@ public:
43 43 GFitsImageFloat(const int& nx, const int& ny, const float* pixels = NULL);
44 44 GFitsImageFloat(const int& nx, const int& ny, const int& nz, const float* pixels = NULL);
45 45 GFitsImageFloat(const int& nx, const int& ny, const int& nz, const int& nt, const float* pixels = NULL);
46   - GFitsImageFloat(const int& naxis, const int* naxes, const float* pixels = NULL);
  46 + GFitsImageFloat(const std::vector<int>& naxes, const float* pixels = NULL);
47 47 GFitsImageFloat(const GFitsImageFloat& image);
48 48 virtual ~GFitsImageFloat(void);
49 49  
... ...
pyext/GFitsImageLong.i
1 1 /***************************************************************************
2 2 * GFitsImageLong.i - Long integer FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2015 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -43,7 +43,7 @@ public:
43 43 GFitsImageLong(const int& nx, const int& ny, const long* pixels = NULL);
44 44 GFitsImageLong(const int& nx, const int& ny, const int& nz, const long* pixels = NULL);
45 45 GFitsImageLong(const int& nx, const int& ny, const int& nz, const int& nt, const long* pixels = NULL);
46   - GFitsImageLong(const int& naxis, const int* naxes, const long* pixels = NULL);
  46 + GFitsImageLong(const std::vector<int>& naxes, const long* pixels = NULL);
47 47 GFitsImageLong(const GFitsImageLong& image);
48 48 virtual ~GFitsImageLong(void);
49 49  
... ...
pyext/GFitsImageLongLong.i
1 1 /***************************************************************************
2 2 * GFitsImageLongLong.i - Long long integer FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2015 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -43,7 +43,7 @@ public:
43 43 GFitsImageLongLong(const int& nx, const int& ny, const long long* pixels = NULL);
44 44 GFitsImageLongLong(const int& nx, const int& ny, const int& nz, const long long* pixels = NULL);
45 45 GFitsImageLongLong(const int& nx, const int& ny, const int& nz, const int& nt, const long long* pixels = NULL);
46   - GFitsImageLongLong(const int& naxis, const int* naxes, const long long* pixels = NULL);
  46 + GFitsImageLongLong(const std::vector<int>& naxes, const long long* pixels = NULL);
47 47 GFitsImageLongLong(const GFitsImageLongLong& image);
48 48 virtual ~GFitsImageLongLong(void);
49 49  
... ...
pyext/GFitsImageSByte.i
1 1 /***************************************************************************
2 2 * GFitsImageSByte.i - Signed Byte FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2015 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -43,7 +43,7 @@ public:
43 43 GFitsImageSByte(const int& nx, const int& ny, const char* pixels = NULL);
44 44 GFitsImageSByte(const int& nx, const int& ny, const int& nz, const char* pixels = NULL);
45 45 GFitsImageSByte(const int& nx, const int& ny, const int& nz, const int& nt, const char* pixels = NULL);
46   - GFitsImageSByte(const int& naxis, const int* naxes, const char* pixels = NULL);
  46 + GFitsImageSByte(const std::vector<int>& naxes, const char* pixels = NULL);
47 47 GFitsImageSByte(const GFitsImageSByte& image);
48 48 virtual ~GFitsImageSByte(void);
49 49  
... ...
pyext/GFitsImageShort.i
1 1 /***************************************************************************
2 2 * GFitsImageShort.i - Short integer FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2015 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -43,7 +43,7 @@ public:
43 43 GFitsImageShort(const int& nx, const int& ny, const short* pixels = NULL);
44 44 GFitsImageShort(const int& nx, const int& ny, const int& nz, const short* pixels = NULL);
45 45 GFitsImageShort(const int& nx, const int& ny, const int& nz, const int& nt, const short* pixels = NULL);
46   - GFitsImageShort(const int& naxis, const int* naxes, const short* pixels = NULL);
  46 + GFitsImageShort(const std::vector<int>& naxes, const short* pixels = NULL);
47 47 GFitsImageShort(const GFitsImageShort& image);
48 48 virtual ~GFitsImageShort(void);
49 49  
... ...
pyext/GFitsImageULong.i
1 1 /***************************************************************************
2 2 * GFitsImageULong.i - Unsigned long image FITS class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2015 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -43,7 +43,7 @@ public:
43 43 GFitsImageULong(const int& nx, const int& ny, const unsigned long* pixels = NULL);
44 44 GFitsImageULong(const int& nx, const int& ny, const int& nz, const unsigned long* pixels = NULL);
45 45 GFitsImageULong(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned long* pixels = NULL);
46   - GFitsImageULong(const int& naxis, const int* naxes, const unsigned long* pixels = NULL);
  46 + GFitsImageULong(const std::vector<int>& naxes, const unsigned long* pixels = NULL);
47 47 GFitsImageULong(const GFitsImageULong& image);
48 48 virtual ~GFitsImageULong(void);
49 49  
... ...
pyext/GFitsImageUShort.i
1 1 /***************************************************************************
2 2 * GFitsImageUShort.i - Unsigned short FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2015 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -44,7 +44,7 @@ public:
44 44 GFitsImageUShort(const int& nx, const int& ny, const unsigned short* pixels = NULL);
45 45 GFitsImageUShort(const int& nx, const int& ny, const int& nz, const unsigned short* pixels = NULL);
46 46 GFitsImageUShort(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned short* pixels = NULL);
47   - GFitsImageUShort(const int& naxis, const int* naxes, const unsigned short* pixels = NULL);
  47 + GFitsImageUShort(const std::vector<int>& naxes, const unsigned short* pixels = NULL);
48 48 GFitsImageUShort(const GFitsImageUShort& image);
49 49 virtual ~GFitsImageUShort(void);
50 50  
... ...
pyext/GHealpix.i
1 1 /***************************************************************************
2 2 * GHealpix.i - Healpix projection class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2015 by Jurgen Knodlseder *
  4 + * copyright (C) 2010-2016 by Jurgen Knodlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -27,13 +27,6 @@
27 27 /* Put headers and other declarations here that are needed for compilation */
28 28 #include "GHealpix.hpp"
29 29 %}
30   -%include "std_vector.i"
31   -namespace std {
32   - %template(SkyDirVector) vector<GSkyDir>;
33   -}
34   -namespace std {
35   - %template(IntVector) vector<int>;
36   -}
37 30  
38 31  
39 32 /***********************************************************************//**
... ...
pyext/GSkyMap.i
... ... @@ -28,10 +28,6 @@
28 28 #include "GSkyMap.hpp"
29 29 #include "GTools.hpp"
30 30 %}
31   -%include "std_vector.i"
32   -namespace std {
33   - %template(IntVector) vector<int>;
34   -}
35 31  
36 32  
37 33 /***********************************************************************//**
... ...
pyext/gammalib/fits.i
... ... @@ -38,6 +38,11 @@
38 38  
39 39 /* __ Include standard typemaps for vectors and strings __________________ */
40 40 %include stl.i
  41 +%include "std_vector.i"
  42 +namespace std {
  43 + %template(vectori) vector<int>;
  44 + %template(vectord) vector<double>;
  45 +};
41 46  
42 47 /* __ Include GammaLib typemaps __________________________________________ */
43 48 %include typemap_GFilename.i
... ...
pyext/gammalib/sky.i
... ... @@ -34,10 +34,17 @@
34 34 #include <stddef.h>
35 35 #include "GException.hpp"
36 36 #include "GTools.hpp"
  37 +#include "GSkyDir.hpp"
37 38 %}
38 39  
39 40 /* __ Include standard typemaps for vectors and strings __________________ */
40 41 %include stl.i
  42 +%include "std_vector.i"
  43 +namespace std {
  44 + %template(vectori) vector<int>;
  45 + %template(vectord) vector<double>;
  46 + %template(vectorskydir) vector<GSkyDir>;
  47 +};
41 48  
42 49 /* __ Include GammaLib typemaps __________________________________________ */
43 50 %include typemap_GFilename.i
... ...
src/fits/GFitsImage.cpp
... ... @@ -224,15 +224,13 @@ GFitsImage::GFitsImage(const int&amp; bitpix, const int&amp; nx, const int&amp; ny,
224 224 * @brief Constructor
225 225 *
226 226 * @param[in] bitpix Number of Bits per pixel (negative is floating point).
227   - * @param[in] naxis Image dimensions [0,1,2,3,4].
228   - * @param[in] naxes Pointer to array giving number of pixels in each dimension.
  227 + * @param[in] naxes Vector of number of pixels in each dimension.
229 228 *
230 229 * Construct instance of GFitsImage by specifying the image dimension and
231 230 * the number of pixels in each dimension. This method also adds the relevant
232 231 * header cards.
233 232 ***************************************************************************/
234   -GFitsImage::GFitsImage(const int& bitpix, const int& naxis,
235   - const int* naxes) : GFitsHDU()
  233 +GFitsImage::GFitsImage(const int& bitpix, const std::vector<int>& naxes) : GFitsHDU()
236 234 {
237 235 // Initialise class members for clean destruction
238 236 init_members();
... ... @@ -241,7 +239,7 @@ GFitsImage::GFitsImage(const int&amp; bitpix, const int&amp; naxis,
241 239 m_bitpix = bitpix;
242 240  
243 241 // Store number of axes
244   - m_naxis = naxis;
  242 + m_naxis = naxes.size();
245 243  
246 244 // Copy number of pixels in each dimension and calculate the total
247 245 // number of pixels
... ...
src/fits/GFitsImageByte.cpp
1 1 /***************************************************************************
2 2 * GFitsImageByte.cpp - FITS Byte image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2013 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -162,17 +162,16 @@ GFitsImageByte::GFitsImageByte(const int&amp; nx, const int&amp; ny, const int&amp; nz,
162 162 /***********************************************************************//**
163 163 * @brief Pixel array constructor
164 164 *
165   - * @param[in] naxis Image dimension (0,1,2,3,4).
166   - * @param[in] naxes Number of pixels in each dimension.
  165 + * @param[in] naxes Vector of number of pixels in each dimension.
167 166 * @param[in] pixels Optional pointer to image pixel array
168 167 *
169 168 * Construct instance of GFitsImageByte by specifying the image dimension and
170 169 * the number of pixels in each dimension. Note that this constructor does
171 170 * not allocate any memory for the actual image.
172 171 ***************************************************************************/
173   -GFitsImageByte::GFitsImageByte(const int& naxis, const int* naxes,
174   - const unsigned char* pixels) :
175   - GFitsImage(G_BITPIX, naxis, naxes)
  172 +GFitsImageByte::GFitsImageByte(const std::vector<int>& naxes,
  173 + const unsigned char* pixels) :
  174 + GFitsImage(G_BITPIX, naxes)
176 175 {
177 176 // Initialise class members for clean destruction
178 177 init_members();
... ...
src/fits/GFitsImageDouble.cpp
1 1 /***************************************************************************
2 2 * GFitsImageDouble.cpp - Double precision FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2008-2013 by Juergen Knoedlseder *
  4 + * copyright (C) 2008-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -162,17 +162,16 @@ GFitsImageDouble::GFitsImageDouble(const int&amp; nx, const int&amp; ny, const int&amp; nz,
162 162 /***********************************************************************//**
163 163 * @brief Pixel array constructor
164 164 *
165   - * @param[in] naxis Image dimension (0,1,2,3,4).
166   - * @param[in] naxes Number of pixels in each dimension.
  165 + * @param[in] naxes Vector of number of pixels in each dimension.
167 166 * @param[in] pixels Optional pointer to image pixel array
168 167 *
169 168 * Construct instance of GFitsImageDouble by specifying the image dimension and
170 169 * the number of pixels in each dimension. Note that this constructor does
171 170 * not allocate any memory for the actual image.
172 171 ***************************************************************************/
173   -GFitsImageDouble::GFitsImageDouble(const int& naxis, const int* naxes,
174   - const double* pixels) :
175   - GFitsImage(G_BITPIX, naxis, naxes)
  172 +GFitsImageDouble::GFitsImageDouble(const std::vector<int>& naxes,
  173 + const double* pixels) :
  174 + GFitsImage(G_BITPIX, naxes)
176 175 {
177 176 // Initialise class members for clean destruction
178 177 init_members();
... ...
src/fits/GFitsImageFloat.cpp
1 1 /***************************************************************************
2 2 * GFitsImageFloat.cpp - Single precision FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2013 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -162,17 +162,16 @@ GFitsImageFloat::GFitsImageFloat(const int&amp; nx, const int&amp; ny, const int&amp; nz,
162 162 /***********************************************************************//**
163 163 * @brief Pixel array constructor
164 164 *
165   - * @param[in] naxis Image dimension (0,1,2,3,4).
166   - * @param[in] naxes Number of pixels in each dimension.
  165 + * @param[in] naxes Vector of number of pixels in each dimension.
167 166 * @param[in] pixels Optional pointer to image pixel array
168 167 *
169 168 * Construct instance of GFitsImageFloat by specifying the image dimension and
170 169 * the number of pixels in each dimension. Note that this constructor does
171 170 * not allocate any memory for the actual image.
172 171 ***************************************************************************/
173   -GFitsImageFloat::GFitsImageFloat(const int& naxis, const int* naxes,
174   - const float* pixels) :
175   - GFitsImage(G_BITPIX, naxis, naxes)
  172 +GFitsImageFloat::GFitsImageFloat(const std::vector<int>& naxes,
  173 + const float* pixels) :
  174 + GFitsImage(G_BITPIX, naxes)
176 175 {
177 176 // Initialise class members for clean destruction
178 177 init_members();
... ...
src/fits/GFitsImageLong.cpp
1 1 /***************************************************************************
2 2 * GFitsImageLong.cpp - Long integer FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2013 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -161,17 +161,16 @@ GFitsImageLong::GFitsImageLong(const int&amp; nx, const int&amp; ny, const int&amp; nz,
161 161 /***********************************************************************//**
162 162 * @brief Pixel array constructor
163 163 *
164   - * @param[in] naxis Image dimension (0,1,2,3,4).
165   - * @param[in] naxes Number of pixels in each dimension.
  164 + * @param[in] naxes Vector of number of pixels in each dimension.
166 165 * @param[in] pixels Optional pointer to image pixel array
167 166 *
168 167 * Construct instance of GFitsImageLong by specifying the image dimension and
169 168 * the number of pixels in each dimension. Note that this constructor does
170 169 * not allocate any memory for the actual image.
171 170 ***************************************************************************/
172   -GFitsImageLong::GFitsImageLong(const int& naxis, const int* naxes,
173   - const long* pixels) :
174   - GFitsImage(G_BITPIX, naxis, naxes)
  171 +GFitsImageLong::GFitsImageLong(const std::vector<int>& naxes,
  172 + const long* pixels) :
  173 + GFitsImage(G_BITPIX, naxes)
175 174 {
176 175 // Initialise class members for clean destruction
177 176 init_members();
... ...
src/fits/GFitsImageLongLong.cpp
1 1 /***************************************************************************
2 2 * GFitsImageLongLong.cpp - Long long integer FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2013 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -164,17 +164,16 @@ GFitsImageLongLong::GFitsImageLongLong(const int&amp; nx, const int&amp; ny,
164 164 /***********************************************************************//**
165 165 * @brief Pixel array constructor
166 166 *
167   - * @param[in] naxis Image dimension (0,1,2,3,4).
168   - * @param[in] naxes Number of pixels in each dimension.
  167 + * @param[in] naxes Vector of number of pixels in each dimension.
169 168 * @param[in] pixels Optional pointer to image pixel array
170 169 *
171 170 * Construct instance of GFitsImageLongLong by specifying the image dimension and
172 171 * the number of pixels in each dimension. Note that this constructor does
173 172 * not allocate any memory for the actual image.
174 173 ***************************************************************************/
175   -GFitsImageLongLong::GFitsImageLongLong(const int& naxis, const int* naxes,
176   - const long long* pixels) :
177   - GFitsImage(G_BITPIX, naxis, naxes)
  174 +GFitsImageLongLong::GFitsImageLongLong(const std::vector<int>& naxes,
  175 + const long long* pixels) :
  176 + GFitsImage(G_BITPIX, naxes)
178 177 {
179 178 // Initialise class members for clean destruction
180 179 init_members();
... ...
src/fits/GFitsImageSByte.cpp
1 1 /***************************************************************************
2 2 * GFitsImageSByte.cpp - Signed Byte FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2013 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -163,17 +163,16 @@ GFitsImageSByte::GFitsImageSByte(const int&amp; nx, const int&amp; ny, const int&amp; nz,
163 163 /***********************************************************************//**
164 164 * @brief Pixel array constructor
165 165 *
166   - * @param[in] naxis Image dimension (0,1,2,3,4).
167   - * @param[in] naxes Number of pixels in each dimension.
  166 + * @param[in] naxes Vector of number of pixels in each dimension.
168 167 * @param[in] pixels Optional pointer to image pixel array
169 168 *
170 169 * Construct instance of GFitsImageSByte by specifying the image dimension and
171 170 * the number of pixels in each dimension. Note that this constructor does
172 171 * not allocate any memory for the actual image.
173 172 ***************************************************************************/
174   -GFitsImageSByte::GFitsImageSByte(const int& naxis, const int* naxes,
175   - const char* pixels) :
176   - GFitsImage(G_BITPIX, naxis, naxes)
  173 +GFitsImageSByte::GFitsImageSByte(const std::vector<int>& naxes,
  174 + const char* pixels) :
  175 + GFitsImage(G_BITPIX, naxes)
177 176 {
178 177 // Initialise class members for clean destruction
179 178 init_members();
... ...
src/fits/GFitsImageShort.cpp
1 1 /***************************************************************************
2 2 * GFitsImageShort.cpp - Short integer FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2013 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -162,17 +162,16 @@ GFitsImageShort::GFitsImageShort(const int&amp; nx, const int&amp; ny, const int&amp; nz,
162 162 /***********************************************************************//**
163 163 * @brief Pixel array constructor
164 164 *
165   - * @param[in] naxis Image dimension (0,1,2,3,4).
166   - * @param[in] naxes Number of pixels in each dimension.
  165 + * @param[in] naxes Vector of number of pixels in each dimension.
167 166 * @param[in] pixels Optional pointer to image pixel array
168 167 *
169 168 * Construct instance of GFitsImageShort by specifying the image dimension and
170 169 * the number of pixels in each dimension. Note that this constructor does
171 170 * not allocate any memory for the actual image.
172 171 ***************************************************************************/
173   -GFitsImageShort::GFitsImageShort(const int& naxis, const int* naxes,
174   - const short* pixels) :
175   - GFitsImage(G_BITPIX, naxis, naxes)
  172 +GFitsImageShort::GFitsImageShort(const std::vector<int>& naxes,
  173 + const short* pixels) :
  174 + GFitsImage(G_BITPIX, naxes)
176 175 {
177 176 // Initialise class members for clean destruction
178 177 init_members();
... ...
src/fits/GFitsImageULong.cpp
1 1 /***************************************************************************
2 2 * GFitsImageULong.cpp - Unsigned long image FITS class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2013 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -163,17 +163,16 @@ GFitsImageULong::GFitsImageULong(const int&amp; nx, const int&amp; ny, const int&amp; nz,
163 163 /***********************************************************************//**
164 164 * @brief Pixel array constructor
165 165 *
166   - * @param[in] naxis Image dimension (0,1,2,3,4).
167   - * @param[in] naxes Number of pixels in each dimension.
  166 + * @param[in] naxes Vector of number of pixels in each dimension.
168 167 * @param[in] pixels Optional pointer to image pixel array
169 168 *
170 169 * Construct instance of GFitsImageULong by specifying the image dimension and
171 170 * the number of pixels in each dimension. Note that this constructor does
172 171 * not allocate any memory for the actual image.
173 172 ***************************************************************************/
174   -GFitsImageULong::GFitsImageULong(const int& naxis, const int* naxes,
175   - const unsigned long* pixels) :
176   - GFitsImage(G_BITPIX, naxis, naxes)
  173 +GFitsImageULong::GFitsImageULong(const std::vector<int>& naxes,
  174 + const unsigned long* pixels) :
  175 + GFitsImage(G_BITPIX, naxes)
177 176 {
178 177 // Initialise class members for clean destruction
179 178 init_members();
... ...
src/fits/GFitsImageUShort.cpp
1 1 /***************************************************************************
2 2 * GFitsImageUShort.cpp - Unsigned short FITS image class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-2013 by Juergen Knoedlseder *
  4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -164,17 +164,16 @@ GFitsImageUShort::GFitsImageUShort(const int&amp; nx, const int&amp; ny,
164 164 /***********************************************************************//**
165 165 * @brief Pixel array constructor
166 166 *
167   - * @param[in] naxis Image dimension (0,1,2,3,4).
168   - * @param[in] naxes Number of pixels in each dimension.
  167 + * @param[in] naxes Vector of number of pixels in each dimension.
169 168 * @param[in] pixels Optional pointer to image pixel array
170 169 *
171 170 * Construct instance of GFitsImageUShort by specifying the image dimension and
172 171 * the number of pixels in each dimension. Note that this constructor does
173 172 * not allocate any memory for the actual image.
174 173 ***************************************************************************/
175   -GFitsImageUShort::GFitsImageUShort(const int& naxis, const int* naxes,
176   - const unsigned short* pixels) :
177   - GFitsImage(G_BITPIX, naxis, naxes)
  174 +GFitsImageUShort::GFitsImageUShort(const std::vector<int>& naxes,
  175 + const unsigned short* pixels) :
  176 + GFitsImage(G_BITPIX, naxes)
178 177 {
179 178 // Initialise class members for clean destruction
180 179 init_members();
... ...
src/sky/GSkyMap.cpp
... ... @@ -2731,26 +2731,19 @@ GFitsImageDouble* GSkyMap::create_wcs_hdu(void) const
2731 2731 // Continue only if we have pixels
2732 2732 if (size > 0) {
2733 2733  
2734   - // Set axis parameters for image construction
2735   - int naxis = (m_num_maps == 1) ? 2 : 2 + ndim();
2736   -
2737   - // Set dimensions of all axes
2738   - //int* naxes = new int[naxis];
2739   - int naxes[256];
2740   - naxes[0] = m_num_x;
2741   - naxes[1] = m_num_y;
  2734 + // Set dimension vector of all axes
  2735 + std::vector<int> naxes;
  2736 + naxes.push_back(m_num_x);
  2737 + naxes.push_back(m_num_y);
2742 2738 for (int i = 0; i < ndim(); ++i) {
2743   - naxes[2+i] = m_shape[i];
  2739 + naxes.push_back(m_shape[i]);
2744 2740 }
2745 2741  
2746 2742 // Allocate image
2747   - hdu = new GFitsImageDouble(naxis, naxes);
2748   -
2749   - // Free dimensions of all axes
2750   - //delete [] naxes;
  2743 + hdu = new GFitsImageDouble(naxes);
2751 2744  
2752 2745 // Store data in image
2753   - if (naxis == 2) {
  2746 + if (naxes.size() == 2) {
2754 2747 double* ptr = m_pixels;
2755 2748 for (int iy = 0; iy < m_num_y; ++iy) {
2756 2749 for (int ix = 0; ix < m_num_x; ++ix) {
... ...
test/test_GFits.cpp
1 1 /***************************************************************************
2 2 * test_GFits.cpp - test FITS classes *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2008-2013 by Juergen Knoedlseder *
  4 + * copyright (C) 2008-2016 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -456,8 +456,10 @@ void TestGFits::test_create(void)
456 456 int naxis = 2;
457 457 int nx = 10;
458 458 int ny = 20;
459   - int naxes[] = {nx,ny};
460   - GFitsImageDouble image(naxis, naxes);
  459 + std::vector<int> naxes;
  460 + naxes.push_back(nx);
  461 + naxes.push_back(ny);
  462 + GFitsImageDouble image(naxes);
461 463 for (int ix = 0; ix < nx; ++ix) {
462 464 for (int iy = 0; iy < ny; ++iy) {
463 465 image(ix,iy) = 0.01*ix + 0.01*iy;
... ... @@ -730,8 +732,12 @@ void TestGFits::test_image_byte(void)
730 732 TEST_4D_ACCESS(2,2,2,2)
731 733  
732 734 // Test image I/O with 4D image
733   - int naxes[] = {2,2,2,2};
734   - GFitsImageByte image(4, naxes, pixels);
  735 + std::vector<int> naxes;
  736 + naxes.push_back(2);
  737 + naxes.push_back(2);
  738 + naxes.push_back(2);
  739 + naxes.push_back(2);
  740 + GFitsImageByte image(naxes, pixels);
735 741  
736 742 // Save image
737 743 GFits fits(filename, true);
... ... @@ -786,8 +792,12 @@ void TestGFits::test_image_ushort(void)
786 792 TEST_4D_ACCESS(2,2,2,2)
787 793  
788 794 // Test image I/O with 4D image
789   - int naxes[] = {2,2,2,2};
790   - GFitsImageUShort image(4, naxes, pixels);
  795 + std::vector<int> naxes;
  796 + naxes.push_back(2);
  797 + naxes.push_back(2);
  798 + naxes.push_back(2);
  799 + naxes.push_back(2);
  800 + GFitsImageUShort image(naxes, pixels);
791 801  
792 802 // Save image
793 803 GFits fits(filename, true);
... ... @@ -841,8 +851,12 @@ void TestGFits::test_image_short(void)
841 851 TEST_4D_ACCESS(2,2,2,2)
842 852  
843 853 // Test image I/O with 4D image
844   - int naxes[] = {2,2,2,2};
845   - GFitsImageShort image(4, naxes, pixels);
  854 + std::vector<int> naxes;
  855 + naxes.push_back(2);
  856 + naxes.push_back(2);
  857 + naxes.push_back(2);
  858 + naxes.push_back(2);
  859 + GFitsImageShort image(naxes, pixels);
846 860  
847 861 // Save image
848 862 GFits fits(filename, true);
... ... @@ -896,8 +910,12 @@ void TestGFits::test_image_ulong(void)
896 910 TEST_4D_ACCESS(2,2,2,2)
897 911  
898 912 // Test image I/O with 4D image
899   - int naxes[] = {2,2,2,2};
900   - GFitsImageULong image(4, naxes, pixels);
  913 + std::vector<int> naxes;
  914 + naxes.push_back(2);
  915 + naxes.push_back(2);
  916 + naxes.push_back(2);
  917 + naxes.push_back(2);
  918 + GFitsImageULong image(naxes, pixels);
901 919  
902 920 // Save image
903 921 GFits fits(filename, true);
... ... @@ -951,8 +969,12 @@ void TestGFits::test_image_long(void)
951 969 TEST_4D_ACCESS(2,2,2,2)
952 970  
953 971 // Test image I/O with 4D image
954   - int naxes[] = {2,2,2,2};
955   - GFitsImageLong image(4, naxes, pixels);
  972 + std::vector<int> naxes;
  973 + naxes.push_back(2);
  974 + naxes.push_back(2);
  975 + naxes.push_back(2);
  976 + naxes.push_back(2);
  977 + GFitsImageLong image(naxes, pixels);
956 978  
957 979 // Save image
958 980 GFits fits(filename, true);
... ... @@ -1006,8 +1028,12 @@ void TestGFits::test_image_longlong(void)
1006 1028 TEST_4D_ACCESS(2,2,2,2)
1007 1029  
1008 1030 // Test image I/O with 4D image
1009   - int naxes[] = {2,2,2,2};
1010   - GFitsImageLongLong image(4, naxes, pixels);
  1031 + std::vector<int> naxes;
  1032 + naxes.push_back(2);
  1033 + naxes.push_back(2);
  1034 + naxes.push_back(2);
  1035 + naxes.push_back(2);
  1036 + GFitsImageLongLong image(naxes, pixels);
1011 1037  
1012 1038 // Save image
1013 1039 GFits fits(filename, true);
... ... @@ -1060,8 +1086,12 @@ void TestGFits::test_image_float(void)
1060 1086 TEST_4D_ACCESS(2,2,2,2)
1061 1087  
1062 1088 // Test image I/O with 4D image
1063   - int naxes[] = {2,2,2,2};
1064   - GFitsImageFloat image(4, naxes, pixels);
  1089 + std::vector<int> naxes;
  1090 + naxes.push_back(2);
  1091 + naxes.push_back(2);
  1092 + naxes.push_back(2);
  1093 + naxes.push_back(2);
  1094 + GFitsImageFloat image(naxes, pixels);
1065 1095  
1066 1096 // Save image
1067 1097 GFits fits(filename, true);
... ... @@ -1115,8 +1145,12 @@ void TestGFits::test_image_double(void)
1115 1145 TEST_4D_ACCESS(2,2,2,2)
1116 1146  
1117 1147 // Test image I/O with 4D image
1118   - int naxes[] = {2,2,2,2};
1119   - GFitsImageDouble image(4, naxes, pixels);
  1148 + std::vector<int> naxes;
  1149 + naxes.push_back(2);
  1150 + naxes.push_back(2);
  1151 + naxes.push_back(2);
  1152 + naxes.push_back(2);
  1153 + GFitsImageDouble image(naxes, pixels);
1120 1154  
1121 1155 // Save image
1122 1156 GFits fits(filename, true);
... ...