Go to the documentation of this file.
12 #include <boost/math/interpolators/barycentric_rational.hpp>
13 #include <boost/timer/timer.hpp>
22 using namespace netCDF;
23 using namespace netCDF::exceptions;
36 for (
size_t i=0;
i< NTWL;
i++) {
39 for (
size_t j=0;
j<3;
j++) {
40 for (
size_t k=0;
k<3;
k++) {
75 for (
size_t i=0;
i< NOWL+1;
i++) {
78 for (
size_t i=0;
i< NLWL+1;
i++) {
96 map<string, ddata*> imap )
100 size_t sx =
start[1];
101 lon_ =
static_cast<ddma<float,2>*
>(imap[
"longitude"])->pts[sy][sx];
102 lon_ = (lon_ > 180.0) ? lon_ - 360.0 : lon_;
103 lon_ = (lon_ < -180.0) ? lon_ + 360.0 : lon_;
104 lat_ =
static_cast<ddma<float,2>*
>(imap[
"latitude"])->pts[sy][sx];
105 lat_ = (lat_ > 90.0) ? lat_ - 180.0 : lat_;
106 lat_ = (lat_ < -90.0) ? lat_ + 180.0 : lat_;
107 solz_ =
static_cast<ddma<float,2>*
>(imap[
"solar_zenith"])->pts[sy][sx];
108 senz_ =
static_cast<ddma<float,2>*
>(imap[
"sensor_zenith"])->pts[sy][sx];
109 height_ =
static_cast<ddma<float,2>*
>(imap[
"elevation"])->pts[sy][sx]/1000.0;
118 raa_ = (raa_ > 360.0) ? fmod(raa_,360) : raa_;
119 raa_ = (raa_ > 180.0) ? 360.0 - raa_ : raa_;
120 if((solz_ > 0.0) && (senz_ > 0.0) && (raa_ > 0.0)) {
121 scatt_ = -cos (solz_*DEGtoRAD)*cos(senz_*DEGtoRAD)
122 + sin(solz_*DEGtoRAD)*sin(senz_*DEGtoRAD)
123 * cos (raa_*DEGtoRAD);
124 scatt_ = acos (scatt_)*RADtoDEG;
126 ws_ =
static_cast<ddma<float,2>*
>(imap[
"wind_speed"])->pts[sy][sx];
127 pwv_ =
static_cast<ddma<float,2>*
>(imap[
"water_vapor"])->pts[sy][sx];
128 oz_ =
static_cast<ddma<float,2>*
>(imap[
"ozone"])->pts[sy][sx];
129 ps_ =
static_cast<ddma<float,2>*
>(imap[
"surface_pressure"])->pts[sy][sx]/100.0;
132 size_t ilmin = (sy==0) ? 1 : 0;
133 size_t ilmax = (sy==
count[0]-1) ? 1 : 2;
134 size_t ipmin = (sx==0) ? 1 : 0;
135 size_t ipmax = (sx==
count[1]-1) ? 1 : 2;
139 for (
size_t il=0; il<3; il++) {
140 for (
size_t ip=0; ip<3; ip++) {
144 rfl_[(size_t) it.second] = (
static_cast<ddma<float,2>*
>(imap[
name]))->pts[sy][sx];
145 for (
size_t il=ilmin; il<=ilmax; il++) {
146 for (
size_t ip=ipmin; ip<=ipmax; ip++) {
147 rfla_[(size_t)it.second][il][ip] =
166 map<string, ddata*> omap;
167 int status = DTDB_SUCCESS;
169 omap.insert({
"status", pstat});
171 omap.insert({
"status", pstat});
173 (
unsigned char) cloud_mask_);
174 omap.insert({
"cloud_mask", puc});
176 omap.insert({
"aerosol_type", psh});
178 omap.insert({
"angstrom", pfl});
185 omap.insert({
"ndvi", pfl});
187 omap.insert({
"residual_error", pfl});
190 qual = (short) ceil(-log10(pfl->
val));
194 omap.insert({
"quality_flag", psh});
197 omap.insert({
"fmf_550", pfl});
199 omap.insert({
"chlorophyll", pfl});
201 omap.insert({
"glint_angle", pfl});
203 omap.insert({
"scattering_angle", pfl});
208 omap.insert({
name, pfl});
213 if (!bcloudmask_ && (pfl->
val > 0)) {
214 pfl->
val = log10(pfl->
val);
216 omap.insert({
name, pfl});
221 omap.insert({
name, pfl});
223 string oname =
"ssa" +
name.substr(7);
224 omap.insert({oname, pfl});
230 vector<float> tba = {490.0,550.0,670.0,865.0,1240.0,1610.0,2250.0};
231 vector<float> yba(begin(aot_)+1, end(aot_));
232 using boost::math::barycentric_rational;
233 barycentric_rational<float>
interp(move(tba), move(yba));
236 omap.insert({
"aot_380", pfl});
243 omap.insert({
"l2_flags", pflags});
262 for (
size_t i=0;
i< NOWL+1;
i++) {
265 for (
size_t i=0;
i< NLWL+1;
i++) {
void interp(double *ephemPtr, int startLoc, double *inTime, int numCoefs, int numCom, int numSets, int velFlag, double *posvel)
@ SHORT
signed 2 byte integer
constexpr unsigned char DFILL_UBYTE
@ UBYTE
unsigned 1 byte int
@ FLOAT
single precision floating point number
int get_inputs(vector< size_t > start, vector< size_t > count, map< string, ddata * > imap)
static const map< string, srf_band > srf_band_names
map< string, ddata * > set_outputs()
map< string, ddata * > set_fills()
static const map< string, aot_band > aot_band_names
constexpr float DFILL_FLOAT
@ INT
signed 4 byte integer
def set_outputs(output_keys)
static const map< string, rhot_band > rhot_band_names
constexpr short DFILL_SHORT