This class computes statistics in a sliding window with two equal halves, 'past' and 'future', at each point in the input data array(s). The objective is to detect discontinuities or "slips" and compute statistics on the data between slips. This class will read the data, apply the window filter, generating statistics that are stored, then analyze the statistics, returning a vector of simple results, and optionally dump all the data, analysis information and results.
Definition at line 302 of file WindowFilter.hpp.
#include <WindowFilter.hpp>
Classes | |
class | Analysis |
class used to store analysis arrays filled by the window filters. More... | |
Public Member Functions | |
int | analyze () |
void | dump (std::ostream &s, std::string tag=std::string()) |
int | filter (const size_t index=0, int npts=-1) |
int | getBufferSize () |
bool | getDebug () |
int | getHalfWidth () |
T | getMinMargin () |
T | getMinRatio () |
T | getMinStep () |
T | getPFFrac () |
std::vector< FilterHit< T > > | getResults () |
get results vector of FilterHit More... | |
void | getStats (FilterHit< T > &fe, bool noedge=true) |
int | getWidth () |
bool | isBalanced () |
bool | isFullWindows () |
bool | isOneSample () |
bool | isTwoSample () |
void | reset () |
void | setBalanced (bool b) |
void | setBufferSize (int b) |
void | setDebug (bool b) |
debug prints in analysis() More... | |
void | setDumpAnalMsg (bool b) |
void | setDumpNoAnal (bool b) |
in dump(), don't dump data when there was no analysis More... | |
void | setFullWindows (bool b) |
void | setHalfWidth (int hw) |
void | setMinMargin (T val) |
void | setMinRatio (T val) |
void | setMinStep (T val) |
void | setPFFrac (T val) |
void | setprecision (int p) |
void | setTwoSample (bool b) |
void | setw (int w) |
void | setWidth (int w) |
bool | willDumpAnalMsg () |
bool | willDumpNoAnal () |
WindowFilter (const std::vector< T > &x, const std::vector< T > &d, const std::vector< int > &f) | |
Public Attributes | |
std::vector< FilterHit< T > > | results |
Private Attributes | |
std::vector< Analysis > | analvec |
bool | balanced |
if true, 2 panes of sliding window have = size More... | |
int | buffsize |
number of good points ignored btwn past, future More... | |
const std::vector< T > & | data |
reference to data to be filtered More... | |
bool | debug |
if true, print debug messages in analyze() (F) More... | |
bool | dumpAmsg |
if true, add analysis message in dump() (F) More... | |
bool | dumpNA |
if false, don't dump() data with no analysis (T) More... | |
const std::vector< int > & | flags |
reference to flags, parallel to data, 0 == good More... | |
bool | fullwindows |
if true, only process with full windows More... | |
unsigned int | halfwidth |
number of points on either side of slip analyzed More... | |
T | minmargin |
limit on step/minstep+ratio/minratio-2 More... | |
T | minratio |
ratio=|step/sig| < this is not a slip More... | |
T | minstep |
|step|(=fut ave - past ave) < this is not slip More... | |
bool | noflags |
true when flags array is not given More... | |
bool | noxdata |
true when xdata array is not given More... | |
int | osp |
width and precision for dump(), (default 8,3) More... | |
int | osw |
T | pffrac |
delta(f,p) sigma < this frac * sigma not a slip More... | |
bool | twoSample |
if true, use two-sample statistics More... | |
unsigned int | width |
width or number of points in (1 pane of) window More... | |
const std::vector< T > & | xdata |
reference to x-data to be filtered (TwoSample) More... | |
|
inline |
constructor
x | const vector<T> of 'times' values, NB (x,d,f) all parallel |
d | const vector<T> of data values |
f | const vector<int> of flags, 0 means good. this array may be empty. |
Definition at line 343 of file WindowFilter.hpp.
int gnsstk::WindowFilter< T >::analyze |
analyze the output of the filter(), filling the analysis array 'analvec' also fills the 'results' vector of one or more FilterHit.
Definition at line 945 of file WindowFilter.hpp.
void gnsstk::WindowFilter< T >::dump | ( | std::ostream & | s, |
std::string | tag = std::string() |
||
) |
dump the data and analysis, including first and last 2 pts which have no stats. optionally include a tag at the start of each line, and configure width and precision.
Definition at line 1341 of file WindowFilter.hpp.
int gnsstk::WindowFilter< T >::filter | ( | const size_t | index = 0 , |
int | npts = -1 |
||
) |
window filter routine that does the work. NB this routine configures the analysis data and therefore is critical to anlayse() and dump().
index | in data arrays at which to start, defaults to 0 |
npts | number of data to process, defaults to -1, meaning to end of data. |
Definition at line 506 of file WindowFilter.hpp.
|
inline |
Definition at line 373 of file WindowFilter.hpp.
|
inline |
Definition at line 401 of file WindowFilter.hpp.
|
inline |
Definition at line 388 of file WindowFilter.hpp.
|
inline |
Definition at line 386 of file WindowFilter.hpp.
|
inline |
Definition at line 384 of file WindowFilter.hpp.
|
inline |
Definition at line 385 of file WindowFilter.hpp.
|
inline |
Definition at line 387 of file WindowFilter.hpp.
|
inline |
get results vector of FilterHit
Definition at line 407 of file WindowFilter.hpp.
void gnsstk::WindowFilter< T >::getStats | ( | FilterHit< T > & | fe, |
bool | noedge = true |
||
) |
compute stats on the filter quanitites within the given FilterHit, defined as the min, max, median and mad of sigma, the rss(future and past stddev). if the flag is true (default), exclude data within the filter width of the end points, to avoid the bump(s) due to slip(s) at the FilterHit boundaries.
Definition at line 1445 of file WindowFilter.hpp.
|
inline |
Definition at line 372 of file WindowFilter.hpp.
|
inline |
Definition at line 376 of file WindowFilter.hpp.
|
inline |
Definition at line 377 of file WindowFilter.hpp.
|
inline |
Definition at line 375 of file WindowFilter.hpp.
|
inline |
Definition at line 374 of file WindowFilter.hpp.
|
inline |
reset the analysis information stored internally. This does not change the data arrays; to do so, instantiate a new filter object.
Definition at line 413 of file WindowFilter.hpp.
|
inline |
Definition at line 370 of file WindowFilter.hpp.
|
inline |
Definition at line 368 of file WindowFilter.hpp.
|
inline |
debug prints in analysis()
Definition at line 400 of file WindowFilter.hpp.
|
inline |
get and set for dump() parameters in dump(), include the little message at the end of line from analyze()
Definition at line 394 of file WindowFilter.hpp.
|
inline |
in dump(), don't dump data when there was no analysis
Definition at line 397 of file WindowFilter.hpp.
|
inline |
Definition at line 371 of file WindowFilter.hpp.
|
inline |
Definition at line 383 of file WindowFilter.hpp.
|
inline |
Definition at line 381 of file WindowFilter.hpp.
|
inline |
Definition at line 379 of file WindowFilter.hpp.
|
inline |
Definition at line 380 of file WindowFilter.hpp.
|
inline |
Definition at line 382 of file WindowFilter.hpp.
|
inline |
Definition at line 404 of file WindowFilter.hpp.
|
inline |
Definition at line 369 of file WindowFilter.hpp.
|
inline |
Definition at line 403 of file WindowFilter.hpp.
|
inline |
Definition at line 367 of file WindowFilter.hpp.
|
inline |
Definition at line 395 of file WindowFilter.hpp.
|
inline |
Definition at line 398 of file WindowFilter.hpp.
|
private |
|
private |
if true, 2 panes of sliding window have = size
Definition at line 459 of file WindowFilter.hpp.
|
private |
number of good points ignored btwn past, future
Definition at line 463 of file WindowFilter.hpp.
|
private |
reference to data to be filtered
Definition at line 476 of file WindowFilter.hpp.
|
private |
if true, print debug messages in analyze() (F)
Definition at line 483 of file WindowFilter.hpp.
|
private |
if true, add analysis message in dump() (F)
Definition at line 482 of file WindowFilter.hpp.
|
private |
if false, don't dump() data with no analysis (T)
Definition at line 481 of file WindowFilter.hpp.
|
private |
reference to flags, parallel to data, 0 == good
Definition at line 478 of file WindowFilter.hpp.
|
private |
if true, only process with full windows
Definition at line 460 of file WindowFilter.hpp.
|
private |
number of points on either side of slip analyzed
Definition at line 468 of file WindowFilter.hpp.
|
private |
limit on step/minstep+ratio/minratio-2
Definition at line 471 of file WindowFilter.hpp.
|
private |
ratio=|step/sig| < this is not a slip
Definition at line 469 of file WindowFilter.hpp.
|
private |
|step|(=fut ave - past ave) < this is not slip
Definition at line 470 of file WindowFilter.hpp.
|
private |
true when flags array is not given
Definition at line 465 of file WindowFilter.hpp.
|
private |
true when xdata array is not given
Definition at line 464 of file WindowFilter.hpp.
|
private |
width and precision for dump(), (default 8,3)
Definition at line 480 of file WindowFilter.hpp.
|
private |
Definition at line 480 of file WindowFilter.hpp.
|
private |
delta(f,p) sigma < this frac * sigma not a slip
Definition at line 472 of file WindowFilter.hpp.
std::vector<FilterHit<T> > gnsstk::WindowFilter< T >::results |
vector of FilterHit, generated and returned by analyze(); keep this copy for use in dump()
Definition at line 496 of file WindowFilter.hpp.
|
private |
if true, use two-sample statistics
Definition at line 461 of file WindowFilter.hpp.
|
private |
width or number of points in (1 pane of) window
Definition at line 462 of file WindowFilter.hpp.
|
private |
reference to x-data to be filtered (TwoSample)
Definition at line 475 of file WindowFilter.hpp.