11 #include <Eigen/Dense>
17 #include "oops/base/Variables.h"
18 #include "oops/util/ObjectCounter.h"
19 #include "oops/util/Printable.h"
22 template <
typename DATATYPE>
class ObsDataVector;
34 private util::ObjectCounter<ObsVector> {
36 static const std::string
classname() {
return "ioda::ObsVector";}
58 void axpy(
const std::vector<double> & beta,
const ObsVector & y);
76 unsigned int nobs()
const;
101 bool has(
const std::string & var)
const {
return obsvars_.has(var);}
106 void save(
const std::string &)
const;
107 void read(
const std::string &);
110 void print(std::ostream &)
const;
ObsDataVector<DATATYPE> handles vectors of data of type DATATYPE in observation space.
ObsVector class to handle vectors in observation space for IODA.
void read(const std::string &)
std::size_t nlocs() const
void mask(const ObsDataVector< int > &mask)
Set this ObsVector values to missing where mask is non-zero.
void save(const std::string &) const
ObsSpace & obsdb_
Associate ObsSpace object.
void axpy(const double &beta, const ObsVector &y)
adds beta * y to the current vector
double & operator[](const std::size_t ii)
std::size_t nvars() const
ObsVector & operator*=(const double &)
const double & operator[](const std::size_t ii) const
ObsVector & operator/=(const ObsVector &)
ObsVector(ObsSpace &, const std::string &name="")
const ObsSpace & space() const
void ones()
set all elements to one (used in tests)
unsigned int nobs() const
Number of active observations (missing values not included) across all MPI tasks.
ObsVector & operator=(const ObsVector &)
bool has(const std::string &var) const
const std::string & obstype() const
Eigen::VectorXd packEigen(const ObsVector &mask) const
ObsVector & operator-=(const ObsVector &)
oops::Variables obsvars_
Variables.
const double & toFortran() const
double dot_product_with(const ObsVector &other) const
global (across all MPI tasks) dot product of this with other
size_t packEigenSize(const ObsVector &mask) const
const oops::Variables & varnames() const
const double missing_
Missing data mark.
void print(std::ostream &) const
static const std::string classname()
std::vector< double > multivar_dot_product_with(const ObsVector &other) const
std::vector< double > values_
Vector data.
ObsVector & operator+=(const ObsVector &)
std::size_t nvars_
Number of variables.