15 static TransformMaker<Cal_HeightFromPressure>
27 oops::Log::trace() <<
" Retrieve Height From Pressure" << std::endl;
29 std::vector<float> geopotentialHeight;
30 std::vector<float> airPressure;
31 bool hasBeenUpdated =
false;
33 const size_t nlocs_ =
obsdb_.nlocs();
35 ioda::ObsSpace::RecIdxIter irec;
44 bool staggeredLevels =
false;
47 if (airPressure.empty()) {
49 if (airPressure.empty()) {
50 oops::Log::warning() <<
"Air pressure vector is empty. "
51 <<
"Check will not be performed." << std::endl;
52 throw eckit::BadValue(
"Air pressure vector is empty ", Here());
54 staggeredLevels =
true;
60 getObservation(
"MetaData",
"geopotential_height_levels", geopotentialHeight);
62 getObservation(
"MetaData",
"geopotential_height", geopotentialHeight);
64 if (geopotentialHeight.empty()) {
65 geopotentialHeight = std::vector<float>(nlocs_);
66 std::fill(geopotentialHeight.begin(), geopotentialHeight.end(),
missingValueFloat);
71 for (irec =
obsdb_.recidx_begin(); irec !=
obsdb_.recidx_end(); ++irec) {
72 const std::vector<std::size_t> &rSort =
obsdb_.recidx_vector(irec);
76 for (ilocs = 0; ilocs < rSort.size(); ++ilocs) {
78 if (!apply[rSort[ilocs]])
continue;
84 airPressure[rSort[ilocs]],
method());
86 hasBeenUpdated =
true;
93 obsdb_.put_db(
outputTag,
"geopotential_height_levels", geopotentialHeight);
Cal_HeightFromPressure(const VariableTransformsParameters &options, const ObsFilterData &data, const std::shared_ptr< ioda::ObsDataVector< int >> &flags)
void runTransform(const std::vector< bool > &apply) override
Run variable conversion.
ObsFilterData provides access to all data related to an ObsFilter.
static TransformMaker< Cal_HeightFromPressure > makerCal_HeightFromPressure_("HeightFromPressure")