Classes | Namespaces
FDiffFilter.hpp File Reference

Detailed Description

Implement a statistical filter that uses first-differences.

This class implements a statistical filter that uses first-differences, like FirstDiffFilter, but this is simpler, more effective and more robust, at least for single differenced (across satellites) phase data. Also includes here is a class, IterativeFDiffFilter, that applies the FDiffFilter more than once; this is the most effective way to use this filter.

There are several statistical filters implemented as classes. These classes are templates; the template parameter should be a float (probably double); it is used to construct gnsstk::Stats<T>, gnsstk::TwoSampleStats<T> and gnsstk::SeqStats<T>, which are fundamental to these algorithms. All the filters look for outliers and discontinuities (slips) in a timeseries. The first difference filter analyses the simple first difference of the data. The window filter uses a 2-pane sliding window centered on the data point in question; statistics on the data in each to the 2 panes are computed and used in the analysis. All filters' analysis() function computes a vector of FilterHit objects named 'results'that give the caller the results of the filtering. All filters have a getStats(FilterHit) function that computes statistics on the filter quantities (NOT the data) over the interval covered by the event, and stores them in the FilterHit. These stats are slightly different for the two filters; FirstDiffFilter::getStats computes min, max, median and mad of the first differences.

The structure of these filters allows the caller to call filters repeatedly, and to call different filters on the same dataset, because none of the filters modify the data array(s) in any way. The arrays are passed as constant references to the constructor. The xdata reference must be provided, but it may be empty (except for the window filter if two sample statistics are to be used). If xdata is not empty, values of xdata are included in the dump() output. Similarly, an integer vector of flags is also passed to the constructor (also as a const reference), and it may be empty. If it is not empty, flag[i] != 0 causes the data at index i to be ignored by the filters. The arrays data, xdata and flags must always be parallel, and xdata and flags cannot be shorter than data unless they are empty (when they are ignored). The filter() function has optional input of the starting index and the number of points to process, so that segments of the data (and xdata and flags) array(s) can be processed in the filters. These features allow the user to, for example, call a filter, mark data in the flags array (e.g. outliers) and then filter again. If a slip is found, the caller can then filter the data again but starting at the slip, or filter only the segment of data before the slip [using filter(index, npts)].

Note
the caller must construct a new filter at each call - if you declare a Filter object, run filter(), then use the results to modify flags[] and try to call filter() again, it does not see the changes to flags[]. Instead you need to call the constructor again.

Definition in file FDiffFilter.hpp.

#include "RobustStats.hpp"
#include "Stats.hpp"
#include "StatsFilterHit.hpp"
#include "StringUtils.hpp"
#include <vector>
Include dependency graph for FDiffFilter.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gnsstk::FDiffFilter< T >::Analysis
 
class  gnsstk::FDiffFilter< T >
 
class  gnsstk::IterativeFDiffFilter< T >
 forward declaration More...
 
class  gnsstk::IterativeFDiffFilter< T >
 forward declaration More...
 

Namespaces

 gnsstk
 For Sinex::InputHistory.
 


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