16 #include "ioda/ObsDataVector.h"
17 #include "oops/util/IntSetParser.h"
18 #include "oops/util/missingValues.h"
29 : invars_(), channels_() {
35 std::set<int> channelset = oops::parseIntSet(chlist);
36 std::copy(channelset.begin(), channelset.end(), std::back_inserter(
channels_));
56 std::vector<float> clr(
nlocs);
57 std::vector<float> bak(
nlocs);
58 std::vector<float> obs(
nlocs);
59 std::vector<float> bias(
nlocs);
63 for (
size_t ich = 0; ich < SCI.nvars(); ++ich) {
71 std::fill(bias.begin(), bias.end(), 0.0f);
73 for (
size_t iloc = 0; iloc <
nlocs; ++iloc) {
78 if (clr[iloc] > -1.0f && clr[iloc] < 1.0f) clr[iloc] = bak[iloc];
81 Cmod =
std::abs(clr[iloc] - bak[iloc] + bias[iloc]);
82 Cobs =
std::abs(clr[iloc] - obs[iloc] + bias[iloc]);
83 SCI[ich][iloc] = 0.5f * (Cmod + Cobs);
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.
SymmCldImpactIR(const eckit::LocalConfiguration)
SymmCldImpactIRParameters options_
const ufo::Variables & requiredVariables() const
geovals required to compute the function
void compute(const ObsFilterData &, ioda::ObsDataVector< float > &) const
compute the result of the function
std::vector< int > channels_
oops::RequiredParameter< std::string > chlist
channels for which SCI will be calculated
integer function nlocs(this)
Return the number of observational locations in this Locations object.
static ObsFunctionMaker< SymmCldImpactIR > makerSCIIR_("SymmCldImpactIR")
util::Duration abs(const util::Duration &duration)