[GRASS-SVN] r69948 - grass/trunk/imagery/i.atcorr
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Nov 28 10:33:18 PST 2016
Author: neteler
Date: 2016-11-28 10:33:18 -0800 (Mon, 28 Nov 2016)
New Revision: 69948
Modified:
grass/trunk/imagery/i.atcorr/geomcond.h
grass/trunk/imagery/i.atcorr/iwave.cpp
Log:
i.atcorr: fix nonsensical Quickbird2 filter function definitions (fixes r60610)
Modified: grass/trunk/imagery/i.atcorr/geomcond.h
===================================================================
--- grass/trunk/imagery/i.atcorr/geomcond.h 2016-11-28 18:30:29 UTC (rev 69947)
+++ grass/trunk/imagery/i.atcorr/geomcond.h 2016-11-28 18:33:18 UTC (rev 69948)
@@ -61,7 +61,7 @@
/* */
/* 16 worldview2 * enter month,day,hh.ddd,long.,lat. */
/* */
-/* 17 quickbird * enter month,day,hh.ddd,long.,lat. */
+/* 17 quickbird2 * enter month,day,hh.ddd,long.,lat. */
/* */
/* 18 Landsat 8 * enter month,day,hh.ddd,long.,lat. */
/* */
Modified: grass/trunk/imagery/i.atcorr/iwave.cpp
===================================================================
--- grass/trunk/imagery/i.atcorr/iwave.cpp 2016-11-28 18:30:29 UTC (rev 69947)
+++ grass/trunk/imagery/i.atcorr/iwave.cpp 2016-11-28 18:33:18 UTC (rev 69948)
@@ -2872,94 +2872,231 @@
void IWave::quickbird2(int iwa)
{
-
- /* QuickBird Pan of quickbird2 */
- static const float sr1[65] = {
- 300.0000, 312.5000, 325.0000, 337.5000, 350.0000, 362.5000, 375.0000, 387.5000,
- 400.0000, 412.5000, 425.0000, 437.5000, 450.0000, 462.5000, 475.0000, 487.5000,
- 500.0000, 512.5000, 525.0000, 537.5000, 550.0000, 562.5000, 575.0000, 587.5000,
- 600.0000, 612.5000, 625.0000, 637.5000, 650.0000, 662.5000, 675.0000, 687.5000,
- 700.0000, 712.5000, 725.0000, 737.5000, 750.0000, 762.5000, 775.0000, 787.5000,
- 800.0000, 812.5000, 825.0000, 837.5000, 850.0000, 862.5000, 875.0000, 887.5000,
- 900.0000, 912.5000, 925.0000, 937.5000, 950.0000, 962.5000, 975.0000, 987.5000,
- 1000.0000, 1012.5000, 1025.0000, 1037.5000, 1050.0000, 1062.5000, 1075.0000, 1087.5000,
- 1100.0000
- };
-
- /* QuickBird Blue of quickbird2 */
- static const float sr2[65] = {
- .0000, .0000, .0000, .0000, .0014, .0010, .0020, .0138,
- .0362, .0758, .1219, .1789, .2198, .2854, .3364, .3579,
- .3781, .4276, .4982, .5925, .7051, .8105, .8911, .9426,
- .9598, .9922, .9876, .9573, .9183, .8831, .8893, .8848,
- .8888, .8677, .8625, .8897, .9295, .9130, .9039, .8761,
- .8457, .8582, .8339, .8526, .8394, .7850, .7342, .6788,
- .6186, .5832, .4969, .4305, .3738, .3035, .2567, .2162,
- .1776, .1421, .1085, .0773, .0548, .0050, .0000, .0000,
- .0000
- };
-
- /* QuickBird Green of quickbird2 */
- static const float sr3[65] = {
- .0000, .0000, .0010, .0037, .0053, .0030, .0013, .0023,
- .0025, .0053, .0284, .2164, .6299, .8176, .9178, .9801,
- .9179, .4787, .1592, .0663, .0293, .0126, .0126, .0098,
- .0098, .0091, .0036, .0025, .0028, .0030, .0089, .0256,
- .0083, .0086, .0091, .0028, .0031, .0034, .0036, .0033,
- .0030, .0035, .0040, .0042, .0048, .0057, .0052, .0052,
- .0068, .0101, .0093, .0056, .0035, .0019, .0014, .0012,
- .0011, .0012, .0015, .0015, .0012, .0000, .0000, .0000,
- .0000
- };
-
- /* QuickBird Red of quickbird2 */
- static const float sr4[65] = {
- .0000, .0000, .0000, .0000, .0031, .0023, .0014, .0012,
- .0012, .0013, .0023, .0046, .0178, .0356, .0982, .2739,
- .5277, .8005, .8705, .9640, .9934, .9733, .9652, .7230,
- .3124, .1139, .0365, .0268, .0242, .0140, .0132, .0076,
- .0032, .0035, .0076, .0047, .0022, .0029, .0034, .0041,
- .0038, .0031, .0031, .0035, .0051, .0084, .0090, .0078,
- .0076, .0081, .0067, .0043, .0027, .0016, .0013, .0010,
- .0008, .0009, .0013, .0010, .0009, .0000, .0000, .0000,
- .0000
- };
-
- /* QuickBird NIR of quickbird2 */
- static const float sr5[65] = {
- .0000, .0000, .0000, .0000, .0037, .0018, .0011, .0009,
- .0007, .0013, .0010, .0024, .0029, .0032, .0032, .0023,
- .0031, .0036, .0053, .0065, .0078, .0110, .0177, .0399,
- .0872, .2675, .6620, .8976, .9798, .9961, .8726, .5119,
- .1651, .0417, .0201, .0205, .0095, .0048, .0045, .0063,
- .0045, .0026, .0025, .0025, .0025, .0024, .0022, .0019,
- .0021, .0028, .0015, .0010, .0010, .0008, .0007, .0006,
- .0008, .0007, .0008, .0009, .0008, .0000, .0000, .0000,
- .0000
- };
-
- static const float wli[5] = {0.001, 0.001, 0.001, 0.001, 0.001};
- static const float wls[5] = {0.161, 0.161, 0.161, 0.161, 0.161};
-
- ffu.wlinf = (float)wli[iwa-1];
- ffu.wlsup = (float)wls[iwa-1];
-
- int i;
- for(i = 0; i < 1501; i++) ffu.s[i] = 0;
-
- switch(iwa)
- {
- case 1: for(i = 0; i < 65; i++) ffu.s[-99+i] = sr1[i];
- break;
- case 2: for(i = 0; i < 65; i++) ffu.s[-99+i] = sr2[i];
- break;
- case 3: for(i = 0; i < 65; i++) ffu.s[-99+i] = sr3[i];
- break;
- case 4: for(i = 0; i < 65; i++) ffu.s[-99+i] = sr4[i];
- break;
- case 5: for(i = 0; i < 65; i++) ffu.s[-99+i] = sr5[i];
- break;
- }
+
+ /* pan of quickbird2 */
+ static const float sr1[285] = {
+ .0014, .0013, .0012, .0011, .0011, .0010, .0009, .0010,
+ .0012, .0016, .0020, .0044, .0069, .0089, .0109, .0138,
+ .0167, .0213, .0259, .0311, .0362, .0434, .0506, .0588,
+ .0669, .0758, .0846, .0939, .1032, .1125, .1219, .1334,
+ .1450, .1567, .1684, .1789, .1895, .2011, .2127, .2163,
+ .2198, .2392, .2586, .2669, .2753, .2854, .2955, .3055,
+ .3154, .3259, .3364, .3410, .3456, .3501, .3546, .3579,
+ .3611, .3648, .3685, .3733, .3781, .3875, .3969, .4055,
+ .4141, .4276, .4410, .4543, .4676, .4829, .4982, .5167,
+ .5352, .5532, .5712, .5925, .6137, .6382, .6627, .6839,
+ .7051, .7275, .7499, .7705, .7910, .8105, .8301, .8465,
+ .8629, .8770, .8911, .9081, .9251, .9293, .9335, .9426,
+ .9518, .9570, .9621, .9610, .9598, .9753, .9907, .9941,
+ .9975, .9922, .9869, .9935, 1.0000, .9938, .9876, .9877,
+ .9878, .9770, .9662, .9573, .9483, .9340, .9197, .9190,
+ .9183, .9063, .8944, .8912, .8880, .8831, .8781, .8865,
+ .8949, .8921, .8893, .8858, .8823, .8869, .8916, .8848,
+ .8780, .8879, .8978, .8933, .8888, .8801, .8714, .8690,
+ .8667, .8677, .8687, .8699, .8712, .8668, .8625, .8718,
+ .8810, .8814, .8818, .8897, .8976, .9024, .9072, .9183,
+ .9295, .9311, .9326, .9198, .9070, .9130, .9191, .9173,
+ .9155, .9097, .9039, .8988, .8936, .8871, .8805, .8761,
+ .8717, .8605, .8493, .8475, .8457, .8505, .8553, .8568,
+ .8582, .8582, .8583, .8627, .8671, .8505, .8339, .8390,
+ .8440, .8470, .8500, .8526, .8553, .8447, .8341, .8368,
+ .8394, .8235, .8076, .8091, .8106, .7850, .7594, .7616,
+ .7638, .7490, .7342, .7204, .7066, .7003, .6941, .6788,
+ .6634, .6589, .6545, .6365, .6186, .6094, .6003, .5961,
+ .5919, .5832, .5744, .5527, .5309, .5139, .4969, .4883,
+ .4798, .4630, .4463, .4305, .4147, .4097, .4048, .3893,
+ .3738, .3593, .3448, .3283, .3118, .3035, .2952, .2840,
+ .2729, .2648, .2567, .2498, .2428, .2322, .2216, .2162,
+ .2107, .2039, .1971, .1874, .1776, .1703, .1630, .1557,
+ .1485, .1421, .1358, .1299, .1240, .1162, .1085, .1020,
+ .0954, .0893, .0831, .0773, .0715, .0675, .0634, .0591,
+ .0548, .0512, .0476, .0288, .0101
+ };
+
+ /* blue of quickbird2 */
+ static const float sr2[291] = {
+ .0010, .0015, .0021, .0026, .0031, .0037, .0042, .0044,
+ .0045, .0049, .0053, .0047, .0041, .0037, .0033, .0030,
+ .0027, .0025, .0023, .0018, .0013, .0015, .0018, .0020,
+ .0022, .0023, .0024, .0025, .0026, .0025, .0025, .0027,
+ .0029, .0035, .0040, .0053, .0066, .0098, .0131, .0208,
+ .0284, .0483, .0681, .1116, .1552, .2164, .2776, .3544,
+ .4313, .5306, .6299, .6770, .7241, .7577, .7914, .8176,
+ .8439, .8667, .8896, .9037, .9178, .9235, .9293, .9447,
+ .9602, .9801, 1.0000, .9958, .9916, .9548, .9179, .8452,
+ .7724, .6729, .5734, .4787, .3840, .3247, .2653, .2123,
+ .1592, .1204, .0816, .0754, .0692, .0663, .0633, .0551,
+ .0469, .0381, .0293, .0235, .0176, .0152, .0127, .0126,
+ .0125, .0127, .0129, .0128, .0126, .0119, .0111, .0106,
+ .0101, .0098, .0096, .0094, .0093, .0095, .0098, .0102,
+ .0106, .0105, .0104, .0091, .0079, .0066, .0054, .0045,
+ .0036, .0031, .0026, .0026, .0025, .0025, .0025, .0025,
+ .0025, .0027, .0028, .0027, .0027, .0027, .0027, .0030,
+ .0033, .0039, .0044, .0067, .0089, .0125, .0162, .0202,
+ .0242, .0256, .0271, .0231, .0191, .0137, .0083, .0070,
+ .0056, .0063, .0070, .0086, .0102, .0111, .0121, .0106,
+ .0091, .0064, .0037, .0032, .0027, .0028, .0029, .0028,
+ .0027, .0029, .0031, .0032, .0032, .0034, .0036, .0034,
+ .0033, .0034, .0036, .0036, .0036, .0034, .0031, .0032,
+ .0034, .0033, .0032, .0031, .0031, .0031, .0030, .0031,
+ .0033, .0033, .0033, .0035, .0036, .0036, .0037, .0039,
+ .0040, .0041, .0041, .0042, .0043, .0042, .0042, .0046,
+ .0050, .0049, .0048, .0053, .0059, .0058, .0057, .0057,
+ .0056, .0055, .0053, .0053, .0052, .0052, .0052, .0052,
+ .0052, .0052, .0053, .0055, .0057, .0063, .0068, .0075,
+ .0083, .0090, .0098, .0101, .0105, .0107, .0109, .0101,
+ .0093, .0085, .0076, .0069, .0061, .0056, .0050, .0046,
+ .0042, .0039, .0035, .0032, .0029, .0025, .0021, .0019,
+ .0017, .0016, .0016, .0015, .0014, .0013, .0012, .0012,
+ .0012, .0012, .0012, .0012, .0011, .0011, .0011, .0011,
+ .0010, .0011, .0011, .0012, .0012, .0012, .0012, .0013,
+ .0015, .0016, .0018, .0017, .0015, .0015, .0015, .0015,
+ .0014, .0013, .0012
+ };
+
+ /* green of quickbird2 */
+ static const float sr3[281] = {
+ .0031, .0036, .0040, .0031, .0022, .0023, .0023, .0019,
+ .0015, .0015, .0014, .0011, .0008, .0010, .0011, .0012,
+ .0012, .0012, .0012, .0012, .0012, .0012, .0011, .0012,
+ .0012, .0013, .0014, .0016, .0019, .0021, .0023, .0026,
+ .0028, .0033, .0037, .0046, .0055, .0077, .0098, .0138,
+ .0178, .0206, .0234, .0268, .0301, .0356, .0412, .0504,
+ .0597, .0789, .0982, .1274, .1566, .1924, .2282, .2739,
+ .3196, .3686, .4175, .4726, .5277, .5928, .6579, .7138,
+ .7698, .8005, .8312, .8378, .8445, .8575, .8705, .8893,
+ .9082, .9271, .9460, .9640, .9819, .9910, 1.0000, .9967,
+ .9934, .9876, .9818, .9755, .9691, .9733, .9774, .9822,
+ .9869, .9761, .9652, .9316, .8979, .8445, .7910, .7230,
+ .6551, .5687, .4822, .3973, .3124, .2579, .2033, .1706,
+ .1378, .1139, .0901, .0729, .0557, .0461, .0365, .0322,
+ .0278, .0270, .0262, .0268, .0274, .0275, .0275, .0259,
+ .0242, .0214, .0186, .0167, .0148, .0140, .0132, .0132,
+ .0132, .0132, .0132, .0124, .0116, .0104, .0092, .0076,
+ .0061, .0052, .0043, .0038, .0032, .0030, .0029, .0029,
+ .0029, .0035, .0040, .0051, .0062, .0069, .0076, .0076,
+ .0076, .0067, .0057, .0047, .0037, .0032, .0026, .0024,
+ .0022, .0024, .0026, .0028, .0030, .0029, .0028, .0030,
+ .0031, .0032, .0034, .0037, .0040, .0039, .0038, .0041,
+ .0044, .0043, .0041, .0040, .0038, .0036, .0035, .0034,
+ .0032, .0031, .0030, .0030, .0030, .0031, .0031, .0032,
+ .0032, .0033, .0033, .0035, .0037, .0041, .0044, .0048,
+ .0051, .0060, .0069, .0073, .0078, .0084, .0091, .0091,
+ .0092, .0091, .0090, .0088, .0086, .0083, .0080, .0078,
+ .0076, .0075, .0075, .0075, .0076, .0077, .0078, .0080,
+ .0081, .0081, .0082, .0080, .0078, .0072, .0067, .0061,
+ .0056, .0051, .0046, .0043, .0039, .0035, .0031, .0029,
+ .0027, .0023, .0020, .0018, .0017, .0016, .0015, .0014,
+ .0012, .0012, .0013, .0012, .0011, .0010, .0009, .0010,
+ .0010, .0009, .0009, .0008, .0008, .0008, .0009, .0009,
+ .0009, .0009, .0010, .0010, .0011, .0012, .0013, .0012,
+ .0011, .0011, .0011, .0010, .0009, .0009, .0010, .0009,
+ .0009
+ };
+
+ /* red of quickbird2 */
+ static const float sr4[281] = {
+ .0037, .0031, .0024, .0020, .0016, .0018, .0019, .0016,
+ .0012, .0011, .0011, .0010, .0009, .0009, .0010, .0009,
+ .0009, .0011, .0013, .0010, .0007, .0009, .0012, .0012,
+ .0013, .0013, .0013, .0012, .0012, .0011, .0010, .0013,
+ .0015, .0018, .0021, .0024, .0028, .0029, .0031, .0030,
+ .0029, .0029, .0028, .0029, .0030, .0032, .0035, .0036,
+ .0037, .0034, .0032, .0026, .0021, .0021, .0022, .0023,
+ .0024, .0025, .0027, .0029, .0031, .0032, .0033, .0034,
+ .0035, .0036, .0037, .0041, .0046, .0049, .0053, .0056,
+ .0060, .0061, .0063, .0065, .0066, .0068, .0069, .0073,
+ .0078, .0084, .0090, .0096, .0102, .0110, .0118, .0128,
+ .0139, .0158, .0177, .0207, .0238, .0286, .0334, .0399,
+ .0464, .0548, .0631, .0751, .0872, .1077, .1281, .1666,
+ .2050, .2675, .3301, .4130, .4960, .5790, .6620, .7337,
+ .8054, .8447, .8840, .8976, .9112, .9265, .9418, .9608,
+ .9798, .9878, .9958, .9979, 1.0000, .9961, .9923, .9723,
+ .9524, .9125, .8726, .8128, .7530, .6767, .6004, .5119,
+ .4235, .3520, .2806, .2228, .1651, .1304, .0957, .0744,
+ .0531, .0417, .0302, .0261, .0220, .0210, .0201, .0204,
+ .0207, .0211, .0215, .0205, .0196, .0172, .0148, .0121,
+ .0095, .0081, .0066, .0058, .0050, .0048, .0045, .0043,
+ .0042, .0043, .0045, .0048, .0051, .0055, .0060, .0063,
+ .0067, .0064, .0062, .0053, .0045, .0038, .0031, .0029,
+ .0027, .0026, .0024, .0025, .0025, .0025, .0025, .0024,
+ .0024, .0025, .0026, .0025, .0024, .0025, .0026, .0026,
+ .0025, .0026, .0026, .0026, .0025, .0024, .0023, .0024,
+ .0024, .0023, .0022, .0022, .0021, .0021, .0020, .0019,
+ .0019, .0019, .0020, .0021, .0021, .0023, .0025, .0026,
+ .0028, .0028, .0028, .0027, .0025, .0020, .0015, .0013,
+ .0012, .0011, .0011, .0010, .0010, .0010, .0010, .0010,
+ .0010, .0009, .0008, .0008, .0008, .0008, .0007, .0007,
+ .0007, .0007, .0007, .0007, .0007, .0006, .0006, .0006,
+ .0006, .0007, .0007, .0007, .0008, .0007, .0007, .0007,
+ .0006, .0007, .0009, .0009, .0009, .0008, .0008, .0008,
+ .0008, .0009, .0009, .0009, .0009, .0008, .0006, .0007,
+ .0008
+ };
+
+ /* nir of quickbird2 */
+ static const float sr5[291] = {
+ .0014, .0021, .0029, .0036, .0044, .0051, .0059, .0061,
+ .0063, .0062, .0060, .0057, .0054, .0045, .0035, .0028,
+ .0021, .0023, .0024, .0021, .0017, .0020, .0023, .0021,
+ .0019, .0017, .0016, .0018, .0019, .0019, .0018, .0017,
+ .0015, .0015, .0015, .0017, .0019, .0018, .0017, .0021,
+ .0024, .0025, .0025, .0028, .0031, .0036, .0040, .0044,
+ .0047, .0047, .0047, .0048, .0049, .0045, .0042, .0043,
+ .0044, .0046, .0048, .0050, .0052, .0054, .0056, .0054,
+ .0052, .0047, .0042, .0036, .0030, .0028, .0026, .0026,
+ .0026, .0026, .0025, .0027, .0029, .0027, .0026, .0030,
+ .0034, .0043, .0053, .0066, .0079, .0089, .0099, .0101,
+ .0102, .0090, .0079, .0064, .0049, .0049, .0048, .0056,
+ .0063, .0070, .0077, .0078, .0079, .0072, .0065, .0054,
+ .0044, .0041, .0038, .0038, .0037, .0037, .0036, .0036,
+ .0036, .0038, .0039, .0042, .0045, .0047, .0049, .0053,
+ .0057, .0059, .0061, .0064, .0068, .0070, .0073, .0079,
+ .0086, .0093, .0100, .0106, .0112, .0117, .0122, .0126,
+ .0129, .0132, .0135, .0140, .0144, .0150, .0156, .0164,
+ .0172, .0184, .0196, .0218, .0241, .0268, .0294, .0319,
+ .0343, .0375, .0407, .0448, .0490, .0545, .0599, .0664,
+ .0729, .0817, .0905, .1050, .1195, .1410, .1625, .2024,
+ .2424, .3015, .3606, .4268, .4930, .5640, .6350, .7166,
+ .7983, .8726, .9469, .9735, 1.0000, .9986, .9971, .9837,
+ .9702, .9526, .9350, .9179, .9009, .8853, .8698, .8606,
+ .8515, .8449, .8382, .8352, .8322, .8289, .8256, .8230,
+ .8204, .8137, .8070, .7957, .7844, .7669, .7495, .7267,
+ .7040, .6911, .6782, .6638, .6494, .6313, .6132, .5900,
+ .5669, .5493, .5317, .5117, .4917, .4644, .4371, .3943,
+ .3515, .3134, .2753, .2485, .2216, .1910, .1604, .1385,
+ .1166, .1003, .0840, .0756, .0672, .0540, .0409, .0307,
+ .0205, .0170, .0135, .0118, .0100, .0089, .0078, .0071,
+ .0064, .0059, .0054, .0050, .0046, .0040, .0035, .0031,
+ .0028, .0026, .0024, .0023, .0022, .0022, .0021, .0020,
+ .0019, .0018, .0018, .0019, .0019, .0018, .0016, .0017,
+ .0017, .0017, .0017, .0019, .0020, .0021, .0021, .0021,
+ .0020, .0020, .0019, .0018, .0017, .0018, .0018, .0018,
+ .0017, .0018, .0020
+ };
+
+ static const float wli[5] = {0.350, 0.325, 0.350, 0.350, 0.325};
+ static const float wls[5] = {1.060, 1.050, 1.050, 1.050, 1.050};
+
+ ffu.wlinf = (float)wli[iwa-1];
+ ffu.wlsup = (float)wls[iwa-1];
+
+ int i;
+ for(i = 0; i < 1501; i++) ffu.s[i] = 0;
+
+ switch(iwa)
+ {
+ case 1: for(i = 0; i < 285; i++) ffu.s[40+i] = sr1[i];
+ break;
+ case 2: for(i = 0; i < 291; i++) ffu.s[30+i] = sr2[i];
+ break;
+ case 3: for(i = 0; i < 281; i++) ffu.s[40+i] = sr3[i];
+ break;
+ case 4: for(i = 0; i < 281; i++) ffu.s[40+i] = sr4[i];
+ break;
+ case 5: for(i = 0; i < 291; i++) ffu.s[30+i] = sr5[i];
+ break;
+ }
}
void IWave::landsat_8(int iwa)
More information about the grass-commit
mailing list