Commit aa74fbb
authored
* Fix SAVI formula and EBBI type inconsistency (#1094)
SAVI: The (1+L) factor was in the denominator instead of the numerator.
The standard formula (Huete 1988) is ((NIR-Red)/(NIR+Red+L))*(1+L).
The code computed (NIR-Red)/((NIR+Red+L)*(1+L)), making all results
too small by (1+L)^2 = 2.25 with default L=0.5.
EBBI GPU: Changed nb.int64(10) to 10.0 to match CPU path's type
behavior.
* Fix SAVI formula and add regression test (#1094)
SAVI had (1+L) in the denominator instead of the numerator. The
Huete (1988) formula is ((NIR-Red)/(NIR+Red+L))*(1+L). The code
computed (NIR-Red)/((NIR+Red+L)*(1+L)), making results too small
by (1+L)^2.
Updated the qgis_savi fixture and uint dtype fixture with correct
reference values. Added test_savi_formula_1094 which checks all 4
backends against the formula directly.
Also fixed EBBI GPU: nb.int64(10) -> 10.0 for type consistency.
1 parent 1437c61 commit aa74fbb
2 files changed
+61
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1062 | 1062 | | |
1063 | 1063 | | |
1064 | 1064 | | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
| 1065 | + | |
| 1066 | + | |
1068 | 1067 | | |
1069 | 1068 | | |
1070 | 1069 | | |
| |||
1077 | 1076 | | |
1078 | 1077 | | |
1079 | 1078 | | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
| 1079 | + | |
| 1080 | + | |
1083 | 1081 | | |
1084 | 1082 | | |
1085 | 1083 | | |
| |||
1367 | 1365 | | |
1368 | 1366 | | |
1369 | 1367 | | |
1370 | | - | |
| 1368 | + | |
1371 | 1369 | | |
1372 | 1370 | | |
1373 | 1371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
| 218 | + | |
| 219 | + | |
221 | 220 | | |
222 | 221 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
231 | 230 | | |
232 | 231 | | |
233 | 232 | | |
| |||
314 | 313 | | |
315 | 314 | | |
316 | 315 | | |
317 | | - | |
| 316 | + | |
| 317 | + | |
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
427 | 471 | | |
428 | 472 | | |
429 | 473 | | |
| |||
0 commit comments