Public Member Functions | Private Attributes | List of all members
gnsstk::IterativeFDiffFilter< T > Class Template Reference

Detailed Description

template<class T>
class gnsstk::IterativeFDiffFilter< T >

forward declaration

class IterativeFDiffFilter is an iteration loop that applies FDiffFilters to the data, rejecting outliers and fixing slips in each iteration.

Definition at line 113 of file FDiffFilter.hpp.

#include <FDiffFilter.hpp>

Public Member Functions

int analysis ()
 
bool doResetSigma (bool doit)
 (re)set sigma limit More...
 
bool doSmallSlips ()
 get flag to do small slips More...
 
bool doSmallSlips (bool doit)
 set flag to do small slips More...
 
bool doVerbose (bool doit)
 make output verbose More...
 
int editArrays (std::vector< T > &data, std::vector< int > &flags, bool doInt=true, const int badFlag=1)
 
getEstimatedSigmaLimit ()
 get computed sigma limit (= robust outlier limit) after analysis() More...
 
std::vector< unsigned int > getHighSigmaIndex ()
 get the indexes of high-sigma points (only if indexHighSigmas(true)) More...
 
std::string getLabel ()
 get the label in dump More...
 
getLimit ()
 get limit More...
 
unsigned int getNhighSigma ()
 get the number of remaining high-sigma points after analysis() More...
 
std::vector< FilterHit< T > > getResults ()
 get results vector of FilterHit More...
 
getSigma ()
 get sigma limit More...
 
getUsedSigmaLimit ()
 get sigma limit used in last iteration More...
 
unsigned int getWidth ()
 get window width More...
 
bool indexHighSigmas (bool doit)
 set indexing flag More...
 
bool indexingHighSigmas ()
 get indexing flag More...
 
 IterativeFDiffFilter (const std::vector< T > &x, const std::vector< T > &d, const std::vector< int > &f, std::ostream &os=std::cout)
 
void setLabel (const std::string doit)
 define the label in dump More...
 
void setLimit (T val)
 set limit More...
 
void setprecision (int p)
 set precision for dump More...
 
void setSigma (T val)
 set sigma limit More...
 
void setw (int w)
 set width for dump More...
 
void setWidth (unsigned int w)
 set window width More...
 

Private Attributes

const std::vector< T > & data
 reference to data to be filtered More...
 
bool doSmall
 if true, include small slips (<fdlim) in results More...
 
Esiglim
 Estimated sigma limit computed from robust stats. More...
 
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...
 
unsigned int itermax
 maximum number of itertions (3) More...
 
bool keepSigIndex
 if true, keep vector of HighSigmaIndex More...
 
std::string label
 put on output lines when verbose More...
 
std::ostream & logstrm
 write to output stream 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
 
bool resetSigma
 if true, set siglim to Esiglim in each iteration More...
 
std::vector< FilterHit< T > > results
 vector of results of the iterative analysis More...
 
std::vector< unsigned int > sigIndexes
 saved indexes of Nsig high sigma pts More...
 
siglim
 sigma > this indicates possible outlier/slip More...
 
siguse
 sigma limit used in last iteration More...
 
bool verbose
 output comments and dump FDiffFilters More...
 
const std::vector< T > & xdata
 reference to xdata - 'time'; if empty use count More...
 

Constructor & Destructor Documentation

◆ IterativeFDiffFilter()

template<class T >
gnsstk::IterativeFDiffFilter< T >::IterativeFDiffFilter ( const std::vector< T > &  x,
const std::vector< T > &  d,
const std::vector< int > &  f,
std::ostream &  os = std::cout 
)
inline

Constructor with three parallel arrays, xdata (~time), data, flags (0=good). Flags f may be empty (size 0), but on output of analysis() it will be filled.

Parameters
xconst vector<T> of 'times' values,
Note
(x,d,f) all parallel
Parameters
dconst vector<T> of data values
fconst vector<int> of flags, 0 means good. this array may be empty.

Definition at line 781 of file FDiffFilter.hpp.

Member Function Documentation

◆ analysis()

template<class T >
int gnsstk::IterativeFDiffFilter< T >::analysis

Analyze the data using FDiffFilters, optionally computing new sigma outlier limit, in an interative loop. Best for single differenced phase. If doResetSigma(true), sigma limit is reduced, if possible, to outlier limit. Flags array may be empty (size 0), but on output it will be filled. analyze the output of the filter(), filling the results array with outliers Return results in Nsig, Esiglim, and vector<FilterHit> results.

Returns
the number of outliers, or -1 if not enough good data to analyze.

Analyze the data using FDiffFilters, optionally computing new sigma outlier limit, in an interative loop. Best for single differenced phase.

Definition at line 913 of file FDiffFilter.hpp.

◆ doResetSigma()

template<class T >
bool gnsstk::IterativeFDiffFilter< T >::doResetSigma ( bool  doit)
inline

(re)set sigma limit

Definition at line 825 of file FDiffFilter.hpp.

◆ doSmallSlips() [1/2]

template<class T >
bool gnsstk::IterativeFDiffFilter< T >::doSmallSlips ( )
inline

get flag to do small slips

Definition at line 822 of file FDiffFilter.hpp.

◆ doSmallSlips() [2/2]

template<class T >
bool gnsstk::IterativeFDiffFilter< T >::doSmallSlips ( bool  doit)
inline

set flag to do small slips

Definition at line 815 of file FDiffFilter.hpp.

◆ doVerbose()

template<class T >
bool gnsstk::IterativeFDiffFilter< T >::doVerbose ( bool  doit)
inline

make output verbose

Definition at line 842 of file FDiffFilter.hpp.

◆ editArrays()

template<class T >
int gnsstk::IterativeFDiffFilter< T >::editArrays ( std::vector< T > &  data,
std::vector< int > &  flags,
bool  doInt = true,
const int  badFlag = 1 
)

Edit the data for the caller using results created by analysis().

Note
data arrays are NOT edited by filter.
must pass SAME arrays used in c'tor, after calling analysis(), (not const).
Parameters
datavector<T> of data values
flagsvector<int> of flags, 0 means good. this array may be empty.
doIntif true, integerize the slips before fixing (T)
badFlagset flags[] to this int when marking it bad (1)
Returns
the number of edits (slips + pts rejected)

Definition at line 1215 of file FDiffFilter.hpp.

◆ getEstimatedSigmaLimit()

template<class T >
T gnsstk::IterativeFDiffFilter< T >::getEstimatedSigmaLimit ( )
inline

get computed sigma limit (= robust outlier limit) after analysis()

Definition at line 861 of file FDiffFilter.hpp.

◆ getHighSigmaIndex()

template<class T >
std::vector<unsigned int> gnsstk::IterativeFDiffFilter< T >::getHighSigmaIndex ( )
inline

get the indexes of high-sigma points (only if indexHighSigmas(true))

Definition at line 873 of file FDiffFilter.hpp.

◆ getLabel()

template<class T >
std::string gnsstk::IterativeFDiffFilter< T >::getLabel ( )
inline

get the label in dump

Definition at line 852 of file FDiffFilter.hpp.

◆ getLimit()

template<class T >
T gnsstk::IterativeFDiffFilter< T >::getLimit ( )
inline

get limit

Definition at line 806 of file FDiffFilter.hpp.

◆ getNhighSigma()

template<class T >
unsigned int gnsstk::IterativeFDiffFilter< T >::getNhighSigma ( )
inline

get the number of remaining high-sigma points after analysis()

Definition at line 870 of file FDiffFilter.hpp.

◆ getResults()

template<class T >
std::vector<FilterHit<T> > gnsstk::IterativeFDiffFilter< T >::getResults ( )
inline

get results vector of FilterHit

Definition at line 867 of file FDiffFilter.hpp.

◆ getSigma()

template<class T >
T gnsstk::IterativeFDiffFilter< T >::getSigma ( )
inline

get sigma limit

Definition at line 812 of file FDiffFilter.hpp.

◆ getUsedSigmaLimit()

template<class T >
T gnsstk::IterativeFDiffFilter< T >::getUsedSigmaLimit ( )
inline

get sigma limit used in last iteration

Definition at line 864 of file FDiffFilter.hpp.

◆ getWidth()

template<class T >
unsigned int gnsstk::IterativeFDiffFilter< T >::getWidth ( )
inline

get window width

Definition at line 800 of file FDiffFilter.hpp.

◆ indexHighSigmas()

template<class T >
bool gnsstk::IterativeFDiffFilter< T >::indexHighSigmas ( bool  doit)
inline

set indexing flag

Definition at line 832 of file FDiffFilter.hpp.

◆ indexingHighSigmas()

template<class T >
bool gnsstk::IterativeFDiffFilter< T >::indexingHighSigmas ( )
inline

get indexing flag

Definition at line 839 of file FDiffFilter.hpp.

◆ setLabel()

template<class T >
void gnsstk::IterativeFDiffFilter< T >::setLabel ( const std::string  doit)
inline

define the label in dump

Definition at line 849 of file FDiffFilter.hpp.

◆ setLimit()

template<class T >
void gnsstk::IterativeFDiffFilter< T >::setLimit ( val)
inline

set limit

Definition at line 803 of file FDiffFilter.hpp.

◆ setprecision()

template<class T >
void gnsstk::IterativeFDiffFilter< T >::setprecision ( int  p)
inline

set precision for dump

Definition at line 858 of file FDiffFilter.hpp.

◆ setSigma()

template<class T >
void gnsstk::IterativeFDiffFilter< T >::setSigma ( val)
inline

set sigma limit

Definition at line 809 of file FDiffFilter.hpp.

◆ setw()

template<class T >
void gnsstk::IterativeFDiffFilter< T >::setw ( int  w)
inline

set width for dump

Definition at line 855 of file FDiffFilter.hpp.

◆ setWidth()

template<class T >
void gnsstk::IterativeFDiffFilter< T >::setWidth ( unsigned int  w)
inline

set window width

Definition at line 797 of file FDiffFilter.hpp.

Member Data Documentation

◆ data

template<class T >
const std::vector<T>& gnsstk::IterativeFDiffFilter< T >::data
private

reference to data to be filtered

Definition at line 747 of file FDiffFilter.hpp.

◆ doSmall

template<class T >
bool gnsstk::IterativeFDiffFilter< T >::doSmall
private

if true, include small slips (<fdlim) in results

Definition at line 755 of file FDiffFilter.hpp.

◆ Esiglim

template<class T >
T gnsstk::IterativeFDiffFilter< T >::Esiglim
private

Estimated sigma limit computed from robust stats.

Definition at line 759 of file FDiffFilter.hpp.

◆ fdlim

template<class T >
T gnsstk::IterativeFDiffFilter< T >::fdlim
private

|first diff| must be > this to be outlier/slip

Definition at line 751 of file FDiffFilter.hpp.

◆ flags

template<class T >
const std::vector<int>& gnsstk::IterativeFDiffFilter< T >::flags
private

reference to flags, parallel to data, 0 == good

Definition at line 749 of file FDiffFilter.hpp.

◆ itermax

template<class T >
unsigned int gnsstk::IterativeFDiffFilter< T >::itermax
private

maximum number of itertions (3)

Definition at line 758 of file FDiffFilter.hpp.

◆ keepSigIndex

template<class T >
bool gnsstk::IterativeFDiffFilter< T >::keepSigIndex
private

if true, keep vector of HighSigmaIndex

Definition at line 763 of file FDiffFilter.hpp.

◆ label

template<class T >
std::string gnsstk::IterativeFDiffFilter< T >::label
private

put on output lines when verbose

Definition at line 767 of file FDiffFilter.hpp.

◆ logstrm

template<class T >
std::ostream& gnsstk::IterativeFDiffFilter< T >::logstrm
private

write to output stream

Definition at line 760 of file FDiffFilter.hpp.

◆ Nsig

template<class T >
unsigned int gnsstk::IterativeFDiffFilter< T >::Nsig
private

filter()'s count of high sigma - analysis needed

Definition at line 754 of file FDiffFilter.hpp.

◆ Nwind

template<class T >
unsigned int gnsstk::IterativeFDiffFilter< T >::Nwind
private

size of sliding window

Definition at line 753 of file FDiffFilter.hpp.

◆ osp

template<class T >
int gnsstk::IterativeFDiffFilter< T >::osp
private

width and precision for dump(), (default 8,3)

Definition at line 742 of file FDiffFilter.hpp.

◆ osw

template<class T >
int gnsstk::IterativeFDiffFilter< T >::osw
private

Definition at line 742 of file FDiffFilter.hpp.

◆ resetSigma

template<class T >
bool gnsstk::IterativeFDiffFilter< T >::resetSigma
private

if true, set siglim to Esiglim in each iteration

Definition at line 761 of file FDiffFilter.hpp.

◆ results

template<class T >
std::vector<FilterHit<T> > gnsstk::IterativeFDiffFilter< T >::results
private

vector of results of the iterative analysis

Definition at line 738 of file FDiffFilter.hpp.

◆ sigIndexes

template<class T >
std::vector<unsigned int> gnsstk::IterativeFDiffFilter< T >::sigIndexes
private

saved indexes of Nsig high sigma pts

Definition at line 765 of file FDiffFilter.hpp.

◆ siglim

template<class T >
T gnsstk::IterativeFDiffFilter< T >::siglim
private

sigma > this indicates possible outlier/slip

Definition at line 752 of file FDiffFilter.hpp.

◆ siguse

template<class T >
T gnsstk::IterativeFDiffFilter< T >::siguse
private

sigma limit used in last iteration

Definition at line 762 of file FDiffFilter.hpp.

◆ verbose

template<class T >
bool gnsstk::IterativeFDiffFilter< T >::verbose
private

output comments and dump FDiffFilters

Definition at line 766 of file FDiffFilter.hpp.

◆ xdata

template<class T >
const std::vector<T>& gnsstk::IterativeFDiffFilter< T >::xdata
private

reference to xdata - 'time'; if empty use count

Definition at line 745 of file FDiffFilter.hpp.


The documentation for this class was generated from the following file:


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:45