13 #include "ioda/ObsDataVector.h"
14 #include "oops/util/missingValues.h"
23 SatWindsLNVDCheck::SatWindsLNVDCheck(
const eckit::LocalConfiguration & conf)
27 options_.deserialize(conf);
30 invars_ +=
Variable(
"eastward_wind@ObsValue");
31 invars_ +=
Variable(
"northward_wind@ObsValue");
34 std::string test_hofx = options_.test_hofx.value();
35 invars_ +=
Variable(
"eastward_wind@" + test_hofx);
36 invars_ +=
Variable(
"northward_wind@" + test_hofx);
43 SatWindsLNVDCheck::~SatWindsLNVDCheck() {}
47 void SatWindsLNVDCheck::compute(
const ObsFilterData & in,
49 const size_t nlocs = in.nlocs();
53 ASSERT(out.nvars() == 1);
56 std::vector<float> u, v;
57 in.get(Variable(
"eastward_wind@ObsValue"), u);
58 in.get(Variable(
"northward_wind@ObsValue"), v);
60 std::string test_hofx = options_.test_hofx.value();
61 std::vector<float> um, vm;
62 in.get(Variable(
"eastward_wind@" + test_hofx), um);
63 in.get(Variable(
"northward_wind@" + test_hofx), vm);
65 for (
size_t jj = 0; jj <
nlocs; ++jj) {
67 if ((u[jj]*u[jj] + v[jj]*v[jj]) > 1.01f) {
68 out[0][jj] = sqrt((u[jj]-um[jj])*(u[jj]-um[jj]) + (v[jj]-vm[jj])*(v[jj]-vm[jj]))
69 / log(sqrt(u[jj]*u[jj] + v[jj]*v[jj]));
71 out[0][jj] = sqrt((u[jj]-um[jj])*(u[jj]-um[jj]) + (v[jj]-vm[jj])*(v[jj]-vm[jj]));
81 const ufo::Variables & SatWindsLNVDCheck::requiredVariables()
const {
integer function nlocs(this)
Return the number of observational locations in this Locations object.
static ObsFunctionMaker< SatWindsLNVDCheck > makerObsFuncSatWindsLNVDCheck_("SatWindsLNVDCheck")