diff --git a/include/GPha.hpp b/include/GPha.hpp index 8618346..86e6d03 100644 --- a/include/GPha.hpp +++ b/include/GPha.hpp @@ -101,6 +101,7 @@ public: const double& areascal(const int& index) const; void backscal(const int& index, const double& backscal); const double& backscal(const int& index) const; + GNdarray backscal_spectrum(void) const; const double& underflow(void) const; const double& overflow(void) const; const double& outflow(void) const; diff --git a/pyext/GPha.i b/pyext/GPha.i index 237b4ed..971f6c7 100644 --- a/pyext/GPha.i +++ b/pyext/GPha.i @@ -62,6 +62,7 @@ public: const double& areascal(const int& index) const; void backscal(const int& index, const double& backscal); const double& backscal(const int& index) const; + GNdarray backscal_spectrum(void) const; const double& underflow(void) const; const double& overflow(void) const; const double& outflow(void) const; diff --git a/src/xspec/GPha.cpp b/src/xspec/GPha.cpp index 2c2e6fc..299f2a3 100644 --- a/src/xspec/GPha.cpp +++ b/src/xspec/GPha.cpp @@ -601,6 +601,25 @@ GNdarray GPha::counts_spectrum(void) const return counts; } +/***********************************************************************//** + * @brief Number of counts in spectrum as GNdArray + * + * Returns the number of counts in the spectrum as a GNdArray. + ***************************************************************************/ +GNdarray GPha::backscal_spectrum(void) const +{ + // Initialise array + int size = m_backscal.size(); + GNdarray alpha = GNdarray(size); + + // Compute content + for (int i = 0; i < size; ++i) { + alpha(i) = m_backscal[i]; + } + + // Return counts + return alpha; +} /***********************************************************************//** * @brief Fill spectrum with a value.