51 short& snow1,
short& snow2 )
71 for (
size_t ib=0; ib<NTWL; ib++) {
72 rfl[ib] = p_->rfl_[ib];
75 for (
size_t ib=0; ib<NTWL; ib++) {
80 int ilat = (
int)((
lat + 90.)*10.0);
81 if (ilat >= 1800) ilat = 1800-1;
82 if (ilat < 0) ilat = 0;
83 int ilon = (
int)((
lon + 180.0)*10.0);
84 if (ilon >= 3600) ilon = 3600-1;
85 if (ilon < 0) ilon = 0;
86 int gzflg = p_->gz_lut_->GEOZONE_FLAG[ilat][ilon];
88 size_t ix1 = (ix==0) ? 0 : ix-1;
89 size_t ix2 =
min(ix+1,p_->pixels_-1);
90 size_t iy1 = (iy==0) ? 0 : iy-1;
91 size_t iy2 =
min(iy+1,p_->lines_-1);
94 float rflmax = -999.0;
95 for (
size_t cx=ix1; cx<=ix2; cx++) {
96 for (
size_t cy=iy1; cy<=iy2; cy++) {
99 rflmin = (
rf<rflmin) ?
rf : rflmin;
100 rflmax = (
rf>rflmax) ?
rf : rflmax;
104 if (rflmax<1.E-8 || rflmin<1.E-8 ) {
112 if (minmax_rfl > 1.2) {
115 if (p_->sr670_ >= 0.08 && minmax_rfl > 1.15) {
120 if (p_->sr670_ >= 0.08 ) {
135 if (p_->sr670_ > 0.0 && p_->sr670_ < 0.08 ) {
146 if (
lat > 60.0 && p_->amf_ > 7.0) {
155 if ((gzflg == 5 || gzflg == 1 || gzflg == 26 || gzflg == 27) ||
156 (
lon < 15.0 && ((
lon >-20.0 &&
lon < 55.0) && gzflg == -999))) {
157 if (p_->sr670_ > 0.0 && p_->sr670_ < 0.08 ) {
198 short&
mask,
const short snow2 )
200 int status = DTDB_SUCCESS;
206 float lat = p_->lat_;
207 float lon = p_->lon_;
208 float solz = p_->solz_;
209 int ilat = (
int)((
lat + 90.)*10.0);
210 if (ilat >= 1800) ilat = 1800-1;
211 if (ilat < 0) ilat = 0;
212 int ilon = (
int)((
lon + 180.0)*10.0);
213 if (ilon >= 3600) ilon = 3600-1;
214 if (ilon < 0) ilon = 0;
215 int gzflg = p_->gz_lut_->GEOZONE_FLAG[ilat][ilon];
216 int sfcstd = p_->sp_lut_->SURFACE_ELEVATION[ilat][ilon];
217 int month = p_->month_;
219 if (p_->ler412_ > 50.0) {
222 if (p_->sr670_ < 0.1) {
224 p_->ler412_ > 12.0) {
228 if (p_->sr670_ < 0.08) {
229 if (p_->ler412_ > 40.0) {
232 if (p_->ler412_ > 20.0 &&
solz > 72.0) {
237 size_t ix1 = (ix==0) ? 0 : ix-1;
238 size_t ix2 =
min(ix+1,p_->pixels_-1);
239 size_t iy1 = (iy==0) ? 0 : iy-1;
240 size_t iy2 =
min(iy+1,p_->lines_-1);
242 float lermin = 999.0;
243 float lermax = -999.0;
244 for (
size_t cx=ix1; cx<=ix2; cx++) {
245 for (
size_t cy=iy1; cy<=iy2; cy++) {
256 if (lermax<1.E-8 || lermin<1.E-8 ) {
262 if (snow2 == 1 && gzflg == 13 &&
264 sfcstd <= 50 && minmax_ler > 1.20) {
268 if (
lat > 45 && month >= 2 && month <= 6 &&
269 snow2 == 1 && gzflg == 13 && p_->ndvi_ < 0.45 &&
270 sfcstd <= 50 && minmax_ler > 1.30) {
274 if (snow2 == 1 && gzflg != 13 && p_->ndvi_ < 0.35 &&
275 sfcstd <= 50 && minmax_ler > 1.40) {
279 if (
lat > 50 && month >= 2 && month <= 6 && snow2 == 1 &&
280 gzflg != 13 && p_->ndvi_ < 0.45 &&
281 sfcstd <= 50 && minmax_ler > 1.30) {
285 if (snow2 == 1 && sfcstd > 50 && minmax_ler > 1.80) {
291 if (p_->ler412_ > 0 &&
294 if (p_->ler488_/p_->ler670_ < 0.65 &&
295 p_->ler412_ > 18.0) {
331 int status = DTDB_SUCCESS;
339 size_t ix1 = (ix==0) ? 0 : ix-1;
340 size_t ix2 =
min(ix+1,p_->pixels_-1);
341 size_t iy1 = (iy==0) ? 0 : iy-1;
342 size_t iy2 =
min(iy+1,p_->lines_-1);
349 memset(&tler[0][0][0],0,
sizeof(tler));
350 memset(&tsr[0][0][0],0,
sizeof(tsr));
351 memset(&td[0][0][0],0,
sizeof(td));
352 for (
size_t cy=iy1; cy<=iy2; cy++) {
353 for (
size_t cx=ix1; cx<=ix2; cx++) {
364 if (p_->rfla_[(
size_t)
rhot_band::W2250][cy-iy1][cx-ix1] < 0.035) cnt2250_1++;
365 if (p_->rfla_[(
size_t)
rhot_band::W2250][cy-iy1][cx-ix1] < 0.065) cnt2250_2++;
368 float rat488670 = p_->ler488_ / p_->ler670_;
369 float rat412488 = p_->ler412_ / p_->ler488_;
370 if (p_->ler412_ > 12.0) {
371 if ((p_->sr670_ < 0.08 && cnt2250_1 == 9) ||
372 (p_->sr670_ >= 0.08 && cnt2250_2 == 9)) {
376 if (p_->ler412_ > 20.0 &&
380 if (p_->ler488_ > 0.0 && p_->ler670_ > 0.0) {
381 rat488670 = p_->ler488_ / p_->ler670_;
382 if (rat488670 > 0.88) {
385 if (rat488670 > 0.7 && rat488670 < 0.88 &&
396 if (p_->sr670_ >= 0.12 || p_->ler670_ > 50.0) {
399 if (rat412488/rat488670 > 0.94) {
433 int status = DTDB_SUCCESS;
440 float rat412488 = p_->ler412_ / p_->ler488_;
443 p_->ler670_ > 24.0 &&
478 int status = DTDB_SUCCESS;
485 float lat = p_->lat_;
486 float lon = p_->lon_;
488 int ilat = (
int)((
lat + 90.)*10.0);
489 if (ilat >= 1800) ilat = 1800-1;
490 if (ilat < 0) ilat = 0;
491 int ilon = (
int)((
lon + 180.0)*10.0);
492 if (ilon >= 3600) ilon = 3600-1;
493 if (ilon < 0) ilon = 0;
494 int gzflg = p_->gz_lut_->GEOZONE_FLAG[ilat][ilon];
496 size_t ix1 = (ix==0) ? 0 : ix-1;
497 size_t ix2 =
min(ix+1,p_->pixels_-1);
498 size_t iy1 = (iy==0) ? 0 : iy-1;
499 size_t iy2 =
min(iy+1,p_->lines_-1);
504 memset(&tler[0][0][0],0,
sizeof(tler));
505 memset(&tsr[0][0][0],0,
sizeof(tsr));
506 memset(&td[0][0][0],0,
sizeof(td));
507 for (
size_t cy=iy1; cy<=iy2; cy++) {
508 for (
size_t cx=ix1; cx<=ix2; cx++) {
521 float rat488670 = p_->ler488_ / p_->ler670_;
522 float rat412488 = p_->ler412_ / p_->ler488_;
524 if (p_->ler412_ > 12.0) {
525 if ((p_->sr670_ < 0.08 && cntW2250 == 9) ||
526 (p_->sr670_ >= 0.08 && cntW2250 == 9)) {
527 if (p_->ler488_ > 18.0 &&
528 (rat488670 > 0.7 && rat488670 < 0.88) &&
533 if (p_->ler488_ > 18.0 && (rat488670 > 0.7 && rat488670 < 0.88) &&
542 if (p_->ler488_ > 18.0 &&
543 (rat488670 > 0.9 && rat488670 < 1.06) &&
544 (rat412488 > 0.7 && rat412488 < 0.88) &&
557 if (rat412488/rat488670 > 0.94) {
590 int status = DTDB_SUCCESS;
596 float lat = p_->lat_;
597 float solz = p_->solz_;
599 float m01_stddev = 0;
601 float m08_stddev = 0;
605 float rfl[NTWL][3][3];
606 memset(
rfl,0,
sizeof(
rfl));
607 double cossza = cos(
solz*DEGtoRAD);
608 for (
size_t iw=0; iw<NTWL; iw++) {
609 for (
size_t il=0; il<=2; il++) {
610 for (
size_t ip=0; ip<=2; ip++) {
611 if (p_->rfla_[iw][il][ip] < 0) {
614 rfl[iw][il][ip] = p_->rfla_[iw][il][ip]*cossza/
M_PI;
622 for (
size_t il=0; il<=2; il++) {
623 for (
size_t ip=0; ip<=2; ip++) {
633 for (
size_t il=0; il<=2; il++) {
634 for (
size_t ip=0; ip<=2; ip++) {
641 m01_stddev = sqrt(m01_stddev/(cnt-1));
647 for (
size_t il=0; il<=2; il++) {
648 for (
size_t ip=0; ip<=2; ip++) {
658 for (
size_t il=0; il<=2; il++) {
659 for (
size_t ip=0; ip<=2; ip++) {
666 m08_stddev = sqrt(m08_stddev/(cnt-1));
670 float cosza = cos(
solz*DEGtoRAD);
672 if ((m01_stddev > 0 &&
673 (m01_stddev > M01_STDV_THOLD*cosza)) ||
675 (m08_stddev > M08_HILAT_STDV_THOLD*cosza))) {
681 if ((m01_stddev > 0 &&
682 m01_stddev > M01_STDV_THOLD*cosza) ||
684 m08_stddev > M08_STDV_THOLD*cosza)) {