UFO
ufo::MetOfficeBuddyCollector Class Referenceabstract

Interface of classes used by MetOfficeBuddyPairFinder to select observations used as buddies of other observations during the buddy check. More...

#include <MetOfficeBuddyCollector.h>

Inheritance diagram for ufo::MetOfficeBuddyCollector:
Collaboration diagram for ufo::MetOfficeBuddyCollector:

Public Member Functions

 MetOfficeBuddyCollector (const MetOfficeBuddyCheckParameters &options, const std::vector< float > &latitudes, const std::vector< float > &longitudes, const std::vector< int > &stationIds)
 Constructor. More...
 
virtual ~MetOfficeBuddyCollector ()=default
 
 MetOfficeBuddyCollector (const MetOfficeBuddyCollector &)=delete
 
 MetOfficeBuddyCollector (MetOfficeBuddyCollector &&)=delete
 
MetOfficeBuddyCollectoroperator= (const MetOfficeBuddyCollector &)=delete
 
MetOfficeBuddyCollectoroperator= (MetOfficeBuddyCollector &&)=delete
 
virtual void reset (int obsIdA)=0
 Prepare the object for examination of potential buddies of the observation with ID obsIdA. More...
 
virtual void examinePotentialBuddy (int obsIdB)=0
 Check if the observation with ID obsIdB can be selected as a buddy of obsIdB. If so, record its ID internally. More...
 
void startProcessingNextBand ()
 Called to indicate that observations passed to subsequent calls to examinePotentialBuddy() will belong to a new zonal band. More...
 
bool foundEnoughBuddiesInCurrentBand () const
 Returns true if the number of observations selected as buddies of the observation passed to reset() since the last call to startProcessingNextBand() has reached the limit set by the max_num_buddies_from_single_band parameter. More...
 
bool foundEnoughBuddies () const
 Returns true if the number of observations selected as buddies of the observation passed to reset() since the last call to startProcessingNextBand() has reached the limit set by the max_total_num_buddies parameter. More...
 
virtual void appendBuddyPairsTo (std::vector< MetOfficeBuddyPair > &buddyPairs) const =0
 Extend buddyPairs with MetOfficeBuddyPair objects storing the properies of all buddy pairs found since the last call to reset(). More...
 

Protected Member Functions

void calcDeltaLatLonAndDistanceTo (int obsIdB, double &deltaLatInRad, double &deltaLonInRad, double &distanceInKm) const
 
MetOfficeBuddyPair createBuddyPair (int obsIdB, double deltaLatInRad, double deltaLonInRad, double distanceInKm) const
 

Protected Attributes

const MetOfficeBuddyCheckParametersoptions_
 
const std::vector< float > & latitudes_
 
const std::vector< float > & longitudes_
 
const std::vector< int > & stationIds_
 
double maxLatDifferenceBetweenBuddiesInDeg_
 
int obsIdA_ = 0
 
int numBuddiesInCurrentBand_ = 0
 
int numBuddiesWithSameStationId_ = 0
 
int totalNumBuddies_ = 0
 

Detailed Description

Interface of classes used by MetOfficeBuddyPairFinder to select observations used as buddies of other observations during the buddy check.

Definition at line 22 of file MetOfficeBuddyCollector.h.

Constructor & Destructor Documentation

◆ MetOfficeBuddyCollector() [1/3]

ufo::MetOfficeBuddyCollector::MetOfficeBuddyCollector ( const MetOfficeBuddyCheckParameters options,
const std::vector< float > &  latitudes,
const std::vector< float > &  longitudes,
const std::vector< int > &  stationIds 
)

Constructor.

Parameters
optionsBuddy check parameters.
latitudesObservation latitudes.
longitudesObservation longitudes.
stationIdsIDs of stations that have collected the observations.

Definition at line 19 of file MetOfficeBuddyCollector.cc.

◆ ~MetOfficeBuddyCollector()

virtual ufo::MetOfficeBuddyCollector::~MetOfficeBuddyCollector ( )
virtualdefault

◆ MetOfficeBuddyCollector() [2/3]

ufo::MetOfficeBuddyCollector::MetOfficeBuddyCollector ( const MetOfficeBuddyCollector )
delete

◆ MetOfficeBuddyCollector() [3/3]

ufo::MetOfficeBuddyCollector::MetOfficeBuddyCollector ( MetOfficeBuddyCollector &&  )
delete

Member Function Documentation

◆ appendBuddyPairsTo()

virtual void ufo::MetOfficeBuddyCollector::appendBuddyPairsTo ( std::vector< MetOfficeBuddyPair > &  buddyPairs) const
pure virtual

Extend buddyPairs with MetOfficeBuddyPair objects storing the properies of all buddy pairs found since the last call to reset().

Implemented in ufo::MetOfficeBuddyCollectorV2, and ufo::MetOfficeBuddyCollectorV1.

◆ calcDeltaLatLonAndDistanceTo()

void ufo::MetOfficeBuddyCollector::calcDeltaLatLonAndDistanceTo ( int  obsIdB,
double &  deltaLatInRad,
double &  deltaLonInRad,
double &  distanceInKm 
) const
protected

Definition at line 30 of file MetOfficeBuddyCollector.cc.

Here is the caller graph for this function:

◆ createBuddyPair()

MetOfficeBuddyPair ufo::MetOfficeBuddyCollector::createBuddyPair ( int  obsIdB,
double  deltaLatInRad,
double  deltaLonInRad,
double  distanceInKm 
) const
protected

Definition at line 49 of file MetOfficeBuddyCollector.cc.

Here is the caller graph for this function:

◆ examinePotentialBuddy()

virtual void ufo::MetOfficeBuddyCollector::examinePotentialBuddy ( int  obsIdB)
pure virtual

Check if the observation with ID obsIdB can be selected as a buddy of obsIdB. If so, record its ID internally.

Implemented in ufo::MetOfficeBuddyCollectorV2, and ufo::MetOfficeBuddyCollectorV1.

◆ foundEnoughBuddies()

bool ufo::MetOfficeBuddyCollector::foundEnoughBuddies ( ) const
inline

Returns true if the number of observations selected as buddies of the observation passed to reset() since the last call to startProcessingNextBand() has reached the limit set by the max_total_num_buddies parameter.

Definition at line 106 of file MetOfficeBuddyCollector.h.

◆ foundEnoughBuddiesInCurrentBand()

bool ufo::MetOfficeBuddyCollector::foundEnoughBuddiesInCurrentBand ( ) const
inline

Returns true if the number of observations selected as buddies of the observation passed to reset() since the last call to startProcessingNextBand() has reached the limit set by the max_num_buddies_from_single_band parameter.

Definition at line 101 of file MetOfficeBuddyCollector.h.

◆ operator=() [1/2]

MetOfficeBuddyCollector& ufo::MetOfficeBuddyCollector::operator= ( const MetOfficeBuddyCollector )
delete

◆ operator=() [2/2]

MetOfficeBuddyCollector& ufo::MetOfficeBuddyCollector::operator= ( MetOfficeBuddyCollector &&  )
delete

◆ reset()

void ufo::MetOfficeBuddyCollector::reset ( int  obsIdA)
inlinepure virtual

Prepare the object for examination of potential buddies of the observation with ID obsIdA.

Note
This function must be called before any calls to other member functions.

Implemented in ufo::MetOfficeBuddyCollectorV2, and ufo::MetOfficeBuddyCollectorV1.

Definition at line 111 of file MetOfficeBuddyCollector.h.

Here is the caller graph for this function:

◆ startProcessingNextBand()

void ufo::MetOfficeBuddyCollector::startProcessingNextBand ( )
inline

Called to indicate that observations passed to subsequent calls to examinePotentialBuddy() will belong to a new zonal band.

Definition at line 97 of file MetOfficeBuddyCollector.h.

Member Data Documentation

◆ latitudes_

const std::vector<float>& ufo::MetOfficeBuddyCollector::latitudes_
protected

Definition at line 86 of file MetOfficeBuddyCollector.h.

◆ longitudes_

const std::vector<float>& ufo::MetOfficeBuddyCollector::longitudes_
protected

Definition at line 87 of file MetOfficeBuddyCollector.h.

◆ maxLatDifferenceBetweenBuddiesInDeg_

double ufo::MetOfficeBuddyCollector::maxLatDifferenceBetweenBuddiesInDeg_
protected

Definition at line 89 of file MetOfficeBuddyCollector.h.

◆ numBuddiesInCurrentBand_

int ufo::MetOfficeBuddyCollector::numBuddiesInCurrentBand_ = 0
protected

Definition at line 91 of file MetOfficeBuddyCollector.h.

◆ numBuddiesWithSameStationId_

int ufo::MetOfficeBuddyCollector::numBuddiesWithSameStationId_ = 0
protected

Definition at line 92 of file MetOfficeBuddyCollector.h.

◆ obsIdA_

int ufo::MetOfficeBuddyCollector::obsIdA_ = 0
protected

Definition at line 90 of file MetOfficeBuddyCollector.h.

◆ options_

const MetOfficeBuddyCheckParameters& ufo::MetOfficeBuddyCollector::options_
protected

Definition at line 85 of file MetOfficeBuddyCollector.h.

◆ stationIds_

const std::vector<int>& ufo::MetOfficeBuddyCollector::stationIds_
protected

Definition at line 88 of file MetOfficeBuddyCollector.h.

◆ totalNumBuddies_

int ufo::MetOfficeBuddyCollector::totalNumBuddies_ = 0
protected

Definition at line 93 of file MetOfficeBuddyCollector.h.


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