UFO
|
Retrieve and store data for individual profiles. To do this, first the vector of values in the entire data sample is retrieved then the relevant data corresponding to this profile are extracted. More...
#include <ProfileDataHandler.h>
Public Member Functions | |
ProfileDataHandler (const ObsFilterData &data, const DataHandlerParameters &options, const std::vector< bool > &apply, const Variables &filtervars, std::vector< std::vector< bool >> &flagged) | |
template<typename T > | |
std::vector< T > & | get (const std::string &fullname) |
template<typename T > | |
void | set (const std::string &fullname, std::vector< T > &&vec_in) |
void | initialiseNextProfile () |
void | updateProfileInformation () |
void | writeQuantitiesToObsdb () |
ioda::ObsSpace & | getObsdb () |
Return obsdb. More... | |
int | getNumProfileLevels () const |
Return number of levels to which QC checks should be applied. More... | |
std::vector< float > & | getGeoVaLVector (const std::string &variableName) |
Get GeoVaLs for a particular profile. More... | |
std::vector< float > & | getObsDiag (const std::string &variableName) |
Get ObsDiags for a particular profile. More... | |
void | resetProfileIndices () |
std::vector< ProfileDataHolder > | produceProfileVector (const std::vector< std::string > &variableNamesInt, const std::vector< std::string > &variableNamesFloat, const std::vector< std::string > &variableNamesString, const std::vector< std::string > &variableNamesGeoVaLs, const std::vector< std::string > &variableNamesObsDiags) |
Produce a vector of all profiles, loading the requested variables into each one. More... | |
void | updateAllProfiles (std::vector< ProfileDataHolder > &profiles) |
Read values from a collection of profiles and update information related to each one. More... | |
Private Member Functions | |
void | resetProfileInformation () |
void | updateEntireSampleData () |
void | setFinalReportFlags () |
Set final report flags based on the NumAnyErrors counter. More... | |
void | setFlagged () |
template<typename T > | |
void | updateValueIfPresent (const std::vector< T > &vecIn, const size_t &idxIn, std::vector< T > &vecOut, const size_t &idxOut) |
Transfer values from one vector to another (as long as neither is empty). More... | |
void | getProfileIndicesInEntireSample (const std::string &groupname) |
Get indices in entire sample corresponding to current profile. More... | |
std::string | getAssociatedVerticalCoordinate (const std::string &variableName) const |
Private Attributes | |
std::unordered_map< std::string, boost::variant< std::vector< int >, std::vector< float >, std::vector< std::string > > > | profileData_ |
Container of each variable in the current profile. More... | |
std::unordered_map< std::string, std::vector< float > > | GeoVaLData_ |
Container of GeoVaLs in the current profile. More... | |
std::unordered_map< std::string, std::vector< float > > | obsDiagData_ |
Container of ObsDiags in the current profile. More... | |
ioda::ObsSpace & | obsdb_ |
Observation database. More... | |
const GeoVaLs *const | geovals_ |
GeoVaLs loaded by the filter. More... | |
const ObsDiagnostics *const | obsdiags_ |
ObsDiags loaded by the filter. More... | |
const DataHandlerParameters & | options_ |
Configurable parameters. More... | |
const Variables & | filtervars_ |
Filter variables. More... | |
std::vector< std::vector< bool > > & | flagged_ |
Flagged values. More... | |
std::unique_ptr< EntireSampleDataHandler > | entireSampleDataHandler_ |
Class that handles the entire data sample. More... | |
std::unique_ptr< ProfileIndices > | profileIndices_ |
Class that handles profile indices. More... | |
std::vector< size_t > | profileIndicesInEntireSample_ |
Indices in the entire data sample that correspond to the current profile. More... | |
Retrieve and store data for individual profiles. To do this, first the vector of values in the entire data sample is retrieved then the relevant data corresponding to this profile are extracted.
Definition at line 50 of file ProfileDataHandler.h.
ufo::ProfileDataHandler::ProfileDataHandler | ( | const ObsFilterData & | data, |
const DataHandlerParameters & | options, | ||
const std::vector< bool > & | apply, | ||
const Variables & | filtervars, | ||
std::vector< std::vector< bool >> & | flagged | ||
) |
Definition at line 20 of file ProfileDataHandler.cc.
|
inline |
Retrieve a vector containing the requested variable for the current profile.
Definition at line 64 of file ProfileDataHandler.h.
|
private |
Get the name of the vertical coordinate that is used to determine the slant path locations for the variable variableName
.
Definition at line 196 of file ProfileDataHandler.cc.
std::vector< float > & ufo::ProfileDataHandler::getGeoVaLVector | ( | const std::string & | variableName | ) |
Get GeoVaLs for a particular profile.
Definition at line 211 of file ProfileDataHandler.cc.
|
inline |
Return number of levels to which QC checks should be applied.
Definition at line 151 of file ProfileDataHandler.h.
|
inline |
Return obsdb.
Definition at line 148 of file ProfileDataHandler.h.
std::vector< float > & ufo::ProfileDataHandler::getObsDiag | ( | const std::string & | variableName | ) |
Get ObsDiags for a particular profile.
Definition at line 258 of file ProfileDataHandler.cc.
|
private |
Get indices in entire sample corresponding to current profile.
Definition at line 67 of file ProfileDataHandler.cc.
void ufo::ProfileDataHandler::initialiseNextProfile | ( | ) |
Initialise the next profile prior to applying checks. Clears profileData_
and determines the profileIndices_
for the next profile.
Definition at line 43 of file ProfileDataHandler.cc.
std::vector< ProfileDataHolder > ufo::ProfileDataHandler::produceProfileVector | ( | const std::vector< std::string > & | variableNamesInt, |
const std::vector< std::string > & | variableNamesFloat, | ||
const std::vector< std::string > & | variableNamesString, | ||
const std::vector< std::string > & | variableNamesGeoVaLs, | ||
const std::vector< std::string > & | variableNamesObsDiags | ||
) |
Produce a vector of all profiles, loading the requested variables into each one.
Definition at line 294 of file ProfileDataHandler.cc.
|
inline |
Reset profile indices (required if it is desired to loop through the entire sample again).
Definition at line 161 of file ProfileDataHandler.h.
|
private |
Reset profile information (vectors and corresponding names). This should be called every time a new profile will be retrieved.
Definition at line 36 of file ProfileDataHandler.cc.
|
inline |
Directly set a vector for the current profile. Typically used to store variables that are used locally in checks (e.g. intermediate values). Also initialise a vector in the entire sample, allowing the data to be stored between checks.
Definition at line 104 of file ProfileDataHandler.h.
|
private |
Set final report flags based on the NumAnyErrors counter.
Definition at line 125 of file ProfileDataHandler.cc.
|
private |
Update the 'flagged' vector based on any flags that may have changed during the checks. The QC flag group is hardocded but this could be changed to a configurable value if required.
Definition at line 138 of file ProfileDataHandler.cc.
void ufo::ProfileDataHandler::updateAllProfiles | ( | std::vector< ProfileDataHolder > & | profiles | ) |
Read values from a collection of profiles and update information related to each one.
Definition at line 317 of file ProfileDataHandler.cc.
|
private |
If any variables in the current profile were modified by the checks, the equivalent variables in the entire sample are set to the modified values. The variables that are (potentially) modified are hardcoded but this could be changed to a configurable list if requred.
Definition at line 85 of file ProfileDataHandler.cc.
void ufo::ProfileDataHandler::updateProfileInformation | ( | ) |
Update information for this profile. This function calls three other functions which take the following actions:
Definition at line 49 of file ProfileDataHandler.cc.
|
inlineprivate |
Transfer values from one vector to another (as long as neither is empty).
Definition at line 195 of file ProfileDataHandler.h.
void ufo::ProfileDataHandler::writeQuantitiesToObsdb | ( | ) |
Write various quantities to the obsdb so they can be used in future QC checks. Use the method in EntireSampleDataHandler to do this.
Definition at line 62 of file ProfileDataHandler.cc.
|
private |
Class that handles the entire data sample.
Definition at line 240 of file ProfileDataHandler.h.
|
private |
Filter variables.
Definition at line 234 of file ProfileDataHandler.h.
|
private |
Flagged values.
Definition at line 237 of file ProfileDataHandler.h.
|
private |
Container of GeoVaLs in the current profile.
Definition at line 216 of file ProfileDataHandler.h.
|
private |
GeoVaLs loaded by the filter.
Definition at line 225 of file ProfileDataHandler.h.
|
private |
Observation database.
Definition at line 222 of file ProfileDataHandler.h.
|
private |
Container of ObsDiags in the current profile.
Definition at line 219 of file ProfileDataHandler.h.
|
private |
ObsDiags loaded by the filter.
Definition at line 228 of file ProfileDataHandler.h.
|
private |
Configurable parameters.
Definition at line 231 of file ProfileDataHandler.h.
|
private |
Container of each variable in the current profile.
Definition at line 213 of file ProfileDataHandler.h.
|
private |
Class that handles profile indices.
Definition at line 243 of file ProfileDataHandler.h.
|
private |
Indices in the entire data sample that correspond to the current profile.
Definition at line 246 of file ProfileDataHandler.h.