diff --git a/ChangeLog b/ChangeLog index 7ffd8b4..3e3730c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * Version 1.1.0 released ========================= + Use std::vector for naxes argument in GFitsImage (#1779). GCTACubePsf and GCTACubeEdisp now save 4D images. Change interpolation scheme in GCTABackground3D. Add GCsv::append() method (#1773). diff --git a/NEWS b/NEWS index bc25cf2..2e30ed8 100644 --- a/NEWS +++ b/NEWS @@ -103,6 +103,18 @@ The return value has been changed for the following methods: - GFits::filename() returns now GFilename instead of std::string - GCTAObservation::eventtype() returns now std::string instead of const std::string& +The interface for the following methods has been changed: +- GFitsImage naxes constructor +- GFitsImageByte naxes constructor +- GFitsImageDouble naxes constructor +- GFitsImageFloat naxes constructor +- GFitsImageLong naxes constructor +- GFitsImageLongLong naxes constructor +- GFitsImageSByte naxes constructor +- GFitsImageShort naxes constructor +- GFitsImageULong naxes constructor +- GFitsImageUShort naxes constructor + 3. Configuration ----------------- @@ -133,6 +145,9 @@ FITS column. GFits now uses the GFilename class to store the FITS filename (fixes #1649). +The GFitsImage naxes constructor now takes a std::vector as argument instead +of a pointer to an array and a dimension (#1779). + 7. Linear algebra module ------------------------ diff --git a/include/GFitsImage.hpp b/include/GFitsImage.hpp index 7cea1a9..fbb15b9 100644 --- a/include/GFitsImage.hpp +++ b/include/GFitsImage.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImage.hpp - Abstract FITS image base class * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2014 by Juergen Knoedlseder * + * copyright (C) 2008-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -28,6 +28,8 @@ #define GFITSIMAGE_HPP /* __ Includes ___________________________________________________________ */ +#include +#include #include "GFitsHDU.hpp" @@ -47,7 +49,7 @@ public: GFitsImage(const int& bitpix, const int& nx, const int& ny); GFitsImage(const int& bitpix, const int& nx, const int& ny, const int& nz); GFitsImage(const int& bitpix, const int& nx, const int& ny, const int& nz, const int& nt); - GFitsImage(const int& bitpix, const int& naxis, const int* naxes); + GFitsImage(const int& bitpix, const std::vector& naxes); GFitsImage(const GFitsImage& image); virtual ~GFitsImage(void); diff --git a/include/GFitsImageByte.hpp b/include/GFitsImageByte.hpp index ca3e919..ffc11a6 100644 --- a/include/GFitsImageByte.hpp +++ b/include/GFitsImageByte.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageByte.hpp - FITS Byte image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2014 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: GFitsImageByte(const int& nx, const int& ny, const unsigned char* pixels = NULL); GFitsImageByte(const int& nx, const int& ny, const int& nz, const unsigned char* pixels = NULL); GFitsImageByte(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned char* pixels = NULL); - GFitsImageByte(const int& naxis, const int* naxes, const unsigned char* pixels = NULL); + GFitsImageByte(const std::vector& naxes, const unsigned char* pixels = NULL); GFitsImageByte(const GFitsImageByte& image); virtual ~GFitsImageByte(void); diff --git a/include/GFitsImageDouble.hpp b/include/GFitsImageDouble.hpp index 11289df..7908c59 100644 --- a/include/GFitsImageDouble.hpp +++ b/include/GFitsImageDouble.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageDouble.hpp - Double precision FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2014 by Juergen Knoedlseder * + * copyright (C) 2008-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: GFitsImageDouble(const int& nx, const int& ny, const double* pixels = NULL); GFitsImageDouble(const int& nx, const int& ny, const int& nz, const double* pixels = NULL); GFitsImageDouble(const int& nx, const int& ny, const int& nz, const int& nt, const double* pixels = NULL); - GFitsImageDouble(const int& naxis, const int* naxes, const double* pixels = NULL); + GFitsImageDouble(const std::vector& naxes, const double* pixels = NULL); GFitsImageDouble(const GFitsImageDouble& image); virtual ~GFitsImageDouble(void); diff --git a/include/GFitsImageFloat.hpp b/include/GFitsImageFloat.hpp index 84424bf..ccc1eec 100644 --- a/include/GFitsImageFloat.hpp +++ b/include/GFitsImageFloat.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageFloat.hpp - Single precision FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2014 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: GFitsImageFloat(const int& nx, const int& ny, const float* pixels = NULL); GFitsImageFloat(const int& nx, const int& ny, const int& nz, const float* pixels = NULL); GFitsImageFloat(const int& nx, const int& ny, const int& nz, const int& nt, const float* pixels = NULL); - GFitsImageFloat(const int& naxis, const int* naxes, const float* pixels = NULL); + GFitsImageFloat(const std::vector& naxes, const float* pixels = NULL); GFitsImageFloat(const GFitsImageFloat& image); virtual ~GFitsImageFloat(void); diff --git a/include/GFitsImageLong.hpp b/include/GFitsImageLong.hpp index 6d75a40..6ca6f45 100644 --- a/include/GFitsImageLong.hpp +++ b/include/GFitsImageLong.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageLong.hpp - Long integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2014 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: GFitsImageLong(const int& nx, const int& ny, const long* pixels = NULL); GFitsImageLong(const int& nx, const int& ny, const int& nz, const long* pixels = NULL); GFitsImageLong(const int& nx, const int& ny, const int& nz, const int& nt, const long* pixels = NULL); - GFitsImageLong(const int& naxis, const int* naxes, const long* pixels = NULL); + GFitsImageLong(const std::vector& naxes, const long* pixels = NULL); GFitsImageLong(const GFitsImageLong& image); virtual ~GFitsImageLong(void); diff --git a/include/GFitsImageLongLong.hpp b/include/GFitsImageLongLong.hpp index a3ad12e..1666032 100644 --- a/include/GFitsImageLongLong.hpp +++ b/include/GFitsImageLongLong.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageLongLong.hpp - Long long integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2014 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: GFitsImageLongLong(const int& nx, const int& ny, const long long* pixels = NULL); GFitsImageLongLong(const int& nx, const int& ny, const int& nz, const long long* pixels = NULL); GFitsImageLongLong(const int& nx, const int& ny, const int& nz, const int& nt, const long long* pixels = NULL); - GFitsImageLongLong(const int& naxis, const int* naxes, const long long* pixels = NULL); + GFitsImageLongLong(const std::vector& naxes, const long long* pixels = NULL); GFitsImageLongLong(const GFitsImageLongLong& image); virtual ~GFitsImageLongLong(void); diff --git a/include/GFitsImageSByte.hpp b/include/GFitsImageSByte.hpp index 7818df1..5890c54 100644 --- a/include/GFitsImageSByte.hpp +++ b/include/GFitsImageSByte.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageSByte.hpp - Signed Byte FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2014 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: GFitsImageSByte(const int& nx, const int& ny, const char* pixels = NULL); GFitsImageSByte(const int& nx, const int& ny, const int& nz, const char* pixels = NULL); GFitsImageSByte(const int& nx, const int& ny, const int& nz, const int& nt, const char* pixels = NULL); - GFitsImageSByte(const int& naxis, const int* naxes, const char* pixels = NULL); + GFitsImageSByte(const std::vector& naxes, const char* pixels = NULL); GFitsImageSByte(const GFitsImageSByte& image); virtual ~GFitsImageSByte(void); diff --git a/include/GFitsImageShort.hpp b/include/GFitsImageShort.hpp index 708e2e2..9c0cc1d 100644 --- a/include/GFitsImageShort.hpp +++ b/include/GFitsImageShort.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageShort.hpp - Short integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2014 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: GFitsImageShort(const int& nx, const int& ny, const short* pixels = NULL); GFitsImageShort(const int& nx, const int& ny, const int& nz, const short* pixels = NULL); GFitsImageShort(const int& nx, const int& ny, const int& nz, const int& nt, const short* pixels = NULL); - GFitsImageShort(const int& naxis, const int* naxes, const short* pixels = NULL); + GFitsImageShort(const std::vector& naxes, const short* pixels = NULL); GFitsImageShort(const GFitsImageShort& image); virtual ~GFitsImageShort(void); diff --git a/include/GFitsImageULong.hpp b/include/GFitsImageULong.hpp index 9b86665..1ba01b4 100644 --- a/include/GFitsImageULong.hpp +++ b/include/GFitsImageULong.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageULong.hpp - Unsigned long image FITS class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2014 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: GFitsImageULong(const int& nx, const int& ny, const unsigned long* pixels = NULL); GFitsImageULong(const int& nx, const int& ny, const int& nz, const unsigned long* pixels = NULL); GFitsImageULong(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned long* pixels = NULL); - GFitsImageULong(const int& naxis, const int* naxes, const unsigned long* pixels = NULL); + GFitsImageULong(const std::vector& naxes, const unsigned long* pixels = NULL); GFitsImageULong(const GFitsImageULong& image); virtual ~GFitsImageULong(void); diff --git a/include/GFitsImageUShort.hpp b/include/GFitsImageUShort.hpp index f739a33..0dd7d3b 100644 --- a/include/GFitsImageUShort.hpp +++ b/include/GFitsImageUShort.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageUShort.hpp - Unsigned short FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2014 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -45,7 +45,7 @@ public: GFitsImageUShort(const int& nx, const int& ny, const unsigned short* pixels = NULL); GFitsImageUShort(const int& nx, const int& ny, const int& nz, const unsigned short* pixels = NULL); GFitsImageUShort(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned short* pixels = NULL); - GFitsImageUShort(const int& naxis, const int* naxes, const unsigned short* pixels = NULL); + GFitsImageUShort(const std::vector& naxes, const unsigned short* pixels = NULL); GFitsImageUShort(const GFitsImageUShort& image); virtual ~GFitsImageUShort(void); diff --git a/pyext/GFitsImage.i b/pyext/GFitsImage.i index 8c35afe..1f79589 100644 --- a/pyext/GFitsImage.i +++ b/pyext/GFitsImage.i @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImage.i - Abstract FITS image base class * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2015 by Juergen Knoedlseder * + * copyright (C) 2008-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -37,6 +37,13 @@ #include "GFitsImageUShort.hpp" #include "GTools.hpp" %} +/* +%include "std_vector.i" +namespace std { + %template(FitsImageIntVector) vector; +} +*/ + /***********************************************************************//** * @brief Tuple to index conversion to provide pixel access. @@ -100,7 +107,7 @@ public: GFitsImage(const int& bitpix, const int& nx, const int& ny); GFitsImage(const int& bitpix, const int& nx, const int& ny, const int& nz); GFitsImage(const int& bitpix, const int& nx, const int& ny, const int& nz, const int& nt); - GFitsImage(const int& bitpix, const int& naxis, const int* naxes); + GFitsImage(const int& bitpix, const std::vector& naxes); GFitsImage(const GFitsImage& image); virtual ~GFitsImage(void); diff --git a/pyext/GFitsImageByte.i b/pyext/GFitsImageByte.i index 9822c6c..052be0e 100644 --- a/pyext/GFitsImageByte.i +++ b/pyext/GFitsImageByte.i @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageByte.i - FITS Byte image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -29,6 +29,7 @@ #include "GException.hpp" %} + /***********************************************************************//** * @class GFitsImageByte * @@ -42,7 +43,7 @@ public: GFitsImageByte(const int& nx, const int& ny, const unsigned char* pixels = NULL); GFitsImageByte(const int& nx, const int& ny, const int& nz, const unsigned char* pixels = NULL); GFitsImageByte(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned char* pixels = NULL); - GFitsImageByte(const int& naxis, const int* naxes, const unsigned char* pixels = NULL); + GFitsImageByte(const std::vector& naxes, const unsigned char* pixels = NULL); GFitsImageByte(const GFitsImageByte& image); virtual ~GFitsImageByte(void); diff --git a/pyext/GFitsImageDouble.i b/pyext/GFitsImageDouble.i index 5799b9c..ed8f142 100644 --- a/pyext/GFitsImageDouble.i +++ b/pyext/GFitsImageDouble.i @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageDouble.i - Double precision FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -43,7 +43,7 @@ public: GFitsImageDouble(const int& nx, const int& ny, const double* pixels = NULL); GFitsImageDouble(const int& nx, const int& ny, const int& nz, const double* pixels = NULL); GFitsImageDouble(const int& nx, const int& ny, const int& nz, const int& nt, const double* pixels = NULL); - GFitsImageDouble(const int& naxis, const int* naxes, const double* pixels = NULL); + GFitsImageDouble(const std::vector& naxes, const double* pixels = NULL); GFitsImageDouble(const GFitsImageDouble& image); virtual ~GFitsImageDouble(void); diff --git a/pyext/GFitsImageFloat.i b/pyext/GFitsImageFloat.i index d8402b1..64fe9f9 100644 --- a/pyext/GFitsImageFloat.i +++ b/pyext/GFitsImageFloat.i @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageFloat.i - Single precision FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -43,7 +43,7 @@ public: GFitsImageFloat(const int& nx, const int& ny, const float* pixels = NULL); GFitsImageFloat(const int& nx, const int& ny, const int& nz, const float* pixels = NULL); GFitsImageFloat(const int& nx, const int& ny, const int& nz, const int& nt, const float* pixels = NULL); - GFitsImageFloat(const int& naxis, const int* naxes, const float* pixels = NULL); + GFitsImageFloat(const std::vector& naxes, const float* pixels = NULL); GFitsImageFloat(const GFitsImageFloat& image); virtual ~GFitsImageFloat(void); diff --git a/pyext/GFitsImageLong.i b/pyext/GFitsImageLong.i index be4d30f..3fdc134 100644 --- a/pyext/GFitsImageLong.i +++ b/pyext/GFitsImageLong.i @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageLong.i - Long integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -43,7 +43,7 @@ public: GFitsImageLong(const int& nx, const int& ny, const long* pixels = NULL); GFitsImageLong(const int& nx, const int& ny, const int& nz, const long* pixels = NULL); GFitsImageLong(const int& nx, const int& ny, const int& nz, const int& nt, const long* pixels = NULL); - GFitsImageLong(const int& naxis, const int* naxes, const long* pixels = NULL); + GFitsImageLong(const std::vector& naxes, const long* pixels = NULL); GFitsImageLong(const GFitsImageLong& image); virtual ~GFitsImageLong(void); diff --git a/pyext/GFitsImageLongLong.i b/pyext/GFitsImageLongLong.i index aa64f18..88e1016 100644 --- a/pyext/GFitsImageLongLong.i +++ b/pyext/GFitsImageLongLong.i @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageLongLong.i - Long long integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -43,7 +43,7 @@ public: GFitsImageLongLong(const int& nx, const int& ny, const long long* pixels = NULL); GFitsImageLongLong(const int& nx, const int& ny, const int& nz, const long long* pixels = NULL); GFitsImageLongLong(const int& nx, const int& ny, const int& nz, const int& nt, const long long* pixels = NULL); - GFitsImageLongLong(const int& naxis, const int* naxes, const long long* pixels = NULL); + GFitsImageLongLong(const std::vector& naxes, const long long* pixels = NULL); GFitsImageLongLong(const GFitsImageLongLong& image); virtual ~GFitsImageLongLong(void); diff --git a/pyext/GFitsImageSByte.i b/pyext/GFitsImageSByte.i index baa5e57..4157f14 100644 --- a/pyext/GFitsImageSByte.i +++ b/pyext/GFitsImageSByte.i @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageSByte.i - Signed Byte FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -43,7 +43,7 @@ public: GFitsImageSByte(const int& nx, const int& ny, const char* pixels = NULL); GFitsImageSByte(const int& nx, const int& ny, const int& nz, const char* pixels = NULL); GFitsImageSByte(const int& nx, const int& ny, const int& nz, const int& nt, const char* pixels = NULL); - GFitsImageSByte(const int& naxis, const int* naxes, const char* pixels = NULL); + GFitsImageSByte(const std::vector& naxes, const char* pixels = NULL); GFitsImageSByte(const GFitsImageSByte& image); virtual ~GFitsImageSByte(void); diff --git a/pyext/GFitsImageShort.i b/pyext/GFitsImageShort.i index e413452..89f19c5 100644 --- a/pyext/GFitsImageShort.i +++ b/pyext/GFitsImageShort.i @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageShort.i - Short integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -43,7 +43,7 @@ public: GFitsImageShort(const int& nx, const int& ny, const short* pixels = NULL); GFitsImageShort(const int& nx, const int& ny, const int& nz, const short* pixels = NULL); GFitsImageShort(const int& nx, const int& ny, const int& nz, const int& nt, const short* pixels = NULL); - GFitsImageShort(const int& naxis, const int* naxes, const short* pixels = NULL); + GFitsImageShort(const std::vector& naxes, const short* pixels = NULL); GFitsImageShort(const GFitsImageShort& image); virtual ~GFitsImageShort(void); diff --git a/pyext/GFitsImageULong.i b/pyext/GFitsImageULong.i index 072907a..ae384f1 100644 --- a/pyext/GFitsImageULong.i +++ b/pyext/GFitsImageULong.i @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageULong.i - Unsigned long image FITS class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -43,7 +43,7 @@ public: GFitsImageULong(const int& nx, const int& ny, const unsigned long* pixels = NULL); GFitsImageULong(const int& nx, const int& ny, const int& nz, const unsigned long* pixels = NULL); GFitsImageULong(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned long* pixels = NULL); - GFitsImageULong(const int& naxis, const int* naxes, const unsigned long* pixels = NULL); + GFitsImageULong(const std::vector& naxes, const unsigned long* pixels = NULL); GFitsImageULong(const GFitsImageULong& image); virtual ~GFitsImageULong(void); diff --git a/pyext/GFitsImageUShort.i b/pyext/GFitsImageUShort.i index b50a5ff..85c1abf 100644 --- a/pyext/GFitsImageUShort.i +++ b/pyext/GFitsImageUShort.i @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageUShort.i - Unsigned short FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -44,7 +44,7 @@ public: GFitsImageUShort(const int& nx, const int& ny, const unsigned short* pixels = NULL); GFitsImageUShort(const int& nx, const int& ny, const int& nz, const unsigned short* pixels = NULL); GFitsImageUShort(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned short* pixels = NULL); - GFitsImageUShort(const int& naxis, const int* naxes, const unsigned short* pixels = NULL); + GFitsImageUShort(const std::vector& naxes, const unsigned short* pixels = NULL); GFitsImageUShort(const GFitsImageUShort& image); virtual ~GFitsImageUShort(void); diff --git a/pyext/GHealpix.i b/pyext/GHealpix.i index d091c05..949f189 100644 --- a/pyext/GHealpix.i +++ b/pyext/GHealpix.i @@ -1,7 +1,7 @@ /*************************************************************************** * GHealpix.i - Healpix projection class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2015 by Jurgen Knodlseder * + * copyright (C) 2010-2016 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -27,13 +27,6 @@ /* Put headers and other declarations here that are needed for compilation */ #include "GHealpix.hpp" %} -%include "std_vector.i" -namespace std { - %template(SkyDirVector) vector; -} -namespace std { - %template(IntVector) vector; -} /***********************************************************************//** diff --git a/pyext/GSkyMap.i b/pyext/GSkyMap.i index 030f9b0..526c481 100644 --- a/pyext/GSkyMap.i +++ b/pyext/GSkyMap.i @@ -28,10 +28,6 @@ #include "GSkyMap.hpp" #include "GTools.hpp" %} -%include "std_vector.i" -namespace std { - %template(IntVector) vector; -} /***********************************************************************//** diff --git a/pyext/gammalib/fits.i b/pyext/gammalib/fits.i index bff55fb..17ebabd 100644 --- a/pyext/gammalib/fits.i +++ b/pyext/gammalib/fits.i @@ -38,6 +38,11 @@ /* __ Include standard typemaps for vectors and strings __________________ */ %include stl.i +%include "std_vector.i" +namespace std { + %template(vectori) vector; + %template(vectord) vector; +}; /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i diff --git a/pyext/gammalib/sky.i b/pyext/gammalib/sky.i index c0cecbf..6b0d965 100644 --- a/pyext/gammalib/sky.i +++ b/pyext/gammalib/sky.i @@ -34,10 +34,17 @@ #include #include "GException.hpp" #include "GTools.hpp" +#include "GSkyDir.hpp" %} /* __ Include standard typemaps for vectors and strings __________________ */ %include stl.i +%include "std_vector.i" +namespace std { + %template(vectori) vector; + %template(vectord) vector; + %template(vectorskydir) vector; +}; /* __ Include GammaLib typemaps __________________________________________ */ %include typemap_GFilename.i diff --git a/src/fits/GFitsImage.cpp b/src/fits/GFitsImage.cpp index 0fbffaf..240b908 100644 --- a/src/fits/GFitsImage.cpp +++ b/src/fits/GFitsImage.cpp @@ -224,15 +224,13 @@ GFitsImage::GFitsImage(const int& bitpix, const int& nx, const int& ny, * @brief Constructor * * @param[in] bitpix Number of Bits per pixel (negative is floating point). - * @param[in] naxis Image dimensions [0,1,2,3,4]. - * @param[in] naxes Pointer to array giving number of pixels in each dimension. + * @param[in] naxes Vector of number of pixels in each dimension. * * Construct instance of GFitsImage by specifying the image dimension and * the number of pixels in each dimension. This method also adds the relevant * header cards. ***************************************************************************/ -GFitsImage::GFitsImage(const int& bitpix, const int& naxis, - const int* naxes) : GFitsHDU() +GFitsImage::GFitsImage(const int& bitpix, const std::vector& naxes) : GFitsHDU() { // Initialise class members for clean destruction init_members(); @@ -241,7 +239,7 @@ GFitsImage::GFitsImage(const int& bitpix, const int& naxis, m_bitpix = bitpix; // Store number of axes - m_naxis = naxis; + m_naxis = naxes.size(); // Copy number of pixels in each dimension and calculate the total // number of pixels diff --git a/src/fits/GFitsImageByte.cpp b/src/fits/GFitsImageByte.cpp index da42abd..4d0988f 100644 --- a/src/fits/GFitsImageByte.cpp +++ b/src/fits/GFitsImageByte.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageByte.cpp - FITS Byte image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2013 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -162,17 +162,16 @@ GFitsImageByte::GFitsImageByte(const int& nx, const int& ny, const int& nz, /***********************************************************************//** * @brief Pixel array constructor * - * @param[in] naxis Image dimension (0,1,2,3,4). - * @param[in] naxes Number of pixels in each dimension. + * @param[in] naxes Vector of number of pixels in each dimension. * @param[in] pixels Optional pointer to image pixel array * * Construct instance of GFitsImageByte by specifying the image dimension and * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageByte::GFitsImageByte(const int& naxis, const int* naxes, - const unsigned char* pixels) : - GFitsImage(G_BITPIX, naxis, naxes) +GFitsImageByte::GFitsImageByte(const std::vector& naxes, + const unsigned char* pixels) : + GFitsImage(G_BITPIX, naxes) { // Initialise class members for clean destruction init_members(); diff --git a/src/fits/GFitsImageDouble.cpp b/src/fits/GFitsImageDouble.cpp index cc6ec78..c319a7a 100644 --- a/src/fits/GFitsImageDouble.cpp +++ b/src/fits/GFitsImageDouble.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageDouble.cpp - Double precision FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2013 by Juergen Knoedlseder * + * copyright (C) 2008-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -162,17 +162,16 @@ GFitsImageDouble::GFitsImageDouble(const int& nx, const int& ny, const int& nz, /***********************************************************************//** * @brief Pixel array constructor * - * @param[in] naxis Image dimension (0,1,2,3,4). - * @param[in] naxes Number of pixels in each dimension. + * @param[in] naxes Vector of number of pixels in each dimension. * @param[in] pixels Optional pointer to image pixel array * * Construct instance of GFitsImageDouble by specifying the image dimension and * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageDouble::GFitsImageDouble(const int& naxis, const int* naxes, - const double* pixels) : - GFitsImage(G_BITPIX, naxis, naxes) +GFitsImageDouble::GFitsImageDouble(const std::vector& naxes, + const double* pixels) : + GFitsImage(G_BITPIX, naxes) { // Initialise class members for clean destruction init_members(); diff --git a/src/fits/GFitsImageFloat.cpp b/src/fits/GFitsImageFloat.cpp index 3de190e..220e204 100644 --- a/src/fits/GFitsImageFloat.cpp +++ b/src/fits/GFitsImageFloat.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageFloat.cpp - Single precision FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2013 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -162,17 +162,16 @@ GFitsImageFloat::GFitsImageFloat(const int& nx, const int& ny, const int& nz, /***********************************************************************//** * @brief Pixel array constructor * - * @param[in] naxis Image dimension (0,1,2,3,4). - * @param[in] naxes Number of pixels in each dimension. + * @param[in] naxes Vector of number of pixels in each dimension. * @param[in] pixels Optional pointer to image pixel array * * Construct instance of GFitsImageFloat by specifying the image dimension and * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageFloat::GFitsImageFloat(const int& naxis, const int* naxes, - const float* pixels) : - GFitsImage(G_BITPIX, naxis, naxes) +GFitsImageFloat::GFitsImageFloat(const std::vector& naxes, + const float* pixels) : + GFitsImage(G_BITPIX, naxes) { // Initialise class members for clean destruction init_members(); diff --git a/src/fits/GFitsImageLong.cpp b/src/fits/GFitsImageLong.cpp index 5ac32b4..eb2ca78 100644 --- a/src/fits/GFitsImageLong.cpp +++ b/src/fits/GFitsImageLong.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageLong.cpp - Long integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2013 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -161,17 +161,16 @@ GFitsImageLong::GFitsImageLong(const int& nx, const int& ny, const int& nz, /***********************************************************************//** * @brief Pixel array constructor * - * @param[in] naxis Image dimension (0,1,2,3,4). - * @param[in] naxes Number of pixels in each dimension. + * @param[in] naxes Vector of number of pixels in each dimension. * @param[in] pixels Optional pointer to image pixel array * * Construct instance of GFitsImageLong by specifying the image dimension and * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageLong::GFitsImageLong(const int& naxis, const int* naxes, - const long* pixels) : - GFitsImage(G_BITPIX, naxis, naxes) +GFitsImageLong::GFitsImageLong(const std::vector& naxes, + const long* pixels) : + GFitsImage(G_BITPIX, naxes) { // Initialise class members for clean destruction init_members(); diff --git a/src/fits/GFitsImageLongLong.cpp b/src/fits/GFitsImageLongLong.cpp index c4d9037..8f2da75 100644 --- a/src/fits/GFitsImageLongLong.cpp +++ b/src/fits/GFitsImageLongLong.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageLongLong.cpp - Long long integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2013 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -164,17 +164,16 @@ GFitsImageLongLong::GFitsImageLongLong(const int& nx, const int& ny, /***********************************************************************//** * @brief Pixel array constructor * - * @param[in] naxis Image dimension (0,1,2,3,4). - * @param[in] naxes Number of pixels in each dimension. + * @param[in] naxes Vector of number of pixels in each dimension. * @param[in] pixels Optional pointer to image pixel array * * Construct instance of GFitsImageLongLong by specifying the image dimension and * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageLongLong::GFitsImageLongLong(const int& naxis, const int* naxes, - const long long* pixels) : - GFitsImage(G_BITPIX, naxis, naxes) +GFitsImageLongLong::GFitsImageLongLong(const std::vector& naxes, + const long long* pixels) : + GFitsImage(G_BITPIX, naxes) { // Initialise class members for clean destruction init_members(); diff --git a/src/fits/GFitsImageSByte.cpp b/src/fits/GFitsImageSByte.cpp index ff7e70f..982a9df 100644 --- a/src/fits/GFitsImageSByte.cpp +++ b/src/fits/GFitsImageSByte.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageSByte.cpp - Signed Byte FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2013 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -163,17 +163,16 @@ GFitsImageSByte::GFitsImageSByte(const int& nx, const int& ny, const int& nz, /***********************************************************************//** * @brief Pixel array constructor * - * @param[in] naxis Image dimension (0,1,2,3,4). - * @param[in] naxes Number of pixels in each dimension. + * @param[in] naxes Vector of number of pixels in each dimension. * @param[in] pixels Optional pointer to image pixel array * * Construct instance of GFitsImageSByte by specifying the image dimension and * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageSByte::GFitsImageSByte(const int& naxis, const int* naxes, - const char* pixels) : - GFitsImage(G_BITPIX, naxis, naxes) +GFitsImageSByte::GFitsImageSByte(const std::vector& naxes, + const char* pixels) : + GFitsImage(G_BITPIX, naxes) { // Initialise class members for clean destruction init_members(); diff --git a/src/fits/GFitsImageShort.cpp b/src/fits/GFitsImageShort.cpp index 5c0776b..275bbf2 100644 --- a/src/fits/GFitsImageShort.cpp +++ b/src/fits/GFitsImageShort.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageShort.cpp - Short integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2013 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -162,17 +162,16 @@ GFitsImageShort::GFitsImageShort(const int& nx, const int& ny, const int& nz, /***********************************************************************//** * @brief Pixel array constructor * - * @param[in] naxis Image dimension (0,1,2,3,4). - * @param[in] naxes Number of pixels in each dimension. + * @param[in] naxes Vector of number of pixels in each dimension. * @param[in] pixels Optional pointer to image pixel array * * Construct instance of GFitsImageShort by specifying the image dimension and * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageShort::GFitsImageShort(const int& naxis, const int* naxes, - const short* pixels) : - GFitsImage(G_BITPIX, naxis, naxes) +GFitsImageShort::GFitsImageShort(const std::vector& naxes, + const short* pixels) : + GFitsImage(G_BITPIX, naxes) { // Initialise class members for clean destruction init_members(); diff --git a/src/fits/GFitsImageULong.cpp b/src/fits/GFitsImageULong.cpp index 5417df9..a829d0c 100644 --- a/src/fits/GFitsImageULong.cpp +++ b/src/fits/GFitsImageULong.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageULong.cpp - Unsigned long image FITS class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2013 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -163,17 +163,16 @@ GFitsImageULong::GFitsImageULong(const int& nx, const int& ny, const int& nz, /***********************************************************************//** * @brief Pixel array constructor * - * @param[in] naxis Image dimension (0,1,2,3,4). - * @param[in] naxes Number of pixels in each dimension. + * @param[in] naxes Vector of number of pixels in each dimension. * @param[in] pixels Optional pointer to image pixel array * * Construct instance of GFitsImageULong by specifying the image dimension and * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageULong::GFitsImageULong(const int& naxis, const int* naxes, - const unsigned long* pixels) : - GFitsImage(G_BITPIX, naxis, naxes) +GFitsImageULong::GFitsImageULong(const std::vector& naxes, + const unsigned long* pixels) : + GFitsImage(G_BITPIX, naxes) { // Initialise class members for clean destruction init_members(); diff --git a/src/fits/GFitsImageUShort.cpp b/src/fits/GFitsImageUShort.cpp index 4d81606..d36aa9d 100644 --- a/src/fits/GFitsImageUShort.cpp +++ b/src/fits/GFitsImageUShort.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsImageUShort.cpp - Unsigned short FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2013 by Juergen Knoedlseder * + * copyright (C) 2010-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -164,17 +164,16 @@ GFitsImageUShort::GFitsImageUShort(const int& nx, const int& ny, /***********************************************************************//** * @brief Pixel array constructor * - * @param[in] naxis Image dimension (0,1,2,3,4). - * @param[in] naxes Number of pixels in each dimension. + * @param[in] naxes Vector of number of pixels in each dimension. * @param[in] pixels Optional pointer to image pixel array * * Construct instance of GFitsImageUShort by specifying the image dimension and * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageUShort::GFitsImageUShort(const int& naxis, const int* naxes, - const unsigned short* pixels) : - GFitsImage(G_BITPIX, naxis, naxes) +GFitsImageUShort::GFitsImageUShort(const std::vector& naxes, + const unsigned short* pixels) : + GFitsImage(G_BITPIX, naxes) { // Initialise class members for clean destruction init_members(); diff --git a/src/sky/GSkyMap.cpp b/src/sky/GSkyMap.cpp index b01029c..628505a 100644 --- a/src/sky/GSkyMap.cpp +++ b/src/sky/GSkyMap.cpp @@ -2731,26 +2731,19 @@ GFitsImageDouble* GSkyMap::create_wcs_hdu(void) const // Continue only if we have pixels if (size > 0) { - // Set axis parameters for image construction - int naxis = (m_num_maps == 1) ? 2 : 2 + ndim(); - - // Set dimensions of all axes - //int* naxes = new int[naxis]; - int naxes[256]; - naxes[0] = m_num_x; - naxes[1] = m_num_y; + // Set dimension vector of all axes + std::vector naxes; + naxes.push_back(m_num_x); + naxes.push_back(m_num_y); for (int i = 0; i < ndim(); ++i) { - naxes[2+i] = m_shape[i]; + naxes.push_back(m_shape[i]); } // Allocate image - hdu = new GFitsImageDouble(naxis, naxes); - - // Free dimensions of all axes - //delete [] naxes; + hdu = new GFitsImageDouble(naxes); // Store data in image - if (naxis == 2) { + if (naxes.size() == 2) { double* ptr = m_pixels; for (int iy = 0; iy < m_num_y; ++iy) { for (int ix = 0; ix < m_num_x; ++ix) { diff --git a/test/test_GFits.cpp b/test/test_GFits.cpp index 3507708..d078101 100644 --- a/test/test_GFits.cpp +++ b/test/test_GFits.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * test_GFits.cpp - test FITS classes * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2013 by Juergen Knoedlseder * + * copyright (C) 2008-2016 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -456,8 +456,10 @@ void TestGFits::test_create(void) int naxis = 2; int nx = 10; int ny = 20; - int naxes[] = {nx,ny}; - GFitsImageDouble image(naxis, naxes); + std::vector naxes; + naxes.push_back(nx); + naxes.push_back(ny); + GFitsImageDouble image(naxes); for (int ix = 0; ix < nx; ++ix) { for (int iy = 0; iy < ny; ++iy) { image(ix,iy) = 0.01*ix + 0.01*iy; @@ -730,8 +732,12 @@ void TestGFits::test_image_byte(void) TEST_4D_ACCESS(2,2,2,2) // Test image I/O with 4D image - int naxes[] = {2,2,2,2}; - GFitsImageByte image(4, naxes, pixels); + std::vector naxes; + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + GFitsImageByte image(naxes, pixels); // Save image GFits fits(filename, true); @@ -786,8 +792,12 @@ void TestGFits::test_image_ushort(void) TEST_4D_ACCESS(2,2,2,2) // Test image I/O with 4D image - int naxes[] = {2,2,2,2}; - GFitsImageUShort image(4, naxes, pixels); + std::vector naxes; + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + GFitsImageUShort image(naxes, pixels); // Save image GFits fits(filename, true); @@ -841,8 +851,12 @@ void TestGFits::test_image_short(void) TEST_4D_ACCESS(2,2,2,2) // Test image I/O with 4D image - int naxes[] = {2,2,2,2}; - GFitsImageShort image(4, naxes, pixels); + std::vector naxes; + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + GFitsImageShort image(naxes, pixels); // Save image GFits fits(filename, true); @@ -896,8 +910,12 @@ void TestGFits::test_image_ulong(void) TEST_4D_ACCESS(2,2,2,2) // Test image I/O with 4D image - int naxes[] = {2,2,2,2}; - GFitsImageULong image(4, naxes, pixels); + std::vector naxes; + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + GFitsImageULong image(naxes, pixels); // Save image GFits fits(filename, true); @@ -951,8 +969,12 @@ void TestGFits::test_image_long(void) TEST_4D_ACCESS(2,2,2,2) // Test image I/O with 4D image - int naxes[] = {2,2,2,2}; - GFitsImageLong image(4, naxes, pixels); + std::vector naxes; + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + GFitsImageLong image(naxes, pixels); // Save image GFits fits(filename, true); @@ -1006,8 +1028,12 @@ void TestGFits::test_image_longlong(void) TEST_4D_ACCESS(2,2,2,2) // Test image I/O with 4D image - int naxes[] = {2,2,2,2}; - GFitsImageLongLong image(4, naxes, pixels); + std::vector naxes; + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + GFitsImageLongLong image(naxes, pixels); // Save image GFits fits(filename, true); @@ -1060,8 +1086,12 @@ void TestGFits::test_image_float(void) TEST_4D_ACCESS(2,2,2,2) // Test image I/O with 4D image - int naxes[] = {2,2,2,2}; - GFitsImageFloat image(4, naxes, pixels); + std::vector naxes; + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + GFitsImageFloat image(naxes, pixels); // Save image GFits fits(filename, true); @@ -1115,8 +1145,12 @@ void TestGFits::test_image_double(void) TEST_4D_ACCESS(2,2,2,2) // Test image I/O with 4D image - int naxes[] = {2,2,2,2}; - GFitsImageDouble image(4, naxes, pixels); + std::vector naxes; + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + naxes.push_back(2); + GFitsImageDouble image(naxes, pixels); // Save image GFits fits(filename, true);