EnSpec / hytools

Hyperspectral image processing library
GNU General Public License v3.0
56 stars 25 forks source link

Update flex.py #14

Closed oldmanye007 closed 2 years ago

oldmanye007 commented 2 years ago

Existing FlexBRDF code works at Python 3.7 (3.7.13), but throws an error in Python 3.8 (3.8.13). It is caused by an update by Python. "Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result."

Changes are made in two functions: "calc_flex_single" and "calc_flex_group". New code uses tuples for array indexing. Tested on version 3.7.13 and 3.8.13.