18 #include "ioda/ObsDataVector.h"
19 #include "oops/util/IntSetParser.h"
47 invars_ +=
Variable(
"brightness_temperature_assuming_clear_sky@ObsDiag" , channels_);
67 const size_t ngrps = vargrp.size();
72 std::vector<float> clr90(
nlocs), clr150(
nlocs);
73 in.
get(
Variable(
"brightness_temperature_assuming_clear_sky@ObsDiag", channels_)[0], clr90);
74 in.
get(
Variable(
"brightness_temperature_assuming_clear_sky@ObsDiag", channels_)[1], clr150);
77 std::vector<float> water_frac(
nlocs);
78 in.
get(
Variable(
"water_area_fraction@GeoVaLs"), water_frac);
82 for (
size_t igrp = 0; igrp < ngrps; ++igrp) {
84 in.
get(
Variable(
"brightness_temperature@" + vargrp[igrp], channels_)[0], bt90);
85 in.
get(
Variable(
"brightness_temperature@" + vargrp[igrp], channels_)[1], bt150);
88 std::vector<float> bias90(
nlocs), bias150(
nlocs);
95 bias90.assign(
nlocs, 0.0f);
96 bias150.assign(
nlocs, 0.0f);
101 for (
size_t iloc = 0; iloc <
nlocs; ++iloc) {
102 bt90[iloc] = bt90[iloc] - bias90[iloc];
103 bt150[iloc] = bt150[iloc] - bias150[iloc];
106 for (
size_t iloc = 0; iloc <
nlocs; ++iloc) {
108 if (clr90[iloc] > -1.0f && clr90[iloc] < 1.0f) {
109 clr90[iloc] = bt90[iloc];
111 clr90[iloc] = clr90[iloc] + bias90[iloc];
113 if (clr150[iloc] > -1.0f && clr150[iloc] < 1.0f) {
114 clr150[iloc] = bt150[iloc];
116 clr150[iloc] = clr150[iloc] + bias150[iloc];
123 for (
size_t iloc = 0; iloc <
nlocs; ++iloc) {
124 if (water_frac[iloc] >= 0.99) {
125 float siclr = clr90[iloc] - clr150[iloc];
126 out[igrp][iloc] = bt90[iloc] - bt150[iloc] - siclr;
128 out[igrp][iloc] = bt90[iloc] - bt150[iloc];
ObsFilterData provides access to all data related to an ObsFilter.
size_t nlocs() const
Returns the number of locations in the associated ObsSpace.
bool has(const Variable &varname) const
Returns true if variable varname is known to ObsFilterData, false otherwise.
void get(const Variable &varname, std::vector< float > &values) const
Fills a std::vector with values of the specified variable.
const ufo::Variables & requiredVariables() const
geovals required to compute the function
SIRetMW(const eckit::LocalConfiguration &=eckit::LocalConfiguration())
SIRetMWParameters options_
void compute(const ObsFilterData &, ioda::ObsDataVector< float > &) const
compute the result of the function
oops::Parameter< std::string > addBias
oops::Parameter< std::string > testBias
oops::RequiredParameter< std::vector< std::string > > varGroup
oops::RequiredParameter< int > ch150
oops::RequiredParameter< int > ch90
integer function nlocs(this)
Return the number of observational locations in this Locations object.
static ObsFunctionMaker< SIRetMW > makerSIRetMW_("SIRetMW")