Commit a7e5bb3a authored by thomas.forbriger's avatar thomas.forbriger
Browse files

libpsdxx [WP]: add debug output

parent 4b46012f
......@@ -39,6 +39,8 @@
#define PSDXX_DEBUG_H_VERSION \
"PSDXX_DEBUG_H V1.1"
#include<iostream>
/*! \brief produce debug output
* \ingroup group_debug
*
......
......@@ -123,6 +123,9 @@ namespace psd {
const Tseries::Tcoc& inputseries2=s2.data;
const double& dt=s1.interval;
PSDXX_debug(this->debug(), "DPSDComputer::processor",
PSDXX_value(dt));
PSDXX_assert(dt>0., "illegal sampling interval");
if (cpsd_flag)
{
......@@ -155,6 +158,8 @@ namespace psd {
{
nsegsamples=2*inputseries1.size()/(this->Mnsegments+1);
}
PSDXX_debug(this->debug(), "DPSDComputer::processor",
PSDXX_value(nsegsamples));
// adjust length of time series
if (this->Mdivisor>1)
......@@ -175,9 +180,13 @@ namespace psd {
<<std::endl;
}
}
PSDXX_debug(this->debug(), "DPSDComputer::processor",
PSDXX_value(nsegsamples));
// segment stride
int segstride=inputseries1.size()/(this->Mnsegments+1);
PSDXX_debug(this->debug(), "DPSDComputer::processor",
PSDXX_value(segstride));
if (this->Mverbose && (this->Mnsegments>1))
{
......@@ -375,7 +384,7 @@ namespace psd {
psd1*=scalingfactor;
PSDXX_debug(this->debug(), "DPSDComputer::processor",
"scaled PSD");
if (this->debug()) { DUMP(psd1); }
/* if (this->debug()) { DUMP(psd1); } */
PSDXX_assert(aff::func::min(psd1)>=0.,
"must be positive; this error indicates a bug");
if (cpsd_flag)
......
......@@ -34,11 +34,14 @@
"PSDXX_DPSDCOMPUTER_PSD_CC V1.0"
#include <psdxx/psd.h>
#include <psdxx/debug.h>
namespace psd {
TDISeries DPSDComputer::psd(const TDISeries::Tcoc& s) const
{
PSDXX_debug(this->debug(), "DPSDComputer::psd",
PSDXX_value(s.interval));
SpectralValues sv=this->processor(s, s, false, true);
TDISeries retval(sv.psd1);
return(retval);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment