root / org.gvsig.toolbox / trunk / org.gvsig.toolbox / org.gvsig.toolbox.algorithm / src / main / java / es / unex / sextante / vegetationIndices / pviRichardson / PVIRichardsonAlgorithm.java @ 59
History | View | Annotate | Download (889 Bytes)
1 |
package es.unex.sextante.vegetationIndices.pviRichardson; |
---|---|
2 |
|
3 |
import es.unex.sextante.vegetationIndices.base.DistanceBasedAlgorithm; |
4 |
|
5 |
public class PVIRichardsonAlgorithm |
6 |
extends
|
7 |
DistanceBasedAlgorithm { |
8 |
|
9 |
|
10 |
@Override
|
11 |
public void defineCharacteristics() { |
12 |
|
13 |
super.defineCharacteristics();
|
14 |
|
15 |
setName("PVI(Richardson and Wiegand)");
|
16 |
|
17 |
} |
18 |
|
19 |
|
20 |
@Override
|
21 |
protected double getIndex(final double dRed, |
22 |
final double dNIR) { |
23 |
|
24 |
final double dA1 = m_dSlope; |
25 |
final double dA0 = m_dIntercept; |
26 |
final double dB1 = 1 / m_dSlope; |
27 |
final double dB0 = dRed - dB1 * dNIR; |
28 |
|
29 |
final double dRgg5 = (dB1 * dA0 - dB0 * dA1) / (dB1 - dA1); |
30 |
final double dRgg7 = (dA0 - dB0) / (dB1 - dA1); |
31 |
|
32 |
return (Math.sqrt(Math.pow(dRgg5 - dRed, 2.) + Math.pow(dRgg7 - dNIR, 2.))); |
33 |
|
34 |
} |
35 |
|
36 |
} |