UFO
ufo::anonymous_namespace{DataExtractor.cc} Namespace Reference

Classes

class  SortUpdateVisitor
 Boost visitor which allows us to sort a vector. More...
 
class  SortVisitor
 Boost visitor which allows us to sort a vector. More...
 

Functions

template<typename T >
void exactMatch (const std::string &varName, const std::vector< T > &varValues, const T &obVal, ConstrainedRange &range)
 Update our extract constraint based on an exact match against the specified coordinate indexing a dimension of the payload array. More...
 
template<typename T >
void nearestMatch (const std::string &varName, const std::vector< T > &varValues, const T &obVal, ConstrainedRange &range)
 Update our extract constraint based on a nearest match against the specified coordinate indexing a dimension of the payload array. More...
 
void nearestMatch (const std::string &varName, const std::vector< std::string > &varValues, const std::string &obVal, ConstrainedRange &range)
 
template<typename T >
void leastUpperBoundMatch (const std::string &varName, const std::vector< T > &varValues, const T &obVal, ConstrainedRange &range)
 Update our extract constraint based on a least-upper-bound match against the specified coordinate indexing a dimension of the payload array. More...
 
void leastUpperBoundMatch (const std::string &varName, const std::vector< std::string > &varValues, const std::string &obVal, ConstrainedRange &range)
 
template<typename T >
void greatestLowerBoundMatch (const std::string &varName, const std::vector< T > &varValues, const T &obVal, ConstrainedRange &range)
 Update our extract constraint based on a greatest-lower-bound match against the specified coordinate indexing a dimension of the payload array. More...
 
void greatestLowerBoundMatch (const std::string &varName, const std::vector< std::string > &varValues, const std::string &obVal, ConstrainedRange &range)
 
template<typename T >
void match (InterpMethod method, const std::string &varName, const std::vector< T > &varValues, const T &obVal, ConstrainedRange &range)
 Restrict range to the subrange of varValues matching obVal according to the criteria of method. More...
 
template<typename CoordinateValue >
float linearInterpolation (const std::string &varName, const std::vector< CoordinateValue > &varValues, const CoordinateValue &obVal, const ConstrainedRange &range, const DataExtractorPayload< float >::const_array_view< 1 >::type &interpolatedArray)
 Perform piecewise linear interpolation of the provided array varValues at 'location' obVal. More...
 
float linearInterpolation (const std::string &varName, const std::vector< std::string > &varValues, const std::string &obVal, const ConstrainedRange &range, const DataExtractorPayload< float >::const_array_view< 1 >::type &interpolatedArray)
 

Function Documentation

◆ exactMatch()

template<typename T >
void ufo::anonymous_namespace{DataExtractor.cc}::exactMatch ( const std::string &  varName,
const std::vector< T > &  varValues,
const T &  obVal,
ConstrainedRange range 
)

Update our extract constraint based on an exact match against the specified coordinate indexing a dimension of the payload array.

Parameters
[in]varNameName of the coordinate to match against.
[in]varValuesVector of values of that coordinate.
[in]obValValue to match.
[in,out]rangeOn input, the range of slices of the payload array along the dimension indexed by varValues that matches all constraints considered so far. On output, the subrange of slices matching also the current constraint.

Definition at line 88 of file DataExtractor.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ greatestLowerBoundMatch() [1/2]

void ufo::anonymous_namespace{DataExtractor.cc}::greatestLowerBoundMatch ( const std::string &  varName,
const std::vector< std::string > &  varValues,
const std::string &  obVal,
ConstrainedRange range 
)

Definition at line 285 of file DataExtractor.cc.

Here is the caller graph for this function:

◆ greatestLowerBoundMatch() [2/2]

template<typename T >
void ufo::anonymous_namespace{DataExtractor.cc}::greatestLowerBoundMatch ( const std::string &  varName,
const std::vector< T > &  varValues,
const T &  obVal,
ConstrainedRange range 
)

Update our extract constraint based on a greatest-lower-bound match against the specified coordinate indexing a dimension of the payload array.

Parameters
[in]varNameName of the coordinate to match against.
[in]varValuesVector of values of that coordinate.
[in]obValValue to match.
[in,out]rangeOn input, the range of slices of the payload array along the dimension indexed by varValues that matches all constraints considered so far. On output, the subrange of slices matching also the current constraint.

Definition at line 256 of file DataExtractor.cc.

Here is the call graph for this function:

◆ leastUpperBoundMatch() [1/2]

void ufo::anonymous_namespace{DataExtractor.cc}::leastUpperBoundMatch ( const std::string &  varName,
const std::vector< std::string > &  varValues,
const std::string &  obVal,
ConstrainedRange range 
)

Definition at line 234 of file DataExtractor.cc.

Here is the caller graph for this function:

◆ leastUpperBoundMatch() [2/2]

template<typename T >
void ufo::anonymous_namespace{DataExtractor.cc}::leastUpperBoundMatch ( const std::string &  varName,
const std::vector< T > &  varValues,
const T &  obVal,
ConstrainedRange range 
)

Update our extract constraint based on a least-upper-bound match against the specified coordinate indexing a dimension of the payload array.

Parameters
[in]varNameName of the coordinate to match against.
[in]varValuesVector of values of that coordinate.
[in]obValValue to match.
[in,out]rangeOn input, the range of slices of the payload array along the dimension indexed by varValues that matches all constraints considered so far. On output, the subrange of slices matching also the current constraint.

Definition at line 209 of file DataExtractor.cc.

Here is the call graph for this function:

◆ linearInterpolation() [1/2]

template<typename CoordinateValue >
float ufo::anonymous_namespace{DataExtractor.cc}::linearInterpolation ( const std::string &  varName,
const std::vector< CoordinateValue > &  varValues,
const CoordinateValue &  obVal,
const ConstrainedRange range,
const DataExtractorPayload< float >::const_array_view< 1 >::type &  interpolatedArray 
)

Perform piecewise linear interpolation of the provided array varValues at 'location' obVal.

It is assumed that the provided 1D array is described by coordinate varName. This function returns the value produced by piecewise linear interpolation of this array at the point obVal.

Parameters
[in]rangeDefines how to constrain (slice) varValues along with interpolatedArray.
[in]varNameName of the coordinate along which to interpolate.
[in]varValuesVector of values of that coordinate.
[in]obValInterpolation location.
[in]interpolatedArrayInterpolated array.

Definition at line 352 of file DataExtractor.cc.

Here is the call graph for this function:

◆ linearInterpolation() [2/2]

float ufo::anonymous_namespace{DataExtractor.cc}::linearInterpolation ( const std::string &  varName,
const std::vector< std::string > &  varValues,
const std::string &  obVal,
const ConstrainedRange range,
const DataExtractorPayload< float >::const_array_view< 1 >::type &  interpolatedArray 
)

Definition at line 382 of file DataExtractor.cc.

Here is the caller graph for this function:

◆ match()

template<typename T >
void ufo::anonymous_namespace{DataExtractor.cc}::match ( InterpMethod  method,
const std::string &  varName,
const std::vector< T > &  varValues,
const T &  obVal,
ConstrainedRange range 
)

Restrict range to the subrange of varValues matching obVal according to the criteria of method.

Parameters
[in]methodMatching method.
[in]varNameName of the coordinate to match against.
[in]varValuesVector of values of that coordinate.
[in]obValValue to match.
[in,out]rangeOn input, the range of slices of the payload array along the dimension indexed by varValues that matches all constraints considered so far. On output, the subrange of slices matching also the current constraint.

Definition at line 310 of file DataExtractor.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nearestMatch() [1/2]

void ufo::anonymous_namespace{DataExtractor.cc}::nearestMatch ( const std::string &  varName,
const std::vector< std::string > &  varValues,
const std::string &  obVal,
ConstrainedRange range 
)

Definition at line 187 of file DataExtractor.cc.

Here is the caller graph for this function:

◆ nearestMatch() [2/2]

template<typename T >
void ufo::anonymous_namespace{DataExtractor.cc}::nearestMatch ( const std::string &  varName,
const std::vector< T > &  varValues,
const T &  obVal,
ConstrainedRange range 
)

Update our extract constraint based on a nearest match against the specified coordinate indexing a dimension of the payload array.

Method:

  • Find first discovered nearest value in our loop.
  • Determine which indices match this nearest value. (more than one index could have this one value).

    [1, 1, 2, 3, 4, 5]

Nearest neighbour extraction of “1”, has more than one neighbour. That is, more than one index with the same value have the same distance:

[1, 1] i.e. range=(0, 2)

  • Note that an alternative implementation could consider equidistant values, though it was decided this was not desirable behaviour:

    [1, 1, 2, 3, 4, 5]

Nearest neighbour extraction of “1.5” could be then considered to have 3 equidistant neighbours (1, 1, 2). That is, two different values with the same distance.

[1, 1, 2] i.e. range=(0, 3)

Parameters
[in]varNameName of the coordinate to match against.
[in]varValuesVector of values of that coordinate.
[in]obValValue to match.
[in,out]rangeOn input, the range of slices of the payload array along the dimension indexed by varValues that matches all constraints considered so far. On output, the subrange of slices matching also the current constraint.

Definition at line 157 of file DataExtractor.cc.

Here is the call graph for this function: