MeteoIODoc 20260919.909d27f1
Environmental timeseries pre-processing
Loading...
Searching...
No Matches
mio::GapInfo Class Referencefinal

Detailed Description

Stores information about a data gap in a time series.

This class contains the anchor points and type information for gaps in meteo data. It provides methods for searching and managing gap boundaries.

Author
Mathias Bavay - Thomas Egger
Date
2013-05-24

#include <ResamplingAlgorithms.h>

Public Types

enum  GapType { INTERPOLATION , EXTRAPOLATION_BEGIN , EXTRAPOLATION_END , NO_VALID_POINTS }
 Gap type enumeration for temporal resampling. More...
 

Public Member Functions

 GapInfo ()
 
bool isUndef () const
 Test if the gap is properly defined.
 
void reset ()
 Reset all members of the gap so, making it undefined.
 
void setBefore (const size_t &idx, const std::vector< MeteoData > &vecM)
 Setter for the 'before' anchor point of the gap.
 
void setAfter (const size_t &idx, const std::vector< MeteoData > &vecM)
 Setter for the 'after' anchor point of the gap.
 
std::string toString () const
 
double size () const
 Return the size (in days) of the current gap or IOUtils::nodata if at least one boundary is unknown.
 
size_t searchBackward (const size_t &pos, const size_t &paramindex, const std::vector< MeteoData > &vecM, const Date &resampling_date, const double &max_gap_size)
 Search backward from pos to find the last valid point before a gap.
 
size_t searchForward (const size_t &pos, const size_t &paramindex, const std::vector< MeteoData > &vecM, const Date &resampling_date, const double &max_gap_size)
 Search forward from pos to find the first valid point after a gap.
 

Public Attributes

Date before
 
Date after
 Date of the first valid point after the gap.
 
size_t beforeIdx
 Index of the last valid point before the gap.
 
size_t afterIdx
 Index of the first valid point after the gap.
 
GapType gapType
 

Constructor & Destructor Documentation

◆ GapInfo()

mio::GapInfo::GapInfo ( )
inline

Member Function Documentation

◆ isUndef()

bool mio::GapInfo::isUndef ( ) const
inline

Test if the gap is properly defined.

Returns
Returns true if the gap does not have both boundaries defined

◆ reset()

void mio::GapInfo::reset ( )
inline

Reset all members of the gap so, making it undefined.

◆ searchBackward()

size_t mio::GapInfo::searchBackward ( const size_t &  pos,
const size_t &  paramindex,
const std::vector< MeteoData > &  vecM,
const Date resampling_date,
const double &  max_gap_size 
)

Search backward from pos to find the last valid point before a gap.

Parameters
[in]posCurrent position (index at requested date or next point after)
[in]paramindexMeteo parameter index
[in]vecMTimeseries of MeteoData for the given station
[in]resampling_dateDate to resample
[in]max_gap_sizeMaximum gap size to search (in Julian days)
Returns
Index of the found valid point, or IOUtils::npos if none found

◆ searchForward()

size_t mio::GapInfo::searchForward ( const size_t &  pos,
const size_t &  paramindex,
const std::vector< MeteoData > &  vecM,
const Date resampling_date,
const double &  max_gap_size 
)

Search forward from pos to find the first valid point after a gap.

Parameters
[in]posCurrent position (index at requested date or next point after)
[in]paramindexMeteo parameter index
[in]vecMTimeseries of MeteoData for the given station
[in]resampling_dateDate to resample
[in]max_gap_sizeMaximum gap size to search (in Julian days)
Returns
Index of the found valid point, or IOUtils::npos if none found

◆ setAfter()

void mio::GapInfo::setAfter ( const size_t &  idx,
const std::vector< MeteoData > &  vecM 
)
inline

Setter for the 'after' anchor point of the gap.

Parameters
[in]idxIndex in the timeseries of the first valid point after the gap
[in]vecMTimeseries of MeteoData

◆ setBefore()

void mio::GapInfo::setBefore ( const size_t &  idx,
const std::vector< MeteoData > &  vecM 
)
inline

Setter for the 'before' anchor point of the gap.

Parameters
[in]idxIndex in the timeseries of the last valid point before the gap
[in]vecMTimeseries of MeteoData

◆ size()

double mio::GapInfo::size ( ) const

Return the size (in days) of the current gap or IOUtils::nodata if at least one boundary is unknown.

Returns
Gap size in days or IOUtils::nodata

◆ toString()

std::string mio::GapInfo::toString ( ) const
inline

Member Data Documentation

◆ after

Date mio::GapInfo::after

Date of the first valid point after the gap.

◆ afterIdx

size_t mio::GapInfo::afterIdx

Index of the first valid point after the gap.

◆ before

Date mio::GapInfo::before

◆ beforeIdx

size_t mio::GapInfo::beforeIdx

Index of the last valid point before the gap.

◆ gapType

GapType mio::GapInfo::gapType

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