Skip to content

Commit

Permalink
convert to float32 only once in gli
Browse files Browse the repository at this point in the history
  • Loading branch information
HaleySchuhl committed Sep 16, 2024
1 parent 4034bc4 commit 1af23de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plantcv/plantcv/spectral_index/spectral_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,9 @@ def gli(img, distance=20):
r480_index = _find_closest(np.array([float(i) for i in img.wavelength_dict.keys()]), 480)
r670_index = _find_closest(np.array([float(i) for i in img.wavelength_dict.keys()]), 670)
r530_index = _find_closest(np.array([float(i) for i in img.wavelength_dict.keys()]), 530)
blue = (img.array_data[:, :, r480_index]).astype(np.float32)
red = (img.array_data[:, :, r670_index]).astype(np.float32)
green = (img.array_data[:, :, r530_index]).astype(np.float32)
blue = (img.array_data[:, :, r480_index])
red = (img.array_data[:, :, r670_index])
green = (img.array_data[:, :, r530_index])
else:
warn("Available wavelengths are not suitable for calculating GLI. Try increasing distance.")
return None
Expand Down

0 comments on commit 1af23de

Please sign in to comment.