14 #include "ioda/ObsDataVector.h"
15 #include "oops/util/IntSetParser.h"
16 #include "oops/util/missingValues.h"
20 static ObsFunctionMaker<LinearCombination>
28 options_.validateAndDeserialize(conf);
54 ASSERT(coefs.size() == nv);
59 for (
size_t ivar = 0; ivar < nv; ++ivar) {
62 ASSERT(varin.nvars() == out.nvars());
63 for (
size_t iloc = 0; iloc <
nlocs; ++iloc) {
64 for (
size_t ichan = 0; ichan < out.nvars(); ++ichan) {
65 if ( varin[ichan][iloc] ==
missing || out[ichan][iloc] ==
missing ) {
68 out[ichan][iloc] += coefs[ivar] * varin[ichan][iloc];
LinearCombinationParameters options_
const ufo::Variables & requiredVariables() const
geovals required to compute the function
LinearCombination(const eckit::LocalConfiguration &)
void compute(const ObsFilterData &, ioda::ObsDataVector< float > &) const
compute the result of the function
oops::RequiredParameter< std::vector< Variable > > variables
Input variables of the linear combination.
oops::RequiredParameter< std::vector< float > > coefs
coefficient associated with the above variables
ObsFilterData provides access to all data related to an ObsFilter.
size_t nlocs() const
Returns the number of locations in the associated ObsSpace.
ioda::ObsSpace & obsspace() const
Returns reference to ObsSpace associated with ObsFilterData.
void get(const Variable &varname, std::vector< float > &values) const
Fills a std::vector with values of the specified variable.
oops::Variables toOopsVariables() const
size_t size() const
Return the number of constituent Variable objects (some of which may contain multiple channels).
integer function nlocs(this)
Return the number of observational locations in this Locations object.
static ObsFunctionMaker< LinearCombination > makerLinearCombination_("LinearCombination")