private static UInt16[] LaiCalculator(double sr, double ros, double vza, double sza, double phi, int covertp, int backgd /*, out UInt16[] lelai*/) { double lai, laifromrsr, le = 0, lefromrsr = 0, srmodif, rosmodif, lerate, le_p; //UInt16 lai1, lai2;//, le2; LUTDataInit init = new LUTDataInit(); double[][] ka1a2co = init.CoverT[covertp - 1].Ka1a2co; double[][] Ska1a2co = init.CoverT[covertp - 1].SKa1a2co; double[][] cco = init.CoverT[covertp - 1].Cco; double[][] Scco = init.CoverT[covertp - 1].SCco; double[][] lesr = init.CoverT[covertp - 1].LeSr; double[][] lersr = init.CoverT[covertp - 1].LeRsr; int[] lines = init.CoverT[covertp - 1].Lines; int[] Slines = init.CoverT[covertp - 1].SLines; int a12lines = LUTData.a1a2lines[covertp - 1]; double swirmx = LUTData.swirmax[covertp - 1]; double swirmn = LUTData.swirmin[covertp - 1]; lerate = LUTData.a1a2lerate[covertp - 1]; #region 卫星天顶角 if (sza < 10) { #region 观测天顶角 if (vza < 10) { le_p = lefuncpre(sr, lines[0], lesr[0], backgd);// first estimation of LE //modified simple ratio based on formula (7) srmodif = sr * brdffunc(a12lines, le_p / lerate, 0, 5, 0, ka1a2co[0], ka1a2co[1], ka1a2co[2], ka1a2co[3], cco[0], cco[1]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[0], ka1a2co[1], ka1a2co[2], ka1a2co[3], cco[0], cco[1]); le = lefunc(srmodif, lines[0], lesr[0], backgd, 0, le_p);//formula (2) if (covertp > 5 && covertp < 18) { lefromrsr = le; } else { //formula (8) rosmodif = ros * swirfunc(a12lines, le_p / lerate / lerate, 0, 5, 0, Ska1a2co[0], Ska1a2co[1], Scco[0]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[0], Ska1a2co[1], Scco[0]); //formula (3) lefromrsr = lersrf(srmodif, rosmodif, lines[0], Slines[0], lersr[0], backgd, 0, swirmx, swirmn); } } else if (vza < 30) { //first estimation of le, linear interpolating between phi=0 and 180. le_p = lefuncpre(sr, lines[1], lesr[1], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[24], lesr[24], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 20, 5, 0, ka1a2co[0], ka1a2co[1], ka1a2co[2], ka1a2co[3], cco[0], cco[1]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[0], ka1a2co[1], ka1a2co[2], ka1a2co[3], cco[0], cco[1]); le = lefunc(srmodif, lines[1], lesr[1], backgd, 20, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 20, 5, 0, Ska1a2co[0], Ska1a2co[1], Scco[0]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[0], Ska1a2co[1], Scco[0]); lefromrsr = lersrf(srmodif, rosmodif, lines[1], Slines[1], lersr[1], backgd, 20, swirmx, swirmn); } } else if (vza < 45) { le_p = lefuncpre(sr, lines[2], lesr[2], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[25], lesr[25], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 40, 5, 0, ka1a2co[0], ka1a2co[1], ka1a2co[2], ka1a2co[3], cco[0], cco[1]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[0], ka1a2co[1], ka1a2co[2], ka1a2co[3], cco[0], cco[1]); le = lefunc(srmodif, lines[2], lesr[2], backgd, 40, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 40, 5, 0, Ska1a2co[0], Ska1a2co[1], Scco[0]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[0], Ska1a2co[1], Scco[0]); lefromrsr = lersrf(srmodif, rosmodif, lines[2], Slines[2], lersr[2], backgd, 40, swirmx, swirmn); } } else { le_p = lefuncpre(sr, lines[3], lesr[3], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[26], lesr[26], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 50, 5, 0, ka1a2co[0], ka1a2co[1], ka1a2co[2], ka1a2co[3], cco[0], cco[1]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[0], ka1a2co[1], ka1a2co[2], ka1a2co[3], cco[0], cco[1]); le = lefunc(srmodif, lines[3], lesr[3], backgd, 50, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 50, 5, 0, Ska1a2co[0], Ska1a2co[1], Scco[0]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[0], Ska1a2co[1], Scco[0]); lefromrsr = lersrf(srmodif, rosmodif, lines[3], Slines[3], lersr[3], backgd, 50, swirmx, swirmn); } } #endregion } else if (sza < 20) { #region 观测天顶角 if (vza < 10) { le_p = lefuncpre(sr, lines[4], lesr[4], backgd); srmodif = sr * brdffunc(a12lines, le_p / lerate, 0, 15, 0, ka1a2co[4], ka1a2co[5], ka1a2co[6], ka1a2co[7], cco[2], cco[3]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[4], ka1a2co[5], ka1a2co[6], ka1a2co[7], cco[2], cco[3]); le = lefunc(srmodif, lines[4], lesr[4], backgd, 0, le_p);//formula (2) if (covertp > 5 && covertp < 18) { lefromrsr = le; } else { //formula (8) rosmodif = ros * swirfunc(a12lines, le_p / lerate / lerate, 0, 15, 0, Ska1a2co[2], Ska1a2co[3], Scco[1]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[2], Ska1a2co[3], Scco[1]); //formula (3) lefromrsr = lersrf(srmodif, rosmodif, lines[4], Slines[4], lersr[4], backgd, 0, swirmx, swirmn); } } else if (vza < 30) { //first estimation of le, linear interpolating between phi=0 and 180. le_p = lefuncpre(sr, lines[5], lesr[5], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[27], lesr[27], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 20, 15, 0, ka1a2co[4], ka1a2co[5], ka1a2co[6], ka1a2co[7], cco[2], cco[3]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[4], ka1a2co[5], ka1a2co[6], ka1a2co[7], cco[2], cco[3]); le = lefunc(srmodif, lines[5], lesr[5], backgd, 20, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 20, 15, 0, Ska1a2co[2], Ska1a2co[3], Scco[1]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[2], Ska1a2co[3], Scco[1]); lefromrsr = lersrf(srmodif, rosmodif, lines[5], Slines[5], lersr[5], backgd, 20, swirmx, swirmn); } } else if (vza < 45) { le_p = lefuncpre(sr, lines[6], lesr[6], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[28], lesr[28], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 40, 15, 0, ka1a2co[4], ka1a2co[5], ka1a2co[6], ka1a2co[7], cco[2], cco[3]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[4], ka1a2co[5], ka1a2co[6], ka1a2co[7], cco[2], cco[3]); le = lefunc(srmodif, lines[6], lesr[6], backgd, 40, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 40, 15, 0, Ska1a2co[2], Ska1a2co[3], Scco[1]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[2], Ska1a2co[3], Scco[1]); lefromrsr = lersrf(srmodif, rosmodif, lines[6], Slines[6], lersr[6], backgd, 40, swirmx, swirmn); } } else { le_p = lefuncpre(sr, lines[7], lesr[7], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[29], lesr[29], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 50, 15, 0, ka1a2co[4], ka1a2co[5], ka1a2co[6], ka1a2co[7], cco[2], cco[3]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[4], ka1a2co[5], ka1a2co[6], ka1a2co[7], cco[2], cco[3]); le = lefunc(srmodif, lines[7], lesr[7], backgd, 50, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 50, 15, 0, Ska1a2co[2], Ska1a2co[3], Scco[1]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[2], Ska1a2co[3], Scco[1]); lefromrsr = lersrf(srmodif, rosmodif, lines[7], Slines[7], lersr[7], backgd, 50, swirmx, swirmn); } } #endregion } else if (sza < 30) { #region 观测天顶角 if (vza < 10) { le_p = lefuncpre(sr, lines[8], lesr[8], backgd); srmodif = sr * brdffunc(a12lines, le_p / lerate, 0, 25, 0, ka1a2co[8], ka1a2co[9], ka1a2co[10], ka1a2co[11], cco[4], cco[5]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[8], ka1a2co[9], ka1a2co[10], ka1a2co[11], cco[4], cco[5]); le = lefunc(srmodif, lines[8], lesr[8], backgd, 0, le_p);//formula (2) if (covertp > 5 && covertp < 18) { lefromrsr = le; } else { //formula (8) rosmodif = ros * swirfunc(a12lines, le_p / lerate / lerate, 0, 25, 0, Ska1a2co[4], Ska1a2co[5], Scco[2]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[4], Ska1a2co[5], Scco[2]); //formula (3) lefromrsr = lersrf(srmodif, rosmodif, lines[8], Slines[8], lersr[8], backgd, 0, swirmx, swirmn); } } else if (vza < 30) { //first estimation of le, linear interpolating between phi=0 and 180. le_p = lefuncpre(sr, lines[9], lesr[9], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[30], lesr[30], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 20, 25, 0, ka1a2co[8], ka1a2co[9], ka1a2co[10], ka1a2co[11], cco[4], cco[5]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[8], ka1a2co[9], ka1a2co[10], ka1a2co[11], cco[4], cco[5]); le = lefunc(srmodif, lines[9], lesr[9], backgd, 20, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 20, 25, 0, Ska1a2co[4], Ska1a2co[5], Scco[2]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[4], Ska1a2co[5], Scco[2]); lefromrsr = lersrf(srmodif, rosmodif, lines[9], Slines[9], lersr[9], backgd, 20, swirmx, swirmn); } } else if (vza < 45) { le_p = lefuncpre(sr, lines[10], lesr[10], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[31], lesr[31], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 40, 25, 0, ka1a2co[8], ka1a2co[9], ka1a2co[10], ka1a2co[11], cco[4], cco[5]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[8], ka1a2co[9], ka1a2co[10], ka1a2co[11], cco[4], cco[5]); le = lefunc(srmodif, lines[10], lesr[10], backgd, 40, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 40, 25, 0, Ska1a2co[4], Ska1a2co[5], Scco[2]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[4], Ska1a2co[5], Scco[2]); lefromrsr = lersrf(srmodif, rosmodif, lines[10], Slines[10], lersr[10], backgd, 40, swirmx, swirmn); } } else { le_p = lefuncpre(sr, lines[11], lesr[11], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[32], lesr[32], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 50, 25, 0, ka1a2co[8], ka1a2co[9], ka1a2co[10], ka1a2co[11], cco[4], cco[5]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[8], ka1a2co[9], ka1a2co[10], ka1a2co[11], cco[4], cco[5]); le = lefunc(srmodif, lines[11], lesr[11], backgd, 50, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 50, 25, 0, Ska1a2co[4], Ska1a2co[5], Scco[2]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[4], Ska1a2co[5], Scco[2]); lefromrsr = lersrf(srmodif, rosmodif, lines[11], Slines[11], lersr[11], backgd, 50, swirmx, swirmn); } } #endregion } else if (sza < 40) { #region 观测天顶角 if (vza < 10) { le_p = lefuncpre(sr, lines[12], lesr[12], backgd); srmodif = sr * brdffunc(a12lines, le_p / lerate, 0, 35, 0, ka1a2co[12], ka1a2co[13], ka1a2co[14], ka1a2co[15], cco[6], cco[7]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[12], ka1a2co[13], ka1a2co[14], ka1a2co[15], cco[6], cco[7]); le = lefunc(srmodif, lines[12], lesr[12], backgd, 0, le_p);//formula (2) if (covertp > 5 && covertp < 18) { lefromrsr = le; } else { //formula (8) rosmodif = ros * swirfunc(a12lines, le_p / lerate / lerate, 0, 35, 0, Ska1a2co[6], Ska1a2co[7], Scco[3]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[6], Ska1a2co[7], Scco[3]); //formula (3) lefromrsr = lersrf(srmodif, rosmodif, lines[12], Slines[12], lersr[12], backgd, 0, swirmx, swirmn); } } else if (vza < 30) { //first estimation of le, linear interpolating between phi=0 and 180. le_p = lefuncpre(sr, lines[13], lesr[13], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[33], lesr[33], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 20, 35, 0, ka1a2co[12], ka1a2co[13], ka1a2co[14], ka1a2co[15], cco[6], cco[7]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[12], ka1a2co[13], ka1a2co[14], ka1a2co[15], cco[6], cco[7]); le = lefunc(srmodif, lines[13], lesr[13], backgd, 20, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 20, 35, 0, Ska1a2co[6], Ska1a2co[7], Scco[3]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[6], Ska1a2co[7], Scco[3]); lefromrsr = lersrf(srmodif, rosmodif, lines[13], Slines[13], lersr[13], backgd, 20, swirmx, swirmn); } } else if (vza < 45) { le_p = lefuncpre(sr, lines[14], lesr[14], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[34], lesr[34], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 40, 35, 0, ka1a2co[12], ka1a2co[13], ka1a2co[14], ka1a2co[15], cco[6], cco[7]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[12], ka1a2co[13], ka1a2co[14], ka1a2co[15], cco[6], cco[7]); le = lefunc(srmodif, lines[14], lesr[14], backgd, 40, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 40, 35, 0, Ska1a2co[6], Ska1a2co[7], Scco[3]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[6], Ska1a2co[7], Scco[3]); lefromrsr = lersrf(srmodif, rosmodif, lines[14], Slines[14], lersr[14], backgd, 14, swirmx, swirmn); } } else { le_p = lefuncpre(sr, lines[15], lesr[15], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[35], lesr[35], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 50, 35, 0, ka1a2co[12], ka1a2co[13], ka1a2co[14], ka1a2co[15], cco[6], cco[7]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[12], ka1a2co[13], ka1a2co[14], ka1a2co[15], cco[6], cco[7]); le = lefunc(srmodif, lines[15], lesr[15], backgd, 50, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 50, 35, 0, Ska1a2co[6], Ska1a2co[7], Scco[3]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[6], Ska1a2co[7], Scco[3]); lefromrsr = lersrf(srmodif, rosmodif, lines[15], Slines[15], lersr[15], backgd, 50, swirmx, swirmn); } } #endregion } else if (sza < 50) { #region 观测天顶角 if (vza < 10) { le_p = lefuncpre(sr, lines[16], lesr[16], backgd); srmodif = sr * brdffunc(a12lines, le_p / lerate, 0, 45, 0, ka1a2co[16], ka1a2co[17], ka1a2co[18], ka1a2co[19], cco[8], cco[9]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[16], ka1a2co[17], ka1a2co[18], ka1a2co[19], cco[8], cco[9]); le = lefunc(srmodif, lines[16], lesr[16], backgd, 0, le_p);//formula (2) if (covertp > 5 && covertp < 18) { lefromrsr = le; } else { //formula (8) rosmodif = ros * swirfunc(a12lines, le_p / lerate / lerate, 0, 45, 0, Ska1a2co[8], Ska1a2co[9], Scco[4]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[8], Ska1a2co[9], Scco[4]); //formula (3) lefromrsr = lersrf(srmodif, rosmodif, lines[16], Slines[16], lersr[16], backgd, 0, swirmx, swirmn); } } else if (vza < 30) { //first estimation of le, linear interpolating between phi=0 and 180. le_p = lefuncpre(sr, lines[17], lesr[17], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[36], lesr[36], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 20, 45, 0, ka1a2co[16], ka1a2co[17], ka1a2co[18], ka1a2co[19], cco[8], cco[9]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[16], ka1a2co[17], ka1a2co[18], ka1a2co[19], cco[8], cco[9]); le = lefunc(srmodif, lines[17], lesr[17], backgd, 20, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 20, 45, 0, Ska1a2co[8], Ska1a2co[9], Scco[4]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[8], Ska1a2co[9], Scco[4]); lefromrsr = lersrf(srmodif, rosmodif, lines[17], Slines[17], lersr[17], backgd, 20, swirmx, swirmn); } } else if (vza < 45) { le_p = lefuncpre(sr, lines[18], lesr[18], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[37], lesr[37], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 40, 45, 0, ka1a2co[16], ka1a2co[17], ka1a2co[18], ka1a2co[19], cco[8], cco[9]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[16], ka1a2co[17], ka1a2co[18], ka1a2co[19], cco[8], cco[9]); le = lefunc(srmodif, lines[18], lesr[18], backgd, 40, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 40, 45, 0, Ska1a2co[8], Ska1a2co[9], Scco[4]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[8], Ska1a2co[9], Scco[4]); lefromrsr = lersrf(srmodif, rosmodif, lines[18], Slines[18], lersr[18], backgd, 40, swirmx, swirmn); } } else { le_p = lefuncpre(sr, lines[19], lesr[19], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[38], lesr[38], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 50, 45, 0, ka1a2co[16], ka1a2co[17], ka1a2co[18], ka1a2co[19], cco[8], cco[9]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[16], ka1a2co[17], ka1a2co[18], ka1a2co[19], cco[8], cco[9]); le = lefunc(srmodif, lines[19], lesr[19], backgd, 50, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 50, 45, 0, Ska1a2co[8], Ska1a2co[9], Scco[4]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[8], Ska1a2co[9], Scco[4]); lefromrsr = lersrf(srmodif, rosmodif, lines[19], Slines[19], lersr[19], backgd, 50, swirmx, swirmn); } } #endregion } else { #region 观测天顶角 if (vza < 10) { le_p = lefuncpre(sr, lines[20], lesr[20], backgd); srmodif = sr * brdffunc(a12lines, le_p / lerate, 0, 55, 0, ka1a2co[20], ka1a2co[21], ka1a2co[22], ka1a2co[23], cco[10], cco[11]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[20], ka1a2co[21], ka1a2co[22], ka1a2co[23], cco[10], cco[11]); le = lefunc(srmodif, lines[20], lesr[20], backgd, 0, le_p);//formula (2) if (covertp > 5 && covertp < 18) { lefromrsr = le; } else { //formula (8) rosmodif = ros * swirfunc(a12lines, le_p / lerate / lerate, 0, 55, 0, Ska1a2co[10], Ska1a2co[11], Scco[5]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[10], Ska1a2co[11], Scco[5]); //formula (3) lefromrsr = lersrf(srmodif, rosmodif, lines[20], Slines[20], lersr[20], backgd, 0, swirmx, swirmn); } } else if (vza < 30) { //first estimation of le, linear interpolating between phi=0 and 180. le_p = lefuncpre(sr, lines[21], lesr[21], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[39], lesr[39], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 20, 55, 0, ka1a2co[20], ka1a2co[21], ka1a2co[22], ka1a2co[23], cco[10], cco[11]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[20], ka1a2co[21], ka1a2co[22], ka1a2co[23], cco[10], cco[11]); le = lefunc(srmodif, lines[21], lesr[21], backgd, 20, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 20, 55, 0, Ska1a2co[10], Ska1a2co[11], Scco[5]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[10], Ska1a2co[11], Scco[5]); lefromrsr = lersrf(srmodif, rosmodif, lines[21], Slines[21], lersr[21], backgd, 20, swirmx, swirmn); } } else if (vza < 45) { le_p = lefuncpre(sr, lines[22], lesr[22], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[40], lesr[40], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 40, 55, 0, ka1a2co[20], ka1a2co[21], ka1a2co[22], ka1a2co[23], cco[10], cco[11]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[20], ka1a2co[21], ka1a2co[22], ka1a2co[23], cco[10], cco[11]); le = lefunc(srmodif, lines[22], lesr[22], backgd, 40, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 40, 55, 0, Ska1a2co[10], Ska1a2co[11], Scco[5]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[10], Ska1a2co[11], Scco[5]); lefromrsr = lersrf(srmodif, rosmodif, lines[22], Slines[22], lersr[22], backgd, 40, swirmx, swirmn); } } else { le_p = lefuncpre(sr, lines[23], lesr[23], backgd) * (1 - phi / 180.0) + lefuncpre(sr, lines[41], lesr[41], backgd) * phi / 180.0; srmodif = sr * brdffunc(a12lines, le_p / lerate, 50, 55, 0, ka1a2co[20], ka1a2co[21], ka1a2co[22], ka1a2co[23], cco[10], cco[11]) / brdffunc(a12lines, le_p / lerate, vza, sza, phi, ka1a2co[20], ka1a2co[21], ka1a2co[22], ka1a2co[23], cco[10], cco[11]); le = lefunc(srmodif, lines[23], lesr[23], backgd, 50, le_p); if ((covertp > 5) && (covertp < 18)) { lefromrsr = le; } else { rosmodif = ros * swirfunc(a12lines, le_p / lerate, 50, 55, 0, Ska1a2co[10], Ska1a2co[11], Scco[5]) / swirfunc(a12lines, le_p / lerate, vza, sza, phi, Ska1a2co[10], Ska1a2co[11], Scco[5]); lefromrsr = lersrf(srmodif, rosmodif, lines[23], Slines[23], lersr[23], backgd, 50, swirmx, swirmn); } } #endregion } #endregion if ((le <= 0.2) || (lefromrsr < 0)) { lefromrsr = le;//if the calculating LE(from RSR) is negative or LE(SR) less than 0.2, adopt the LE value from the SR approach. } ////if (covertp > 5 && covertp < 18)//非森林区域 ////{ ////le from SR //le = (le < LUTData.maxlai[covertp - 1] * LUTData.clump[covertp - 1]) ? le : LUTData.maxlai[covertp - 1] * LUTData.clump[covertp - 1]; ////lai from SR //lai = le * 100 / LUTData.clump[covertp - 1]; ////le1=(unsigned short)le;//from SR ////lai1 = (UInt16)lai;//from SR //return new ushort[] { (UInt16)lai }; ////} ////else { //lefromrsr from RSR lefromrsr = (lefromrsr < LUTData.maxlai[covertp - 1] * LUTData.clump[covertp - 1]) ? lefromrsr : LUTData.maxlai[covertp - 1] * LUTData.clump[covertp - 1]; //laifromrsr from RSR laifromrsr = lefromrsr * 100 / LUTData.clump[covertp - 1]; //le2 = (UInt16)lefromrsr;//from RSR and SR //lai2 = (UInt16)laifromrsr;//from RSR and SR return(new ushort[] { (UInt16)laifromrsr }); } //return new ushort[] { lai1, lai2 }; }
private static double[] NormalizationCalculator(double sr, double vza, double sza, double phi, int covertp, int backgd) { double lerate, le_p; double[] brdffuncArray = new double[2];//brdffunc计算得到的红光、近红外归一化比值 LUTDataInit init = new LUTDataInit(); double[][] ka1a2co = init.CoverT[covertp - 1].Ka1a2co; double[][] Ska1a2co = init.CoverT[covertp - 1].SKa1a2co; double[][] cco = init.CoverT[covertp - 1].Cco; double[][] Scco = init.CoverT[covertp - 1].SCco; double[][] lesr = init.CoverT[covertp - 1].LeSr; double[][] lersr = init.CoverT[covertp - 1].LeRsr; int[] lines = init.CoverT[covertp - 1].Lines; int[] Slines = init.CoverT[covertp - 1].SLines; int a12lines = LUTData.a1a2lines[covertp - 1]; double swirmx = LUTData.swirmax[covertp - 1]; double swirmn = LUTData.swirmin[covertp - 1]; lerate = LUTData.a1a2lerate[covertp - 1]; #region 卫星天顶角 if (sza < 10) { #region 观测天顶角 if (vza < 10) { le_p = LAICalc.lefuncpre(sr, lines[0], lesr[0], backgd);// first estimation of LE brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 0, 5, 0, ka1a2co[0], ka1a2co[1], ka1a2co[2], ka1a2co[3], cco[0], cco[1]); } else if (vza < 30) { le_p = LAICalc.lefuncpre(sr, lines[1], lesr[1], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[24], lesr[24], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 20, 5, 0, ka1a2co[0], ka1a2co[1], ka1a2co[2], ka1a2co[3], cco[0], cco[1]); } else if (vza < 45) { le_p = LAICalc.lefuncpre(sr, lines[2], lesr[2], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[25], lesr[25], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 40, 5, 0, ka1a2co[0], ka1a2co[1], ka1a2co[2], ka1a2co[3], cco[0], cco[1]); } else { le_p = LAICalc.lefuncpre(sr, lines[3], lesr[3], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[26], lesr[26], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 50, 5, 0, ka1a2co[0], ka1a2co[1], ka1a2co[2], ka1a2co[3], cco[0], cco[1]); } #endregion } else if (sza < 20) { #region 观测天顶角 if (vza < 10) { le_p = LAICalc.lefuncpre(sr, lines[4], lesr[4], backgd); brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 0, 15, 0, ka1a2co[4], ka1a2co[5], ka1a2co[6], ka1a2co[7], cco[2], cco[3]); } else if (vza < 30) { le_p = LAICalc.lefuncpre(sr, lines[5], lesr[5], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[27], lesr[27], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 20, 15, 0, ka1a2co[4], ka1a2co[5], ka1a2co[6], ka1a2co[7], cco[2], cco[3]); } else if (vza < 45) { le_p = LAICalc.lefuncpre(sr, lines[6], lesr[6], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[28], lesr[28], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 40, 15, 0, ka1a2co[4], ka1a2co[5], ka1a2co[6], ka1a2co[7], cco[2], cco[3]); } else { le_p = LAICalc.lefuncpre(sr, lines[7], lesr[7], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[29], lesr[29], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 50, 15, 0, ka1a2co[4], ka1a2co[5], ka1a2co[6], ka1a2co[7], cco[2], cco[3]); } #endregion } else if (sza < 30) { #region 观测天顶角 if (vza < 10) { le_p = LAICalc.lefuncpre(sr, lines[8], lesr[8], backgd); brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 0, 25, 0, ka1a2co[8], ka1a2co[9], ka1a2co[10], ka1a2co[11], cco[4], cco[5]); } else if (vza < 30) { le_p = LAICalc.lefuncpre(sr, lines[9], lesr[9], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[30], lesr[30], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 20, 25, 0, ka1a2co[8], ka1a2co[9], ka1a2co[10], ka1a2co[11], cco[4], cco[5]); } else if (vza < 45) { le_p = LAICalc.lefuncpre(sr, lines[10], lesr[10], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[31], lesr[31], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 40, 25, 0, ka1a2co[8], ka1a2co[9], ka1a2co[10], ka1a2co[11], cco[4], cco[5]); } else { le_p = LAICalc.lefuncpre(sr, lines[11], lesr[11], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[32], lesr[32], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 50, 25, 0, ka1a2co[8], ka1a2co[9], ka1a2co[10], ka1a2co[11], cco[4], cco[5]); } #endregion } else if (sza < 40) { #region 观测天顶角 if (vza < 10) { le_p = LAICalc.lefuncpre(sr, lines[12], lesr[12], backgd); brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 0, 35, 0, ka1a2co[12], ka1a2co[13], ka1a2co[14], ka1a2co[15], cco[6], cco[7]); } else if (vza < 30) { le_p = LAICalc.lefuncpre(sr, lines[13], lesr[13], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[33], lesr[33], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 20, 35, 0, ka1a2co[12], ka1a2co[13], ka1a2co[14], ka1a2co[15], cco[6], cco[7]); } else if (vza < 45) { le_p = LAICalc.lefuncpre(sr, lines[14], lesr[14], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[34], lesr[34], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 40, 35, 0, ka1a2co[12], ka1a2co[13], ka1a2co[14], ka1a2co[15], cco[6], cco[7]); } else { le_p = LAICalc.lefuncpre(sr, lines[15], lesr[15], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[35], lesr[35], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 50, 35, 0, ka1a2co[12], ka1a2co[13], ka1a2co[14], ka1a2co[15], cco[6], cco[7]); } #endregion } else if (sza < 50) { #region 观测天顶角 if (vza < 10) { le_p = LAICalc.lefuncpre(sr, lines[16], lesr[16], backgd); brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 0, 45, 0, ka1a2co[16], ka1a2co[17], ka1a2co[18], ka1a2co[19], cco[8], cco[9]); } else if (vza < 30) { le_p = LAICalc.lefuncpre(sr, lines[17], lesr[17], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[36], lesr[36], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 20, 45, 0, ka1a2co[16], ka1a2co[17], ka1a2co[18], ka1a2co[19], cco[8], cco[9]); } else if (vza < 45) { le_p = LAICalc.lefuncpre(sr, lines[18], lesr[18], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[37], lesr[37], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 40, 45, 0, ka1a2co[16], ka1a2co[17], ka1a2co[18], ka1a2co[19], cco[8], cco[9]); } else { le_p = LAICalc.lefuncpre(sr, lines[19], lesr[19], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[38], lesr[38], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 50, 45, 0, ka1a2co[16], ka1a2co[17], ka1a2co[18], ka1a2co[19], cco[8], cco[9]); } #endregion } else { #region 观测天顶角 if (vza < 10) { le_p = LAICalc.lefuncpre(sr, lines[20], lesr[20], backgd); brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 0, 55, 0, ka1a2co[20], ka1a2co[21], ka1a2co[22], ka1a2co[23], cco[10], cco[11]); } else if (vza < 30) { le_p = LAICalc.lefuncpre(sr, lines[21], lesr[21], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[39], lesr[39], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 20, 55, 0, ka1a2co[20], ka1a2co[21], ka1a2co[22], ka1a2co[23], cco[10], cco[11]); } else if (vza < 45) { le_p = LAICalc.lefuncpre(sr, lines[22], lesr[22], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[40], lesr[40], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 40, 55, 0, ka1a2co[20], ka1a2co[21], ka1a2co[22], ka1a2co[23], cco[10], cco[11]); } else { le_p = LAICalc.lefuncpre(sr, lines[23], lesr[23], backgd) * (1 - phi / 180.0) + LAICalc.lefuncpre(sr, lines[41], lesr[41], backgd) * phi / 180.0; brdffuncArray = LAICalc.GetBrdffunc(a12lines, le_p / lerate, 50, 55, 0, ka1a2co[20], ka1a2co[21], ka1a2co[22], ka1a2co[23], cco[10], cco[11]); } #endregion } #endregion return(brdffuncArray); }