This class computes the first difference of the input data array. It will read the data, compute the first difference and store it, then analyze the result, returning a vector of simple results giving outliers and statistics on the data between outliers.
Definition at line 111 of file FirstDiffFilter.hpp.
#include <FirstDiffFilter.hpp>
Classes | |
| class | Analysis |
| class used to store analysis arrays filled by the first difference filter More... | |
Public Member Functions | |
| int | analyze () |
| int | analyze2 (double ratlim, double siglim) |
| int | analyze2 (double ratlim, double siglim, std::string &dumpmsg) |
| void | dump (std::ostream &s, const std::string &tag=std::string()) |
| int | filter (const size_t index=0, int npts=-1) |
| FirstDiffFilter (const std::vector< T > &x, const std::vector< T > &d, const std::vector< int > &f) | |
| void | fixUpResults () |
| T | getLimit () |
| std::vector< FilterHit< T > > | getResults () |
| return a copy of the filter hit results More... | |
| void | getStats (FilterHit< T > &fe) |
| void | setDumpNoAnal (bool b) |
| void | setLimit (T val) |
| get and set More... | |
| void | setprecision (int p) |
| void | setw (int w) |
| get and set for dump More... | |
| bool | willDumpNoAnal () |
Public Attributes | |
| std::vector< Analysis > | analvec |
| const std::vector< T > & | data |
| reference to data to be filtered More... | |
| bool | dumpNA |
| if false, don't dump() data with no analysis (T) More... | |
| T | fdlimit |
| |first diff| must be > this to be an outlier 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 | noflags |
| true when flags array is not given More... | |
| bool | noxdata |
| true when xdata is not given More... | |
| unsigned int | Npts |
| 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 FilterHit, generated by analyze(), also for use in dump() More... | |
| const std::vector< T > & | xdata |
| reference to xdata - used only in dump More... | |
Private Member Functions | |
| int | analyze2 (double ratlim, double siglim, bool dump, std::string &dumpmsg) |
|
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, 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 135 of file FirstDiffFilter.hpp.
| int gnsstk::FirstDiffFilter< 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 334 of file FirstDiffFilter.hpp.
|
inline |
analyze the output of the filter(), filling the analysis array 'analvec' also fills the 'results' vector of one or more FilterHit. Uses a different algorithm - sliding window ave/sigma of fdiff on either side of, vs fdiff at, point of interest.
| ratlim | limit on |ratio fdiff to <sigmas>| (also fdiff > fdlimit for hit) |
Definition at line 187 of file FirstDiffFilter.hpp.
|
private |
private version of analyze2 with all arguments, cf. overloaded versions' doc.
| ratlim | limit on |ratio fdiff to <sigmas>| (also fdiff > fdlimit for hit) |
| dump | bool if true dump analysis output to dumpmsg |
| dumpmsg | string for analysis dump when bool dump is true |
Definition at line 495 of file FirstDiffFilter.hpp.
|
inline |
Overloaded version with analysis dump to string reference; cf. other versions
| ratlim | limit on |ratio fdiff to <sigmas>| (also fdiff > fdlimit for hit) |
| dumpmsg | string for analysis dump when bool dump is true |
Definition at line 199 of file FirstDiffFilter.hpp.
| void gnsstk::FirstDiffFilter< T >::dump | ( | std::ostream & | s, |
| const 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 682 of file FirstDiffFilter.hpp.
| int gnsstk::FirstDiffFilter< T >::filter | ( | const size_t | index = 0, |
| int | npts = -1 |
||
| ) |
filter routine that computes the first difference
| 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 266 of file FirstDiffFilter.hpp.
| void gnsstk::FirstDiffFilter< T >::fixUpResults |
fix some potential problems in the results vector, namely: if the first point(s) are outliers, analyze() makes the first FilterHit BOD with only 1 point, then either outliers or a slip; fix this by making first FilterHit outliers. Called at end of analyze()
Definition at line 463 of file FirstDiffFilter.hpp.
|
inline |
Definition at line 149 of file FirstDiffFilter.hpp.
|
inline |
return a copy of the filter hit results
Definition at line 156 of file FirstDiffFilter.hpp.
| void gnsstk::FirstDiffFilter< T >::getStats | ( | FilterHit< T > & | fe | ) |
compute stats on the first differences within the given FilterHit, store in Seg NB this must be called on filter.results[i] in order to show stats in dump()
Definition at line 730 of file FirstDiffFilter.hpp.
|
inline |
Definition at line 153 of file FirstDiffFilter.hpp.
|
inline |
get and set
Definition at line 148 of file FirstDiffFilter.hpp.
|
inline |
Definition at line 152 of file FirstDiffFilter.hpp.
|
inline |
get and set for dump
Definition at line 151 of file FirstDiffFilter.hpp.
|
inline |
Definition at line 154 of file FirstDiffFilter.hpp.
| std::vector<Analysis> gnsstk::FirstDiffFilter< T >::analvec |
| const std::vector<T>& gnsstk::FirstDiffFilter< T >::data |
reference to data to be filtered
Definition at line 237 of file FirstDiffFilter.hpp.
| bool gnsstk::FirstDiffFilter< T >::dumpNA |
if false, don't dump() data with no analysis (T)
Definition at line 232 of file FirstDiffFilter.hpp.
| T gnsstk::FirstDiffFilter< T >::fdlimit |
|first diff| must be > this to be an outlier
Definition at line 234 of file FirstDiffFilter.hpp.
| const std::vector<int>& gnsstk::FirstDiffFilter< T >::flags |
reference to flags, parallel to data, 0 == good
Definition at line 239 of file FirstDiffFilter.hpp.
| int gnsstk::FirstDiffFilter< T >::ilimit |
largest allowed index in data[] is ilimit-1
Definition at line 240 of file FirstDiffFilter.hpp.
| bool gnsstk::FirstDiffFilter< T >::noflags |
true when flags array is not given
Definition at line 231 of file FirstDiffFilter.hpp.
| bool gnsstk::FirstDiffFilter< T >::noxdata |
true when xdata is not given
Definition at line 230 of file FirstDiffFilter.hpp.
| unsigned int gnsstk::FirstDiffFilter< T >::Npts |
size of sliding window
Definition at line 235 of file FirstDiffFilter.hpp.
| int gnsstk::FirstDiffFilter< T >::osp |
width and precision for dump(), (default 8,3)
Definition at line 229 of file FirstDiffFilter.hpp.
| int gnsstk::FirstDiffFilter< T >::osw |
Definition at line 229 of file FirstDiffFilter.hpp.
| std::vector<FilterHit<T> > gnsstk::FirstDiffFilter< T >::results |
vector of FilterHit, generated by analyze(), also for use in dump()
Definition at line 250 of file FirstDiffFilter.hpp.
| const std::vector<T>& gnsstk::FirstDiffFilter< T >::xdata |
reference to xdata - used only in dump
Definition at line 236 of file FirstDiffFilter.hpp.