127 memset(refl_rayl_, 0, NWAV*
sizeof(
float));
128 memset(refl_big_, 0, NWAV*NUM_CASES_BIG*NAOT*
sizeof(
float));
129 memset(refl_small_, 0, NWAV*NUM_CASES_SMALL*NAOT*
sizeof(
float));
130 memset(albedo_R_small_tau_, 0, NWAV*NUM_CASES_SMALL*NAOT*
sizeof(
float));
131 memset(albedo_R_big_tau_, 0, NWAV*NUM_CASES_BIG*NAOT*
sizeof(
float));
132 memset(albedo_T_small_tau_, 0, NWAV*NUM_CASES_SMALL*NAOT*
sizeof(
float));
133 memset(albedo_T_big_tau_, 0, NWAV*NUM_CASES_BIG*NAOT*
sizeof(
float));
134 memset(refl_, 0, NWAV*
sizeof(
float));
135 memset(sdev_, 0, NWAV*
sizeof(
float));
136 memset(numData_, 0, NWAV*
sizeof(
int));
137 memset(good_pixels_, 0, NWAV*
sizeof(
int));
138 memset(tau_, 0, NWAV*NUMCASES*NUMCASEB*
sizeof(
float));
139 memset(tau_small_, 0, NWAV*NUMCASES*NUMCASEB*
sizeof(
float));
140 memset(tau_big_, 0, NWAV*NUMCASES*NUMCASEB*
sizeof(
float));
141 memset(backscatter_, 0, NWAV*NUMCASES*NUMCASEB*
sizeof(
float));
142 memset(assym_, 0, NWAV*NUMCASES*NUMCASEB*
sizeof(
float));
143 memset(refl_flux_, 0, NWAV*NUMCASES*NUMCASEB*
sizeof(
float));
144 memset(trans_flux_, 0, NWAV*NUMCASES*NUMCASEB*
sizeof(
float));
145 memset(angstrom_exp_, 0, NUM_STATS*NUMCASES*NUMCASEB*
sizeof(
float));
146 memset(solution_index_, 0, NUM_SIZES*NUMCASES*NUMCASEB*
sizeof(
float));
147 memset(ccn_, 0, NUMCASES*NUMCASEB*
sizeof(
float));
148 memset(eff_radius_, 0, NUMCASES*NUMCASEB*
sizeof(
float));
149 memset(eff_variance_, 0, NUMCASES*NUMCASEB*
sizeof(
float));
150 memset(mass_con_ocean_, 0, NUMCASES*NUMCASEB*
sizeof(
float));
151 memset(xmin_, 0, 2*NUMCASES*NUMCASEB*
sizeof(
float));
152 memset(funmin_, 0, 2*NUMCASES*NUMCASEB*
sizeof(
float));
153 memset(tau_X55_, 0, 2*NUMCASES*NUMCASEB*
sizeof(
float));
154 memset(error_, 0, 2*NWAV*NUMCASES*NUMCASEB*
sizeof(
float));
155 memset(refl_avg_, 0, NWAV*
sizeof(
float));
156 memset(sdev_avg_, 0, NWAV*
sizeof(
float));
157 memset(tau_avg_, 0, NUM_STATS*NWAV*
sizeof(
float));
158 memset(tau_small_avg_, 0, NUM_STATS*NWAV*
sizeof(
float));
159 memset(tau_big_avg_, 0, NUM_STATS*NWAV*
sizeof(
float));
160 memset(backscatter_avg_, 0, NUM_STATS*NWAV*
sizeof(
float));
161 memset(assym_avg_, 0, NUM_STATS*NWAV*
sizeof(
float));
162 memset(refl_flux_avg_, 0, NUM_STATS*NWAV*
sizeof(
float));
163 memset(trans_flux_avg_, 0, NUM_STATS*NWAV*
sizeof(
float));
164 memset(angstrom_exp_avg_, 0, NUM_STATS*NUM_SIZES*
sizeof(
float));
165 memset(solution_index_avg_, 0, NUM_STATS*NUM_SIZES*
sizeof(
float));
166 memset(ccn_avg_, 0, NUM_STATS*
sizeof(
float));
167 memset(eff_radius_avg_, 0, NUM_STATS*
sizeof(
float));
168 memset(eff_variance_avg_, 0, NUM_STATS*
sizeof(
float));
169 memset(mass_con_ocean_avg_, 0, NUM_STATS*
sizeof(
float));
170 memset(xmin_avg_, 0, NUM_STATS*
sizeof(
float));
171 memset(funmin_avg_, 0, NUM_STATS*
sizeof(
float));
172 memset(tau_X55_avg_, 0, NUM_STATS*
sizeof(
float));
174 qcontrol_exclude_= 0;
175 qcontrol_special_= 0;
177 quality_dust_flag_glint_= 0;
178 quality_dust_flag_off_glint_= 0;
179 memset(quality_to_pass_, 0, 2*
sizeof(
short));
180 memset(quality_flag_, 0, 12*
sizeof(
short));
181 memset(sds_refl_, 0, NWAV*
sizeof(
float));
182 memset(sds_refl_sdev_, 0, NWAV*
sizeof(
float));
183 memset(sds_numPixels_, 0, NWAV*
sizeof(
short));
184 memset(sds_tau_best_, 0, NWAV*
sizeof(
float));
185 memset(sds_tau_avg_, 0, NWAV*
sizeof(
float));
186 memset(sds_tau_big_best_, 0, NWAV*
sizeof(
float));
187 memset(sds_tau_big_avg_, 0, NWAV*
sizeof(
float));
188 memset(sds_tau_small_best_, 0, NWAV*
sizeof(
float));
189 memset(sds_tau_small_avg_, 0, NWAV*
sizeof(
float));
190 memset(sds_assy_best_, 0, NWAV*
sizeof(
float));
191 memset(sds_assy_avg_, 0, NWAV*
sizeof(
float));
192 memset(sds_back_best_, 0, NWAV*
sizeof(
float));
193 memset(sds_back_avg_, 0, NWAV*
sizeof(
float));
194 memset(sds_reff_best_, 0, NWAV*
sizeof(
float));
195 memset(sds_reff_avg_, 0, NWAV*
sizeof(
float));
196 memset(sds_tranf_best_, 0, NWAV*
sizeof(
float));
197 memset(sds_tranf_avg_, 0, NWAV*
sizeof(
float));
198 sds_Tau_Land_Ocean_= 0;
199 sds_Tau_Land_Ocean_img_= 0;
200 memset(sds_Small_Weighting_, 0, NUM_SIZES*
sizeof(
float));
201 memset(sds_Least_Error_, 0, NUM_SIZES*
sizeof(
float));
202 memset(sds_tau_X55_, 0, NUM_SIZES*
sizeof(
float));
203 memset(sds_EffRad_, 0, NUM_SIZES*
sizeof(
float));
204 memset(sds_EffVar_, 0, NUM_SIZES*
sizeof(
float));
205 memset(sds_Sol_Index_Small_, 0, NUM_SIZES*
sizeof(
short));
206 memset(sds_Sol_Index_Large_, 0, NUM_SIZES*
sizeof(
short));
207 memset(sds_Angs_Coeff1_, 0, NUM_SIZES*
sizeof(
float));
208 memset(sds_Angs_Coeff2_, 0, NUM_SIZES*
sizeof(
float));
209 memset(sds_Mass_Conc_, 0, NUM_SIZES*
sizeof(
float));
210 memset(sds_CCN_, 0, NUM_SIZES*
sizeof(
float));
211 memset(sds_AOT_model_, 0, (NUMCASES+NUMCASEB)*
sizeof(
float));
212 sds_land_ocean_quality_= 0;
239 int status = DTDB_SUCCESS;
241 qcontrol_special_ = 0;
262 map<string, ddata*> imap)
272 if((solz_ >= MINMTHET0) && (solz_ <= MAXMTHET0) &&
273 (senz_ >= MINMTHET) && (senz_ <= MAXMTHET) &&
274 (raa_ >= MINMPHI) && (raa_ <= MAXMPHI)) {
286 compute_gas_correction();
298 cm_->compute(cmask_);
299 cloud_mask_ = (cmask_+1)%2;
301 cmask_ = (cloud_mask_+1)%2;
303 if (!bcloudmask_) cmask_ = 1;
304 if (bcloudmask_ && cloud_mask_) {
309 compute_glint_angle();
310 index_geometry( solz_, senz_, raa_ );
311 interpolate_rayleigh();
316 ((refl_[
D550] > 0) && (refl_[
D670] > 0) &&
317 (refl_[
D865] > 0) && (refl_[
D2250] > 0) &&
318 (qcontrol_special_== 0 || qcontrol_special_== 2))) {
320 interpolate_angles();
323 for (
int iSmall=0; iSmall<NUMCASES; iSmall++) {
324 for (
int iBig=0; iBig<NUMCASEB; iBig++) {
327 compute_minimum(iBig, iSmall, iSol);
328 compute_tau_flux(iBig, iSmall, iSol);
329 solution_index_[
ISMALL][iSol] = iSmall;
330 solution_index_[
IBIG][iSol] = iBig;
338 qcontrol_ = (tau_avg_[1][0] > MAXTAU) ? -29 : qcontrol_;
339 qcontrol_ = (tau_avg_[1][0] < 0) ? 9 : qcontrol_;
340 qcontrol_ = (tau_avg_[1][0] <= MINTAU) ? -28 : qcontrol_;
342 else if (qcontrol_special_ == 3) qcontrol_ = -21;
344 else qcontrol_ = -26;
350 qual_flag_ = quality_to_pass_[0];
351 aerosol_type_ = (NUMCASEB-1)*sds_Sol_Index_Large_[1] +
352 sds_Sol_Index_Small_[1];
353 error_flag_ =
abs(quality_to_pass_[1]);
355 scatter_ang_ = 180.0 - glint_angle_;
356 glint_ang_ = glint_angle_;
357 sse_ = sds_Least_Error_[1];
358 fmf_ = sds_Small_Weighting_[1];
359 aot_550_ = sds_tau_X55_[1];
360 ae1_ = sds_Angs_Coeff1_[1];
361 ae2_ = sds_Angs_Coeff2_[1];
365 for (
int iWav=0; iWav<NOWL; iWav++ ) {
366 aot_[iWav+1] = sds_tau_avg_[iWav];
368 for (
int iWav=0; iWav<NLWL+1; iWav++ ) {
385 int status = DTDB_SUCCESS;
387 float del = (
sza <= lut_.THET0[4]) ? 12.0 : 6.0;
388 SZA_0_ = (
sza <= lut_.THET0[4]) ? (
int)(
sza/del) : (
int)(
sza/del)-4;
390 THE_0_ = (
int)(azim/6.0);
392 PHI_0_ = (
int)(phi/12.0);
408 int status = DTDB_SUCCESS;
411 while ((wind_[++lutindex] < ws_) &&
412 (lutindex < (WIND_LUT_ENTRIES-1))) {}
413 short iws1 = lutindex-1;
414 short iws2 = lutindex;
415 float ws_lut[WIND_LUT_ENTRIES];
416 memset(ws_lut, 0, WIND_LUT_ENTRIES*
sizeof(
float));
417 float phi_out[2] = {0.0,0.0};
418 float the_out[2] = {0.0,0.0};
419 float sza_out[2] = {0.0,0.0};
420 for (
int iWav=0; iWav<NWAV; iWav++) {
422 for (
int iWS=iws1; iWS <= iws2; iWS++ ) {
423 ws_lut[numWS] = wind_[iWS];
425 for (
int iSza=SZA_0_; iSza<=SZA_1_; iSza++) {
427 for (
int iThe=THE_0_; iThe<=THE_1_; iThe++) {
429 for (
int iPhi=PHI_0_; iPhi<=PHI_1_; iPhi++) {
432 interp_extrap(numPhi, raa_, &lut_.PHC[PHI_0_],
433 &lut_.REF_RAYALL[iWav][iWS][iSza][iThe][PHI_0_],
437 interp_extrap(numThe, senz_, &lut_.THET[THE_0_],
438 phi_out, the_out[numSza]);
441 interp_extrap(numSza, solz_, &lut_.THET0[SZA_0_],
442 the_out, sza_out[numWS]);
445 interp_extrap(numWS, ws_, ws_lut, sza_out, refl_rayl_[iWav]);
447 refl_rayl_[iWav] *=
M_PI/cos(DEGtoRAD*solz_);
463 int status = DTDB_SUCCESS;
466 while ((wind_[++lutindex] < ws_) &&
467 (lutindex < (WIND_LUT_ENTRIES-1))) {}
468 short iws1 = lutindex-1;
469 short iws2 = lutindex;
470 float ws_lut[WIND_LUT_ENTRIES];
471 memset(ws_lut, 0, WIND_LUT_ENTRIES*
sizeof(
float));
473 float phi_out[2][2] = {{0.0,0.0},{0.0,0.0}};
474 float the_out[2][2] = {{0.0,0.0},{0.0,0.0}};
475 float sza_out[2][2] = {{0.0,0.0},{0.0,0.0}};
478 for (
int iWav=0; iWav<NWAV; iWav++) {
480 for (
int iCase=0; iCase<NUMCASES; iCase++) {
481 for (
int iTau=0; iTau<NAOT; iTau++) {
483 for (
int iWS=iws1; iWS <= iws2; iWS++) {
484 ws_lut[numWS] = wind_[iWS];
486 for (
int iSza=SZA_0_; iSza<=SZA_1_; iSza++) {
489 interp_extrap(numSza, solz_, &lut_.THET0[SZA_0_],
490 &lut_.ALBEDO_R_SMALL[iWav][iCase][iTau][iWS][SZA_0_],
492 interp_extrap(numSza, solz_, &lut_.THET0[SZA_0_],
493 &lut_.ALBEDO_T_SMALL[iWav][iCase][iTau][iWS][SZA_0_],
497 interp_extrap(numWS, ws_, ws_lut,
498 sza_out[0], albedo_R_small_tau_[iWav][iCase][iTau]);
499 interp_extrap(numWS, ws_, ws_lut,
500 sza_out[1], albedo_T_small_tau_[iWav][iCase][iTau]);
504 for (
int iCase=0; iCase<NUMCASEB; iCase++) {
505 for (
int iTau=0; iTau<NAOT; iTau++) {
507 for (
int iWS=iws1; iWS <= iws2; iWS++) {
508 ws_lut[numWS] = wind_[iWS];
510 for (
int iSza=SZA_0_; iSza<=SZA_1_; iSza++) {
513 interp_extrap(numSza, solz_, &lut_.THET0[SZA_0_],
514 &lut_.ALBEDO_R_BIG[iWav][iCase][iTau][iWS][SZA_0_],
516 interp_extrap(numSza, solz_, &lut_.THET0[SZA_0_],
517 &lut_.ALBEDO_T_BIG[iWav][iCase][iTau][iWS][SZA_0_],
521 interp_extrap(numWS, ws_, ws_lut,
522 sza_out[0], albedo_R_big_tau_[iWav][iCase][iTau]);
523 interp_extrap(numWS, ws_, ws_lut,
524 sza_out[1], albedo_T_big_tau_[iWav][iCase][iTau]);
529 for (
int iWav = 0; iWav < NWAV; iWav++) {
530 for (
int iCase = 0; iCase < NUMCASES; iCase++) {
531 for (
int iTau = 1; iTau < NAOT; iTau++) {
533 for (
int iWS = iws1; iWS <= iws2; iWS++) {
534 ws_lut[numWS] = wind_[iWS];
536 for (
int iSza = SZA_0_; iSza <= SZA_1_; iSza++) {
538 for (
int iThe = THE_0_; iThe <= THE_1_; iThe++) {
540 for (
int iPhi = PHI_0_; iPhi <= PHI_1_; iPhi++) {
543 interp_extrap(numPhi, raa_, &lut_.PHC[PHI_0_],
544 &lut_.AINTS[iWav][iCase][iTau][iWS][iSza][iThe][PHI_0_],
548 interp_extrap(numThe, senz_, &lut_.THET[THE_0_],
552 interp_extrap(numSza, solz_, &lut_.THET0[SZA_0_],
556 interp_extrap(numWS, ws_, ws_lut, sza_out[
ISMALL],
558 refl_small_[iWav][iCase][iTau] = ws_out *
M_PI
559 / cos( solz_*DEGtoRAD);
561 refl_small_[iWav][iCase][0] = refl_rayl_[iWav];
563 for (
int iCase = 0; iCase < NUMCASEB; iCase++) {
564 for (
int iTau = 1; iTau < NAOT; iTau++) {
566 for (
int iWS = iws1; iWS <= iws2; iWS++) {
567 ws_lut[numWS] = wind_[iWS];
569 for (
int iSza = SZA_0_; iSza <= SZA_1_; iSza++) {
571 for (
int iThe = THE_0_; iThe <= THE_1_; iThe++) {
573 for (
int iPhi = PHI_0_; iPhi <= PHI_1_; iPhi++) {
576 interp_extrap(numPhi, raa_, &lut_.PHC[PHI_0_],
577 &lut_.AINTB[iWav][iCase][iTau][iWS][iSza][iThe][PHI_0_],
578 phi_out[
IBIG][numThe]);
581 interp_extrap(numThe, senz_, &lut_.THET[THE_0_],
582 phi_out[
IBIG], the_out[
IBIG][numSza]);
585 interp_extrap(numSza, solz_, &lut_.THET0[SZA_0_],
586 the_out[
IBIG], sza_out[
IBIG][numWS]);
589 interp_extrap(numWS, ws_, ws_lut, sza_out[
IBIG],
591 refl_big_[iWav][iCase][iTau] = ws_out *
M_PI
592 / cos( solz_*DEGtoRAD);
594 refl_big_[iWav][iCase][0] = refl_rayl_[iWav];
613 int status = DTDB_SUCCESS;
616 while ((wind_[++lutindex] < ws_) &&
617 (lutindex < (WIND_LUT_ENTRIES-1))) {}
618 short iws1 = lutindex-1;
619 short iws2 = lutindex;
625 if((tau_X55_[0][iSol] <= 0.7) && (quality_dust_flag_glint_ == 1)) {
626 tau_X55_[0][iSol] = -0.02;
630 if(((tau_X55_[0][iSol] > MAXTAU) && (quality_dust_flag_glint_== 1)) ||
631 ((tau_X55_[0][iSol] > MAXTAU) &&
632 (quality_dust_flag_off_glint_== 1))) {
633 tau_X55_[0][iSol]= MAXTAU;
636 float tau_X55_small = tau_X55_[0][iSol]*xmin_[0][iSol];
637 float tau_X55_big = tau_X55_[0][iSol]- tau_X55_small;
639 float ws_lut[WIND_LUT_ENTRIES];
640 float rsmall[WIND_LUT_ENTRIES];
641 float rbig[WIND_LUT_ENTRIES];
642 memset(ws_lut, 0, WIND_LUT_ENTRIES*
sizeof(
float));
643 memset(rsmall, 0, WIND_LUT_ENTRIES*
sizeof(
float));
644 memset(rbig, 0, WIND_LUT_ENTRIES*
sizeof(
float));
646 for (
int iWav=0; iWav<NWAV; iWav++) {
648 for (
int iWS=iws1; iWS <= iws2; iWS++) {
649 ws_lut[numWS] = wind_[iWS];
651 lut_.EXTSMALL[iWav][iSmall][iWS]/lut_.EXTSMALL[
D550][iSmall][iWS];
653 lut_.EXTBIG[iWav][iBig][iWS]/lut_.EXTBIG[
D550][iBig][iWS];
656 float extsmall = 0.0;
657 interp_extrap(numWS,ws_,ws_lut,rsmall,extsmall);
659 interp_extrap(numWS,ws_,ws_lut,rbig,extbig);
661 tau_[iWav][iSol] = tau_X55_small*extsmall + tau_X55_big*extbig;
662 tau_small_[iWav][iSol] = tau_X55_small*extsmall;
663 tau_big_[iWav][iSol] = tau_X55_big*extbig;
666 if ((tau_[
D550][iSol] > 0) && (tau_[
D865][iSol] > 0)) {
667 float tlog = log(tau_[
D550][iSol]/tau_[
D865][iSol]) /
668 log(lut_.WAVE[
D865]/lut_.WAVE[
D550]);
669 angstrom_exp_[0][iSol] = tlog;
671 if ((tau_[
D865][iSol] > 0) && (tau_[
D2250][iSol] > 0)) {
672 float tlog = log(tau_[
D865][iSol]/tau_[
D2250][iSol]) /
674 angstrom_exp_[1][iSol] = tlog;
678 float albedo_R_small[NWAV][NUM_CASES_SMALL];
679 float albedo_R_big[NWAV][NUM_CASES_BIG];
680 float albedo_T_small[NWAV][NUM_CASES_SMALL];
681 float albedo_T_big[NWAV][NUM_CASES_BIG];
682 memset(albedo_R_small, 0, NWAV*NUM_CASES_SMALL*
sizeof(
float));
683 memset(albedo_R_big, 0, NWAV*NUM_CASES_BIG*
sizeof(
float));
684 memset(albedo_T_small, 0, NWAV*NUM_CASES_SMALL*
sizeof(
float));
685 memset(albedo_T_big, 0, NWAV*NUM_CASES_BIG*
sizeof(
float));
687 for (
int iWav=0; iWav<NWAV; iWav++) {
688 interp_extrap(NAOT,tau_[
D550][iSol],lut_.TAUAS[
D550][iSmall],
689 albedo_R_small_tau_[iWav][iSmall],albedo_R_small[iWav][iSmall]);
690 interp_extrap(NAOT,tau_[
D550][iSol],lut_.TAUAS[
D550][iSmall],
691 albedo_T_small_tau_[iWav][iSmall],albedo_T_small[iWav][iSmall]);
692 interp_extrap(NAOT,tau_[
D550][iSol],lut_.TAUAB[
D550][iBig],
693 albedo_R_big_tau_[iWav][iBig],albedo_R_big[iWav][iBig]);
694 interp_extrap(NAOT,tau_[
D550][iSol],lut_.TAUAB[
D550][iBig],
695 albedo_T_big_tau_[iWav][iBig],albedo_T_big[iWav][iBig]);
702 interp_extrap(numWS, ws_, &ws_lut[iws1],
703 &lut_.EXTSMALL[
D550][iSmall][iws1], wout);
704 float nSmall = tau_X55_small/wout;
705 interp_extrap(numWS, ws_, &ws_lut[iws1],
706 &lut_.EXTBIG[
D550][iBig][iws1], wout);
707 float nBig = tau_X55_big/wout;
708 interp_extrap(numWS, ws_, &ws_lut[iws1],
709 &lut_.CCNSMALL[iSmall][iws1], wout);
710 ccn_[iSol] = nSmall* wout;
712 eff_radius_[iSol] = 0.0;
713 eff_variance_[iSol] = 0.0;
714 mass_con_ocean_[iSol] = 0.0;
716 if (nSmall > 0.0 ||nBig > 0.0 ) {
717 float m[NUM_SIZES][NUM_MOMENTS];
718 memset(m, 0, NUM_SIZES*NUM_MOMENTS*
sizeof(
float));
719 for (
int iM=1; iM < NUM_MOMENTS; iM++) {
720 interp_extrap(numWS, ws_, &ws_lut[iws1],
721 &lut_.MOMENTSSMALL[iSmall][iM][iws1], m[
ISMALL][iM]);
722 interp_extrap(numWS, ws_, &ws_lut[iws1],
723 &lut_.MOMENTSBIG[iBig][iM][iws1], m[
IBIG][iM]);
725 eff_radius_[iSol] = (nSmall*m[
ISMALL][2]+ nBig*m[
IBIG][2]) /
727 mass_con_ocean_[iSol] = nSmall*m[
ISMALL][2]+ nBig*m[
IBIG][2];
728 eff_variance_[iSol] = (nSmall*m[
ISMALL][3]+ nBig*m[
IBIG][3])/
729 (pow(eff_radius_[iSol],2)*(nSmall*m[
ISMALL][1]+nBig*4))-1.0;
732 for (
int iWav=0; iWav<NWAV; iWav++) {
733 float al[NUM_SIZES] = {0.0,0.0};
734 float bs[NUM_SIZES] = {0.0,0.0};
735 float as[NUM_SIZES] = {0.0,0.0};
736 interp_extrap(numWS, ws_, &ws_lut[iws1],
737 &lut_.ALBEDOSMALL[iWav][iSmall][iws1], al[
ISMALL]);
738 interp_extrap(numWS, ws_, &ws_lut[iws1],
739 &lut_.ALBEDOBIG[iWav][iBig][iws1], al[
IBIG]);
740 interp_extrap(numWS, ws_, &ws_lut[iws1],
741 &lut_.BACKSCTTSMALL[iWav][iSmall][iws1],
bs[
ISMALL]);
742 interp_extrap(numWS, ws_, &ws_lut[iws1],
743 &lut_.BACKSCTTBIG[iWav][iBig][iws1],
bs[
IBIG]);
744 interp_extrap(numWS, ws_, &ws_lut[iws1],
745 &lut_.ASSYMSMALL[iWav][iSmall][iws1],
as[
ISMALL]);
746 interp_extrap(numWS, ws_, &ws_lut[iws1],
747 &lut_.ASSYMBIG[iWav][iBig][iws1],
as[
IBIG]);
749 if ((tau_small_[iWav][iSol] > 0.0) ||
750 (tau_big_[iWav][iSol] > 0.0)) {
751 backscatter_[iWav][iSol] =
754 (al[
ISMALL]*tau_small_[iWav][iSol] +
755 al[
IBIG]*tau_big_[iWav][iSol]);
759 (al[
ISMALL]*tau_small_[iWav][iSol] +
760 al[
IBIG]*tau_big_[iWav][iSol]);
761 refl_flux_[iWav][iSol] =
762 (tau_small_[iWav][iSol]* albedo_R_small[iWav][iSmall]
763 + tau_big_[iWav][iSol]*albedo_R_big[iWav][iBig])/
764 (tau_small_[iWav][iSol] + tau_big_[iWav][iSol]);
766 refl_flux_[iWav][iSol] =
767 (refl_flux_[iWav][iSol] - albedo_R_small_tau_[iWav][0][0]) *
770 trans_flux_[iWav][iSol]=
771 (tau_small_[iWav][iSol]*albedo_T_small[iWav][iSmall]
772 + tau_big_[iWav][iSol]*albedo_T_big[iWav][iBig])/
773 (tau_small_[iWav][iSol]+tau_big_[iWav][iSol]);
791 int status = DTDB_SUCCESS;
795 float refl_interm[NWAV][GRIDX*GRIDY];
796 float array_interm[NWAV][GRIDX*GRIDY];
797 memset(var, 0, NWAV*
sizeof(
float));
798 memset(dvar, 0, NWAV*
sizeof(
float));
799 memset(refl_interm, 0, NWAV*GRIDX*GRIDY*
sizeof(
float));
800 memset(array_interm, 0, NWAV*GRIDX*GRIDY*
sizeof(
float));
802 qcontrol_exclude_ = 0;
803 qcontrol_special_ = 0;
804 quality_dust_flag_glint_ = 0;
805 quality_dust_flag_off_glint_ = 0;
806 for (
int iWav=0; iWav<NWAV; iWav++) {
807 good_pixels_[iWav] = 0;
810 qcontrol_cirrus_ = 0;
812 for (
int iWav = 0; iWav<NWAV; iWav++) {
814 for (
int ix = 0; ix < GRIDX*GRIDY; ix++) {
819 compute_glint_angle();
820 compute_scatter_angle(scatter_angle_);
825 for (
size_t iy=0; iy<GRIDY; iy++ ) {
826 for (
size_t ix = 0; ix < GRIDX; ix++ ) {
830 if( rfld_[
D1240] > 0) {
832 (rfld_[
D670] > 1.50*refl_rayl_[
D670]) &&
835 ((rfld_[
D1380] > 0.01) && (rfld_[
D1380] <= 0.03))) {
836 qcontrol_cirrus_ = 1;
839 if (cmask_*smask > 0) {
849 numData_[
D1240] += 1;
851 numData_[
D1610] += 1;
853 numData_[
D2250] += 1;
861 int index[GRIDX*GRIDY];
867 int n10 = numData_[
D865]/4;
868 int n40 = (numData_[
D865]-n10);
871 int q1_pixels = (
int) LINE*LINE*0.025;
872 int q2_pixels = (
int) LINE*LINE*0.050;
873 int q3_pixels = (
int) LINE*LINE*0.075;
875 if ((n40-n10) > q1_pixels) {
876 for (
int iWav=0; iWav < NWAV; iWav++) {
877 for (
int ix=n10; ix < n40; ix++) {
878 if ((refl_interm[iWav][
index[ix]] > 0.0) &&
879 (refl_interm[iWav][
index[ix]]<=1.3)) {
880 array_interm[iWav][good_pixels_[iWav]] =
881 refl_interm[iWav][
index[ix]];
882 good_pixels_[iWav] += 1;
886 for (
int iWav=0; iWav < NWAV; iWav++) {
887 if (good_pixels_[iWav] > 0) {
888 float refl_val = 0.0;
890 mean_std(good_pixels_[iWav], array_interm[iWav],
892 refl_[iWav] = refl_val;
893 sdev_[iWav] = std_val;
894 var[iWav] = std_val/refl_val;
902 dvar[
D670] = -(1.0/(log(lut_.WAVE[
D670]/lut_.WAVE[
D865])))*
903 log((1.+ var[
D670])/(1.+var[
D865]));
914 float grthresh = GLINT_REFL_THRESHOLD/cos(solz_*DEGtoRAD);
916 if ((glint_angle_ > 0.75*GLINT_ANGLE_THRESHOLD) &&
917 (glint_angle_ <= GLINT_ANGLE_THRESHOLD)) {
920 if( glint_refl_< grthresh &&
921 ((refl_[
D488] > 0 && refl_[
D670]> 0) &&
922 (refl_[
D488]/refl_[
D670] <= 0.75))) {
923 quality_dust_flag_off_glint_ = 1;
925 if( glint_refl_>= grthresh &&
926 ((refl_[
D488] > 0 && refl_[
D670] > 0) &&
927 (refl_[
D488]/refl_[
D670] <= 0.95))) {
928 quality_dust_flag_glint_ = 1;
930 if( glint_refl_ < grthresh ||
931 quality_dust_flag_off_glint_ == 1 ||
932 quality_dust_flag_glint_ == 1) {
934 int total_good = good_pixels_[
D550]+good_pixels_[
D670]+
936 if((good_pixels_[
D865] > q1_pixels) &&
937 (total_good > q3_pixels)) {
940 if (refl_[
D865] > (1.10*refl_rayl_[
D865])) {
943 numData_[
D550] = good_pixels_[
D865];
944 if ( good_pixels_[
D865] < q2_pixels) {
947 if ( good_pixels_[
D865] > q2_pixels) {
953 if ( refl_[
D865] < (1.50*refl_rayl_[
D865])) {
955 qcontrol_special_= 2;
958 if (refl_[
D1240]*cos(solz_*DEGtoRAD) < 3.600E-04) {
959 qcontrol_exclude_= 6;
962 if (refl_[
D1610]*cos(solz_*DEGtoRAD) < 3.600E-04) {
963 qcontrol_exclude_= 3;
965 if (refl_[
D2250]*cos(solz_*DEGtoRAD) < 3.110E-04) {
966 qcontrol_exclude_= 4;
968 if (refl_[
D2250]*cos(solz_*DEGtoRAD) < 3.110E-04 &&
969 refl_[
D1610]*cos(solz_*DEGtoRAD) < 3.600E-04) {
970 qcontrol_exclude_= 5;
973 qcontrol_ = qcontrol_exclude_;
974 if ( qcontrol_ > 0) {
976 if (var[
D865] > 0.05 &&
983 if (var[
D865] > 0.05 &&
995 qcontrol_special_= 1;
1001 qcontrol_special_ = -2;
1006 qcontrol_special_= 3;
1007 numData_[
D550] = good_pixels_[
D865];
1015 qcontrol_special_= -2;
1017 if (qcontrol_ < 0) {
1039 int status = DTDB_SUCCESS;
1041 float maxrefl = 1.2;
1042 float minrefl = 0.0;
1043 for (
int iWav=0; iWav < NWAV; iWav++) {
1044 if (refl_[iWav] >= minrefl) {
1045 if (refl_[iWav] <= maxrefl) {
1046 sds_refl_[iWav] = refl_[iWav];
1047 sds_refl_sdev_[iWav] = sdev_[iWav];
1049 sds_refl_[iWav] = maxrefl;
1050 sds_refl_sdev_[iWav] = sdev_[iWav];
1053 sds_refl_[iWav] = minrefl;
1054 sds_refl_sdev_[iWav] = 0.0;
1056 if (good_pixels_[iWav] >= 0) {
1057 sds_numPixels_[iWav] = good_pixels_[iWav];
1059 sds_numPixels_[iWav] = 0;
1075 int status = DTDB_SUCCESS;
1077 for (
int iWav=0; iWav<NWAV; iWav++ ) {
1078 if ((tau_avg_[IBEST][iWav] > -0.1) ) {
1079 sds_tau_best_[iWav] = tau_avg_[IBEST][iWav];
1081 if ((tau_avg_[IAVG][iWav] > -0.1) ) {
1082 sds_tau_avg_[iWav] = tau_avg_[IAVG][iWav];
1084 if (tau_small_avg_[IBEST][iWav] > 0.0) {
1085 sds_tau_small_best_[iWav] = tau_small_avg_[IBEST][iWav];
1087 if (tau_small_avg_[IAVG][iWav] > 0.0) {
1088 sds_tau_small_avg_[iWav] = tau_small_avg_[IAVG][iWav];
1090 if (tau_big_avg_[IBEST][iWav] > 0.0) {
1091 sds_tau_big_best_[iWav] = tau_big_avg_[IBEST][iWav];
1093 if (tau_big_avg_[IAVG][iWav] > 0.0) {
1094 sds_tau_big_avg_[iWav] = tau_big_avg_[IAVG][iWav];
1096 if (assym_avg_[IBEST][iWav] > 0.0) {
1097 sds_assy_best_[iWav] = assym_avg_[IBEST][iWav];
1099 if (assym_avg_[IAVG][iWav] > 0.0) {
1100 sds_assy_avg_[iWav] = assym_avg_[IAVG][iWav];
1102 if (backscatter_avg_[IBEST][iWav] > 0.0) {
1103 sds_back_best_[iWav] = backscatter_avg_[IBEST][iWav];
1105 if (backscatter_avg_[IAVG][iWav] > 0.0) {
1106 sds_back_avg_[iWav] = backscatter_avg_[IAVG][iWav];
1108 if (refl_flux_avg_[IBEST][iWav] > 0.0) {
1109 sds_reff_best_[iWav] = refl_flux_avg_[IBEST][iWav];
1111 if (refl_flux_avg_[IAVG][iWav] > 0.0) {
1112 sds_reff_avg_[iWav] = refl_flux_avg_[IAVG][iWav];
1114 if (trans_flux_avg_[IBEST][iWav] > 0.0) {
1115 sds_tranf_best_[iWav] = trans_flux_avg_[IBEST][iWav];
1117 if (trans_flux_avg_[IAVG][iWav] > 0.0) {
1118 sds_tranf_avg_[iWav] = trans_flux_avg_[IAVG][iWav];
1121 for (
int iS=0; iS<NUM_STATS; iS++ ) {
1122 if (mass_con_ocean_avg_[iS] > 0.0) {
1123 sds_Mass_Conc_[iS] = mass_con_ocean_avg_[iS];
1125 if (eff_radius_avg_[iS] > 0.0) {
1126 sds_EffRad_[iS] = eff_radius_avg_[iS];
1128 if (ccn_avg_[iS] > 0.0) {
1129 sds_CCN_[iS] = ccn_avg_[iS];
1131 if (angstrom_exp_avg_[iS][0] > -1.0) {
1132 sds_Angs_Coeff1_[iS] = angstrom_exp_avg_[iS][0];
1134 if (angstrom_exp_avg_[iS][1] > -1.0) {
1135 sds_Angs_Coeff2_[iS] = angstrom_exp_avg_[iS][1];
1137 if (funmin_[iS][0] >= 0.0) {
1138 sds_Least_Error_[iS] = funmin_avg_[iS];
1140 if (tau_X55_[iS][0] >= 0.0) {
1141 sds_tau_X55_[iS] = tau_X55_avg_[iS];
1143 if (xmin_[iS][0] >= 0.0) {
1144 sds_Small_Weighting_[iS] = xmin_avg_[iS];
1146 if (solution_index_avg_[iS][0] >= 0.0) {
1147 sds_Sol_Index_Small_[iS] = (short) solution_index_avg_[iS][0];
1149 if (solution_index_avg_[iS][1] >= 0.0) {
1150 sds_Sol_Index_Large_[iS] = (short) solution_index_avg_[iS][1];
1153 sds_land_ocean_quality_ = quality_to_pass_[0];
1167 int status = DTDB_SUCCESS;
1170 int index[NUMCASES*NUMCASEB];
1171 memset(
index, 0, NUMCASES*NUMCASEB*
sizeof(
int));
1173 sort_index(NUMCASES*NUMCASEB, funmin_[0],
index);
1175 for (
int iWav=0; iWav<NWAV; iWav++) {
1176 tau_avg_[IBEST][iWav] = tau_[iWav][
index[0]];
1177 tau_small_avg_[IBEST][iWav] = tau_small_[iWav][
index[0]];
1178 tau_big_avg_[IBEST][iWav] = tau_big_[iWav][
index[0]];
1179 backscatter_avg_[IBEST][iWav] = backscatter_[iWav][
index[0]];
1180 assym_avg_[IBEST][iWav] = assym_[iWav][
index[0]];
1181 refl_flux_avg_[IBEST][iWav] = refl_flux_[iWav][
index[0]];
1182 trans_flux_avg_[IBEST][iWav] = trans_flux_[iWav][
index[0]];
1184 angstrom_exp_avg_[IBEST][0] = angstrom_exp_[0][
index[0]];
1185 angstrom_exp_avg_[IBEST][1] = angstrom_exp_[1][
index[0]];
1187 solution_index_avg_[IBEST][
IBIG] = solution_index_[
IBIG][
index[0]];
1188 ccn_avg_[IBEST] = ccn_[
index[0]];
1189 eff_radius_avg_[IBEST] = eff_radius_[
index[0]];
1190 eff_variance_avg_[IBEST] = eff_variance_[
index[0]];
1191 mass_con_ocean_avg_[IBEST] = mass_con_ocean_[
index[0]];
1192 xmin_avg_[IBEST] = xmin_[0][
index[0]];
1193 funmin_avg_[IBEST] = funmin_[0][
index[0]];
1194 tau_X55_avg_[IBEST] = tau_X55_[0][
index[0]];
1196 float weight[NUMCASES*NUMCASEB];
1197 memset(weight, 0, NUMCASES*NUMCASEB*
sizeof(
float));
1199 for (
int iSol=0; iSol < NUMCASES*NUMCASEB; iSol++ ) {
1200 if(100.0*funmin_[0][
index[iSol]] <= Threshold_LSQ_Error) {
1201 weight[
index[iSol]] = 1.0;
1204 else weight[
index[iSol]] = 0.0;
1208 for (
int iSol=0; iSol<NUMCASES*NUMCASEB; iSol++ ) {
1210 if(funmin_[0][
index[iSol]] > 0.0) {
1211 weight[
index[iSol]] =
1212 1.0/pow(100.0*funmin_[0][
index[iSol]],2);
1215 else weight[
index[iSol]] = 0.0;
1220 for (
int iWav=0; iWav<NWAV; iWav++) {
1221 mean_std_weighted( NUMCASES*NUMCASEB, tau_[iWav],
1222 tau_avg_[IAVG][iWav], sdev, weight );
1223 mean_std_weighted( NUMCASES*NUMCASEB, tau_small_[iWav],
1224 tau_small_avg_[IAVG][iWav], sdev, weight );
1225 mean_std_weighted( NUMCASES*NUMCASEB, tau_big_[iWav],
1226 tau_big_avg_[IAVG][iWav], sdev, weight );
1227 mean_std_weighted( NUMCASES*NUMCASEB, backscatter_[iWav],
1228 backscatter_avg_[IAVG][iWav], sdev, weight );
1229 mean_std_weighted( NUMCASES*NUMCASEB, assym_[iWav],
1230 assym_avg_[IAVG][iWav], sdev, weight );
1231 mean_std_weighted( NUMCASES*NUMCASEB, refl_flux_[iWav],
1232 refl_flux_avg_[IAVG][iWav], sdev, weight );
1233 mean_std_weighted( NUMCASES*NUMCASEB, trans_flux_[iWav],
1234 trans_flux_avg_[IAVG][iWav], sdev, weight );
1236 mean_std_weighted( NUMCASES*NUMCASEB, angstrom_exp_[0],
1237 angstrom_exp_avg_[IAVG][0], sdev, weight );
1238 mean_std_weighted( NUMCASES*NUMCASEB, angstrom_exp_[1],
1239 angstrom_exp_avg_[IAVG][1], sdev, weight );
1240 mean_std_weighted( NUMCASES*NUMCASEB, ccn_,
1241 ccn_avg_[IAVG], sdev, weight );
1242 mean_std_weighted( NUMCASES*NUMCASEB, eff_radius_,
1243 eff_radius_avg_[IAVG], sdev, weight );
1244 mean_std_weighted( NUMCASES*NUMCASEB, eff_variance_,
1245 eff_variance_avg_[IAVG], sdev, weight );
1246 mean_std_weighted( NUMCASES*NUMCASEB, mass_con_ocean_,
1247 mass_con_ocean_avg_[IAVG], sdev, weight );
1248 mean_std_weighted( NUMCASES*NUMCASEB, xmin_[0],
1249 xmin_avg_[IAVG], sdev, weight );
1250 mean_std_weighted( NUMCASES*NUMCASEB, funmin_[0],
1251 funmin_avg_[IAVG], sdev, weight );
1252 mean_std_weighted( NUMCASES*NUMCASEB, tau_X55_[0],
1253 tau_X55_avg_[IAVG], sdev, weight );
1255 solution_index_avg_[IAVG][
IBIG] = solution_index_[
IBIG][
index[0]];
1270 int status = DTDB_SUCCESS;
1274 bUseWav[
D488] =
false;
1275 bUseWav[
D550] =
true;
1276 bUseWav[
D670] =
true;
1277 bUseWav[
D865] =
true;
1279 bUseWav[
D1240] = (qcontrol_exclude_== 6) ?
false :
true;
1280 bUseWav[
D1610] = (qcontrol_exclude_== 3 ||
1281 qcontrol_exclude_== 5) ?
false :
true;
1282 bUseWav[
D2250] = (qcontrol_exclude_== 4 ||
1283 qcontrol_exclude_== 5) ?
false :
true;
1286 float tau_X55[2] = {0.0,0.0};
1287 interp_extrap(NAOT,refl_[
D865],refl_small_[
D865][iSmall],
1289 interp_extrap(NAOT,refl_[
D865],refl_big_[
D865][iBig],
1290 lut_.TAUAB[
D550][0],tau_X55[
IBIG]);
1294 float trefl[NWAV][2];
1296 memset(rbdif, 0, NWAV*
sizeof(
float));
1297 memset(sbdif, 0, NWAV*
sizeof(
float));
1298 memset(trefl, 0, NWAV*2*
sizeof(
float));
1299 memset(
scale, 0, NWAV*
sizeof(
float));
1303 for (
int iWav=0; iWav<NWAV; iWav++ ) {
1304 float denom = refl_[iWav]-refl_rayl_[iWav] + 0.01;
1307 interp_extrap(NAOT,tau_X55[
ISMALL],lut_.TAUAS[
D550][0],
1308 refl_small_[iWav][iSmall],trefl[iWav][
ISMALL]);
1309 interp_extrap(NAOT,tau_X55[
IBIG],lut_.TAUAB[
D550][0],
1310 refl_big_[iWav][iBig],trefl[iWav][
IBIG]);
1311 if (bUseWav[iWav]) {
1312 rbdif[iWav] = refl_[iWav] - trefl[iWav][
IBIG];
1313 sbdif[iWav] = trefl[iWav][
ISMALL] - trefl[iWav][
IBIG];
1314 rb2 += rbdif[iWav]*rbdif[iWav]*
scale[iWav];
1315 sb2 += sbdif[iWav]*sbdif[iWav]*
scale[iWav];
1316 rbsb += rbdif[iWav]*sbdif[iWav]*
scale[iWav];
1320 float xm = rbsb / sb2;
1321 xm = (xm > 1) ? 1.0 : xm;
1322 xm = (xm < 0) ? 0.0 : xm;
1324 float sum_good_pixels = 0.0;
1325 for (
int iWav=0; iWav<NWAV; iWav++ ) {
1326 float mrfl = (xm*trefl[iWav][
ISMALL]+(1.0-xm)*trefl[iWav][
IBIG]);
1327 error_[0][iWav][iSol] = (refl_[iWav] - mrfl) / refl_[iWav];
1328 if (bUseWav[iWav]) {
1329 asum += error_[0][iWav][iSol]*error_[0][iWav][iSol];
1330 sum_good_pixels += good_pixels_[iWav];
1333 xmin_[0][iSol] = xm;
1334 funmin_[0][iSol] = asum/(NWAV-2);
1335 tau_X55_[0][iSol] = xm*tau_X55[
ISMALL] + (1-xm)*tau_X55[
IBIG];
1350 int status = DTDB_SUCCESS;
1353 float a[2][5] = {{0.0, 0.0, 0.0, 0.0, 0.0},{0.0, 0.0, 0.0, 0.0, 0.0}};
1354 float x[5] = {0.0, 0.5, 1.0, 0.0, 0.0};
1355 float f[5] = {0.0, 0.0, 0.0, 0.0, 0.0};
1356 f[0] = fun_tau(
x[0], iBig, iSmall, iSol);
1357 f[1] = fun_tau(
x[1], iBig, iSmall, iSol);
1358 f[2] = fun_tau(
x[2], iBig, iSmall, iSol);
1360 for (
int i=0;
i<10;
i++ ) {
1361 x[3] = (
x[0]+
x[1])/2.0;
1362 x[4] = (
x[1]+
x[2])/2.0;
1363 f[3] = fun_tau(
x[3], iBig, iSmall, iSol);
1364 f[4] = fun_tau(
x[4], iBig, iSmall, iSol);
1368 sort_inplace(5,
a[1],
a[0]);
1370 float rmin =
a[0][0];
1378 if((
fabs(rmin-
x[1]) <
fabs(
x[1])*0.000001) && (rmin >
x[3])) {
1385 if((rmin >=
x[4]) &&
1386 (
fabs(rmin-
x[1]) >
fabs(
x[1])*0.000001) && (rmin >
x[3])) {
1396 sort_inplace(3,
f,
x);
1398 xmin_[1][iSol] =
x[0];
1399 funmin_[1][iSol] =
f[0];
1418 float xs[NWAV][NAOT];
1419 float ys[NWAV][NAOT];
1420 memset(xs, 0, NWAV*NAOT*
sizeof(
float));
1421 memset(
ys, 0, NWAV*NAOT*
sizeof(
float));
1423 for (
int iWav=0; iWav<NWAV; iWav++ ) {
1424 for (
int iTau=0; iTau<NAOT; iTau++ ) {
1425 xs[iWav][iTau] = lut_.TAUAS[
D550][0][iTau];
1426 ys[iWav][iTau]= xmin*refl_small_[iWav][iSmall][iTau] +
1427 (1.-xmin)*refl_big_[iWav][iBig][iTau];
1432 interp_extrap(NAOT,refl_[
D865],
ys[
D865],xs[
D550],tau_X55_[1][iSol]);
1436 memset(alxwav, 0, NWAV*
sizeof(
float));
1437 for (
int iWav=0; iWav<NWAV; iWav++ ) {
1438 interp_extrap(NAOT,tau_X55_[1][iSol],xs[
D550],
ys[iWav],alxwav[iWav]);
1439 error_[1][iWav][iSol] = refl_[iWav] - alxwav[iWav];
1444 bUseWav[
D488] =
false;
1445 bUseWav[
D550] =
true;
1446 bUseWav[
D670] =
true;
1447 bUseWav[
D865] =
true;
1449 bUseWav[
D1240] = (qcontrol_exclude_== 6) ?
false :
true;
1450 bUseWav[
D1610] = (qcontrol_exclude_== 3 ||
1451 qcontrol_exclude_== 5) ?
false :
true;
1452 bUseWav[
D2250] = (qcontrol_exclude_== 4 ||
1453 qcontrol_exclude_== 5) ?
false :
true;
1456 int sum_good_pixels = 0;
1457 for (
int iWav=0; iWav<NWAV; iWav++ ) {
1458 if (bUseWav[iWav]) {
1459 float denom = (refl_[iWav]-refl_rayl_[iWav]) + 0.01;
1463 asum += pow(error_[1][iWav][iSol]/
denom,2.0)*good_pixels_[iWav];
1464 sum_good_pixels += good_pixels_[iWav];
1467 float result = sqrt(asum/((
float)sum_good_pixels));
1502 int status = DTDB_SUCCESS;
1504 quality_to_pass_[0] = 0;
1505 quality_to_pass_[1] = 0;
1506 if ( qcontrol_ < 0) {
1507 quality_flag_[0] = 0;
1508 quality_flag_[1] = 0;
1509 quality_flag_[2] = 0;
1510 quality_flag_[3] = 0;
1511 quality_flag_[4] =
abs(qcontrol_);
1512 quality_flag_[5] = 15;
1515 quality_flag_[0] = 1;
1516 quality_flag_[2] = 1;
1517 if( quality_dust_flag_glint_ == 1) {
1520 if( qcontrol_cirrus_== 1) {
1523 if( quality_dust_flag_off_glint_ == 1) {
1527 if( qcontrol_ == 0 ) {
1528 quality_flag_[1] = 3;
1529 quality_flag_[3] = 3;
1532 if( qcontrol_ == 7 || qcontrol_ == 14) {
1533 quality_flag_[1] = 2;
1534 quality_flag_[3] = 2;
1537 if( qcontrol_== 1 || qcontrol_ == 3 || qcontrol_ == 4
1538 || qcontrol_== 6 || qcontrol_ == 8 || qcontrol_== 10) {
1539 quality_flag_[1] = 1;
1540 quality_flag_[3] = 1;
1543 if( qcontrol_== 2 || qcontrol_== 5 || qcontrol_ == 9
1544 || qcontrol_ == 12 || qcontrol_== 13 ) {
1545 quality_flag_[1] = 0;
1546 quality_flag_[3] = 0;
1548 quality_flag_[4] = 0;
1549 quality_flag_[5] = qcontrol_;
1550 if(qcontrol_ == 17) {
1551 quality_flag_[1] = 3;
1552 quality_flag_[3] = 3;
1555 quality_to_pass_[0] = quality_flag_[1];
1556 quality_to_pass_[1] = qcontrol_;
1571 int status = DTDB_SUCCESS;
1573 for (
int iWav=0; iWav<NWAV; iWav++ ) {
1578 for (
int iWav=0; iWav<NWAV; iWav++ ) {
1595 for (
int iCase=0; iCase<NUM_SIZES; iCase++ ) {