15 #include "ioda/ObsDataVector.h"
44 std::vector<float> &sun_glint = out[0];
45 std::vector<float> sun_zenith(
nlocs), sun_azimuth(
nlocs);
46 std::vector<float> sat_zenith(
nlocs), sat_azimuth(
nlocs);
48 in.
get(
Variable(
"solar_zenith_angle@MetaData"), sun_zenith);
49 in.
get(
Variable(
"solar_azimuth_angle@MetaData"), sun_azimuth);
50 in.
get(
Variable(
"sensor_zenith_angle@MetaData"), sat_zenith);
51 in.
get(
Variable(
"sensor_azimuth_angle@MetaData"), sat_azimuth);
52 for (
size_t iloc = 0; iloc <
nlocs; ++iloc) {
57 float cosza = cos(sat_zenith[iloc]);
58 float bearaz = sun_azimuth[iloc] - sat_azimuth[iloc] + M_PI;
59 sun_glint[iloc] = acos(cos(sun_zenith[iloc])*cosza + sin(sun_zenith[iloc])
ObsFilterData provides access to all data related to an ObsFilter.
size_t nlocs() const
Returns the number of locations in the associated ObsSpace.
void get(const Variable &varname, std::vector< float > &values) const
Fills a std::vector with values of the specified variable.
SunGlintAngle(const eckit::LocalConfiguration &=eckit::LocalConfiguration())
void compute(const ObsFilterData &, ioda::ObsDataVector< float > &) const
compute the result of the function
const ufo::Variables & requiredVariables() const
geovals required to compute the function
integer function nlocs(this)
Return the number of observational locations in this Locations object.
static ObsFunctionMaker< SunGlintAngle > makerSunGlintAngle_("SunGlintAngle")
static constexpr double deg2rad
static constexpr double rad2deg