Commit 22805a6b authored by thomas.forbriger's avatar thomas.forbriger
Browse files

libpsdxx [WP][FEATURE]: let PSDComputer support debug mode

parent 8ad9de82
......@@ -76,6 +76,13 @@ namespace psd {
this->Mverbose=f;
} // void DPSDComputer::set_verbose(const bool& f)
/* ---------------------------------------------------------------------- */
void DPSDComputer::set_debug(const bool& f)
{
this->Mdebug=f;
} // void DPSDComputer::set_debug(const bool& f)
} // namespace psd
/* ----- END OF dpsdcomputer_parameters.cc ----- */
......@@ -36,10 +36,12 @@
#include <iostream>
#include <psdxx/psd.h>
#include <psdxx/error.h>
#include <psdxx/debug.h>
#include <aff/iterator.h>
#include <aff/seriesoperators.h>
#include <aff/functions/min.h>
#include <aff/subarray.h>
#include <aff/dump.h>
#include <tsxx/tapers.h>
#include <tsxx/filter.h>
#include <fourier/fftwaff.h>
......@@ -371,6 +373,9 @@ namespace psd {
if (psd_flag)
{
psd1*=scalingfactor;
PSDXX_debug(this->debug(), "DPSDComputer::processor",
"scaled PSD");
if (this->debug()) { DUMP(psd1); }
PSDXX_assert(aff::func::min(psd1)>=0.,
"must be positive; this error indicates a bug");
if (cpsd_flag)
......
......@@ -158,19 +158,21 @@ namespace psd {
//! default constructor
DPSDComputer():
Mnsegments(1), Moverlap(0.), Mdivisor(1), Mpadfactor(1),
Mverbose(false), Mdemean(true), Mdetrend(true) { }
Mverbose(false), Mdebug(false), Mdemean(true), Mdetrend(true) { }
void set_nsegments(const unsigned int& n);
void set_divisor(const unsigned int& n);
void set_padfactor(const unsigned int& n);
void set_overlap(const double& f);
void set_verbose(const bool& f);
void set_debug(const bool& f);
unsigned int nsegments() const { return(Mnsegments); }
unsigned int divisor() const { return(Mdivisor); }
unsigned int padfactor() const { return(Mpadfactor); }
double overlap() const { return(Moverlap); }
bool verbose() const { return(Mverbose); }
bool debug() const { return(Mdebug); }
//! compute power spectral density
TDISeries psd(const TDISeries::Tcoc& s) const;
......@@ -192,6 +194,8 @@ namespace psd {
unsigned int Mpadfactor;
//! produce verbose output on terminal
bool Mverbose;
//! produce debug output on terminal
bool Mdebug;
//! remove average from each segment
bool Mdemean;
//! remove trend from each segment
......
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