我编写了用于频谱分解的代码,但倒数第二行出现错误:“方法”对象不可下标
光栅数据的频谱分解
def map_abundances(self,endmembers):
'''
Arguments:
endmembers A (q x p) array of q endmembers and p bands
Returns: An (m x n x q) numpy.ndarray (in HSI form) that contains
the abundances for each of q endmember types.
'''
q = endmembers.shape[0]
# FCLS with the sum-to-one constraint has an extra degree of freedom so it
# is able to form a simplex of q corners in (q-1) dimensions:
# q <= n (Settle and Drake, 1993)
n = q - 1 # Find q corners of simplex in (q-1) dimensions
endmembers = endmembers[:, 0:n]
# Do the FCLS unmixing
abundances = self.mapper.map(self.hsi[:,:,0:n],endmembers, normalize=False)
return abundances[enter image description here][1]