UFO
ufo::MetOfficeBuddyCollectorV1 Class Reference

An implementation of the MetOfficeBuddyCollector interface intended to produce the same results as Met Office's OPS system. More...

#include <MetOfficeBuddyCollectorV1.h>

Inheritance diagram for ufo::MetOfficeBuddyCollectorV1:
Collaboration diagram for ufo::MetOfficeBuddyCollectorV1:

Public Member Functions

 MetOfficeBuddyCollectorV1 (const MetOfficeBuddyCheckParameters &options, const std::vector< float > &latitudes, const std::vector< float > &longitudes, const std::vector< int > &stationIds)
 
void examinePotentialBuddy (int obsIdB) override
 Check if the observation with ID obsIdB can be selected as a buddy of obsIdB. If so, record its ID internally. More...
 
void appendBuddyPairsTo (std::vector< MetOfficeBuddyPair > &buddyPairs) const override
 Extend buddyPairs with MetOfficeBuddyPair objects storing the properies of all buddy pairs found since the last call to reset(). More...
 
void reset (int obsIdA) override
 Prepare the object for examination of potential buddies of the observation with ID obsIdA. More...
 
- Public Member Functions inherited from ufo::MetOfficeBuddyCollector
 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
 
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...
 

Private Attributes

std::vector< int > potentialBuddies_
 

Additional Inherited Members

- Protected Member Functions inherited from ufo::MetOfficeBuddyCollector
void calcDeltaLatLonAndDistanceTo (int obsIdB, double &deltaLatInRad, double &deltaLonInRad, double &distanceInKm) const
 
MetOfficeBuddyPair createBuddyPair (int obsIdB, double deltaLatInRad, double deltaLonInRad, double distanceInKm) const
 
- Protected Attributes inherited from ufo::MetOfficeBuddyCollector
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

An implementation of the MetOfficeBuddyCollector interface intended to produce the same results as Met Office's OPS system.

A drawback of this implementation is that counters of buddies of certain types (e.g. those from the same zonal band) are sometimes incremented prematurely – before a candidate buddy has been fully vetted – and as a result the collector may sometimes fail to collect as many valid as it should.

Definition at line 24 of file MetOfficeBuddyCollectorV1.h.

Constructor & Destructor Documentation

◆ MetOfficeBuddyCollectorV1()

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

Definition at line 14 of file MetOfficeBuddyCollectorV1.cc.

Member Function Documentation

◆ appendBuddyPairsTo()

void ufo::MetOfficeBuddyCollectorV1::appendBuddyPairsTo ( std::vector< MetOfficeBuddyPair > &  buddyPairs) const
overridevirtual

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

Implements ufo::MetOfficeBuddyCollector.

Definition at line 38 of file MetOfficeBuddyCollectorV1.cc.

Here is the call graph for this function:

◆ examinePotentialBuddy()

void ufo::MetOfficeBuddyCollectorV1::examinePotentialBuddy ( int  obsIdB)
overridevirtual

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

Implements ufo::MetOfficeBuddyCollector.

Definition at line 21 of file MetOfficeBuddyCollectorV1.cc.

Here is the call graph for this function:

◆ reset()

void ufo::MetOfficeBuddyCollectorV1::reset ( int  obsIdA)
overridevirtual

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.

Implements ufo::MetOfficeBuddyCollector.

Definition at line 57 of file MetOfficeBuddyCollectorV1.cc.

Here is the call graph for this function:

Member Data Documentation

◆ potentialBuddies_

std::vector<int> ufo::MetOfficeBuddyCollectorV1::potentialBuddies_
private

Definition at line 38 of file MetOfficeBuddyCollectorV1.h.


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