This class computes the first difference of the input data array at each point, as well as stats on both the first difference and the data for the Nwind points ending at the current point. The difference, sigmaYX of the difference statistics, and the slope from the data statistics, are stored in an "analysis vector" Avec. The Avec is used to find outliers, gaps and slips in the data; the analysis() method returns a vector of "result" objects FilterHit<T>. The caller should filter and analyze iteratively, since a single call is often not sufficient to find and fix all the problems.
Definition at line 131 of file FDiffFilter.hpp.
#include <FDiffFilter.hpp>
Classes | |
class | Analysis |
Public Member Functions | |
int | analysis () |
void | computeRobustSigmaLimit (int &N, T &new_siglim) |
bool | doSmallSlips () |
get the 'small slips' limit More... | |
bool | doSmallSlips (bool doit) |
set the 'small slips' limit More... | |
void | dump (std::ostream &s, std::string tag=std::string()) |
FDiffFilter (const std::vector< T > &x, const std::vector< T > &d, const std::vector< int > &f) | |
int | filter (const size_t index=0, int npts=-1) |
std::vector< unsigned int > | getHighSigmaIndex () |
get the indexes of high-sigma points (only if indexHighSigmas(true)) More... | |
T | getLimit () |
get the limit More... | |
unsigned int | getNhighSigma () |
std::vector< FilterHit< T > > | getResults () |
get results vector of FilterHit More... | |
T | getSigma () |
get the sigma More... | |
unsigned int | getWidth () |
get the width of the window More... | |
bool | indexHighSigmas (bool doit) |
set the indexing flag More... | |
bool | indexingHighSigmas () |
get the indexing flag More... | |
void | setLimit (T val) |
set the limit More... | |
void | setprecision (int p) |
set precision for output More... | |
void | setSigma (T val) |
set the sigma More... | |
void | setw (int w) |
set width for output More... | |
void | setWidth (unsigned int w) |
set the width of the window More... | |
Private Attributes | |
std::vector< Analysis > | Avec |
const std::vector< T > & | data |
reference to data to be filtered More... | |
bool | doSmall |
if true, include small slips (<fdlim) in results More... | |
T | Esiglim |
compute siglim (= robust outlier limit) More... | |
T | fdlim |
|first diff| must be > this to be outlier/slip More... | |
const std::vector< int > & | flags |
reference to flags, parallel to data, 0 == good More... | |
int | ilimit |
largest allowed index in data[] is ilimit-1 More... | |
bool | keepSigIndex |
if true, keep vector of HighSigmaIndex More... | |
T | madSlope |
robust stats on slope More... | |
T | medSlope |
bool | noflags |
true when flags array is not given More... | |
bool | noxdata |
true when xdata is not given More... | |
unsigned int | Nsig |
filter()'s count of high sigma - analysis needed More... | |
unsigned int | Nwind |
size of sliding window More... | |
int | osp |
width and precision for dump(), (default 8,3) More... | |
int | osw |
std::vector< FilterHit< T > > | results |
vector of results of analysis() More... | |
std::vector< unsigned int > | sigIndexes |
saved indexes of Nsig high sigma pts More... | |
T | siglim |
sigma > this indicates possible outlier/slip More... | |
const std::vector< T > & | xdata |
reference to xdata - 'time'; if empty use count More... | |
Friends | |
class | IterativeFDiffFilter< T > |
|
inline |
constructor with two arrays - x is used only in dump(); x and f must exist but may be empty
x | const vector<T> of 'times' values, |
d | const vector<T> of data values |
f | const vector<int> of flags, 0 means good. this array may be empty. |
Definition at line 205 of file FDiffFilter.hpp.
int gnsstk::FDiffFilter< T >::analysis |
analyze the output of the filter(), filling the results array with outliers
Definition at line 494 of file FDiffFilter.hpp.
void gnsstk::FDiffFilter< T >::computeRobustSigmaLimit | ( | int & | N, |
T & | new_siglim | ||
) |
after filter(), and before analyze(), compute robust stats on the sigma of first differences, to get a suggested siglim
N | int output: computed number of sigmas > new limit, -1 not enough data |
new_siglim | T output: computed limit (high outlier) on sigma for analyze |
Definition at line 457 of file FDiffFilter.hpp.
|
inline |
get the 'small slips' limit
Definition at line 247 of file FDiffFilter.hpp.
|
inline |
set the 'small slips' limit
Definition at line 240 of file FDiffFilter.hpp.
void gnsstk::FDiffFilter< T >::dump | ( | std::ostream & | s, |
std::string | tag = std::string() |
||
) |
dump the data and analysis; optionally include a tag at the start of each line, and configure width and precision.
Definition at line 647 of file FDiffFilter.hpp.
int gnsstk::FDiffFilter< T >::filter | ( | const size_t | index = 0 , |
int | npts = -1 |
||
) |
filter routine that computes the first difference, and uses siglim to mark areas of possible outlier/slips.
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 317 of file FDiffFilter.hpp.
|
inline |
get the indexes of high-sigma points (only if indexHighSigmas(true))
Definition at line 273 of file FDiffFilter.hpp.
|
inline |
get the limit
Definition at line 231 of file FDiffFilter.hpp.
|
inline |
get the number of high-sigma points : after filter() can tell if possible outliers/slips present
Definition at line 270 of file FDiffFilter.hpp.
|
inline |
get results vector of FilterHit
Definition at line 266 of file FDiffFilter.hpp.
|
inline |
get the sigma
Definition at line 237 of file FDiffFilter.hpp.
|
inline |
get the width of the window
Definition at line 225 of file FDiffFilter.hpp.
|
inline |
set the indexing flag
Definition at line 250 of file FDiffFilter.hpp.
|
inline |
get the indexing flag
Definition at line 257 of file FDiffFilter.hpp.
|
inline |
set the limit
Definition at line 228 of file FDiffFilter.hpp.
|
inline |
set precision for output
Definition at line 263 of file FDiffFilter.hpp.
|
inline |
set the sigma
Definition at line 234 of file FDiffFilter.hpp.
|
inline |
set width for output
Definition at line 260 of file FDiffFilter.hpp.
|
inline |
set the width of the window
Definition at line 222 of file FDiffFilter.hpp.
|
friend |
Definition at line 134 of file FDiffFilter.hpp.
|
private |
vector of Analysis objects, holding first differences and indexes, generated by filter(), used by analyze() and included in dump() output.
Definition at line 165 of file FDiffFilter.hpp.
|
private |
reference to data to be filtered
Definition at line 177 of file FDiffFilter.hpp.
|
private |
if true, include small slips (<fdlim) in results
Definition at line 187 of file FDiffFilter.hpp.
|
private |
compute siglim (= robust outlier limit)
Definition at line 184 of file FDiffFilter.hpp.
|
private |
|first diff| must be > this to be outlier/slip
Definition at line 182 of file FDiffFilter.hpp.
|
private |
reference to flags, parallel to data, 0 == good
Definition at line 179 of file FDiffFilter.hpp.
|
private |
largest allowed index in data[] is ilimit-1
Definition at line 180 of file FDiffFilter.hpp.
|
private |
if true, keep vector of HighSigmaIndex
Definition at line 188 of file FDiffFilter.hpp.
|
private |
robust stats on slope
Definition at line 192 of file FDiffFilter.hpp.
|
private |
Definition at line 192 of file FDiffFilter.hpp.
|
private |
true when flags array is not given
Definition at line 173 of file FDiffFilter.hpp.
|
private |
true when xdata is not given
Definition at line 172 of file FDiffFilter.hpp.
|
private |
filter()'s count of high sigma - analysis needed
Definition at line 186 of file FDiffFilter.hpp.
|
private |
size of sliding window
Definition at line 185 of file FDiffFilter.hpp.
|
private |
width and precision for dump(), (default 8,3)
Definition at line 171 of file FDiffFilter.hpp.
|
private |
Definition at line 171 of file FDiffFilter.hpp.
|
private |
vector of results of analysis()
Definition at line 168 of file FDiffFilter.hpp.
|
private |
saved indexes of Nsig high sigma pts
Definition at line 190 of file FDiffFilter.hpp.
|
private |
sigma > this indicates possible outlier/slip
Definition at line 183 of file FDiffFilter.hpp.
|
private |
reference to xdata - 'time'; if empty use count
Definition at line 176 of file FDiffFilter.hpp.