Skip to content

Commit

Permalink
Corrected copy paste mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
rayn-alex committed Sep 11, 2024
1 parent 618cbc9 commit 8d3ae93
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plantcv/plantcv/spectral_index/spectral_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,13 @@ def egi(rgb_img, distance=40):
r530 = (rgb_img.array_data[:, :, r530_index])
r700 = (rgb_img.array_data[:, :, r700_index])
# Naturally ranges from -1 to 2

total = r700 + r530 + r460
with np.errstate(divide="ignore", invalid="ignore"):
index_array_raw = (2 * r530 - r700 - r460) / (2 * r530 + r700 + r460)
r = r700/ total
g = r530 / total
b = r460 / total
index_array_raw = (2 * g) - r - b
return _package_index(hsi=rgb_img, raw_index=index_array_raw, method="GLI")
warn("Available wavelengths are not suitable for calculating GLI. Try increasing distance.")
return None
Expand Down

0 comments on commit 8d3ae93

Please sign in to comment.