18 #include "ioda/ObsDataVector.h"
19 #include "oops/util/IntSetParser.h"
47 invars_ +=
Variable(
"brightness_temperature_assuming_clear_sky@ObsDiag" , channels_);
66 const size_t nlocs = in.
nlocs();
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);
81 std::vector<float> bt90(nlocs), bt150(nlocs);
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);
100 for (
size_t iloc = 0; iloc < nlocs; ++iloc) {
101 bt90[iloc] = bt90[iloc] - bias90[iloc];
102 bt150[iloc] = bt150[iloc] - bias150[iloc];
105 for (
size_t iloc = 0; iloc < nlocs; ++iloc) {
106 bt90[iloc] = bt90[iloc] + bias90[iloc];
107 bt150[iloc] = bt150[iloc] + bias150[iloc];
109 if (clr90[iloc] > -1.0f && clr90[iloc] < 1.0f) {
110 clr90[iloc] = bt90[iloc];
112 clr90[iloc] = clr90[iloc] + bias90[iloc];
114 if (clr150[iloc] > -1.0f && clr150[iloc] < 1.0f) {
115 clr150[iloc] = bt150[iloc];
117 clr150[iloc] = clr150[iloc] + bias150[iloc];
124 for (
size_t iloc = 0; iloc < nlocs; ++iloc) {
125 if (water_frac[iloc] >= 0.99) {
126 float siclr = clr90[iloc] - clr150[iloc];
127 out[igrp][iloc] = bt90[iloc] - bt150[iloc] - siclr;
129 out[igrp][iloc] = bt90[iloc] - bt150[iloc];