11 #include "eckit/exception/Exceptions.h"
13 #include "ioda/ObsSpace.h"
15 #include "oops/util/missingValues.h"
18 #include "ufo/GeoVaLs.h"
23 static PredictorMaker<CloudLiquidWater>
37 if (satellite ==
"SSMIS") {
54 std::string errString =
"Currently only SSMIS satellite is supported.";
55 oops::Log::error() << errString;
56 throw eckit::BadValue(errString);
65 ioda::ObsVector & out)
const {
68 const std::size_t
nlocs = out.nlocs();
69 const std::size_t nvars = out.nvars();
71 const float fmiss = util::missingValue(fmiss);
72 const double dmiss = util::missingValue(dmiss);
77 odb.get_db(vargrp,
"brightness_temperature_" + std::to_string(
channels_[0]), bt19h);
78 odb.get_db(vargrp,
"brightness_temperature_" + std::to_string(
channels_[1]), bt19v);
79 odb.get_db(vargrp,
"brightness_temperature_" + std::to_string(
channels_[2]), bt22v);
80 odb.get_db(vargrp,
"brightness_temperature_" + std::to_string(
channels_[3]), bt37h);
81 odb.get_db(vargrp,
"brightness_temperature_" + std::to_string(
channels_[4]), bt37v);
82 odb.get_db(vargrp,
"brightness_temperature_" + std::to_string(
channels_[5]), bt91v);
83 odb.get_db(vargrp,
"brightness_temperature_" + std::to_string(
channels_[6]), bt91h);
85 std::vector<float> szas(
nlocs);
86 odb.get_db(
"MetaData",
"sensor_zenith_angle", szas);
88 std::vector<float> water_frac(
nlocs, 0.0);
89 geovals.
get(water_frac,
"water_area_fraction");
96 for (std::size_t iloc = 0; iloc <
nlocs; ++iloc) {
97 for (std::size_t jvar = 0; jvar < nvars; ++jvar) {
99 if (
clw[iloc] == fmiss) {
100 out[iloc*nvars + jvar] = dmiss;
102 out[iloc*nvars + jvar] =
static_cast<double>(
clw[iloc]*cossza*cossza);
static void cloudLiquidWater(const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, std::vector< float > &, std::vector< float > &)
CloudLiquidWaterParameters options_
std::vector< int > channels_
void compute(const ioda::ObsSpace &, const GeoVaLs &, const ObsDiagnostics &, ioda::ObsVector &) const override
compute the predictor
CloudLiquidWater(const Parameters_ &, const oops::Variables &)
Configuration parameters of the CloudLiquidWater predictor.
oops::OptionalParameter< int > ch91v
oops::OptionalParameter< int > ch22v
oops::RequiredParameter< std::string > satellite
We must specify a satellite reference name such as SSMIS to know which channels to expect.
oops::OptionalParameter< int > ch19h
oops::OptionalParameter< int > ch37v
oops::Parameter< std::string > varGroup
In case we need to override the ObsValue group name with another optional group name.
oops::OptionalParameter< int > ch19v
oops::OptionalParameter< int > ch91h
oops::OptionalParameter< int > ch37h
GeoVaLs: geophysical values at locations.
void get(std::vector< double > &, const std::string &var) const
Get 2D GeoVaLs for variable var (fails for 3D GeoVaLs)
integer function nlocs(this)
Return the number of observational locations in this Locations object.
static PredictorMaker< CloudLiquidWater > makerFuncCloudLiquidWater_("cloud_liquid_water")
static constexpr double deg2rad