I want to use Python and Spectral library to open a hyperspectral image as ENVI file (.hdr + .dat), rewrite some bands and then save the file in the same format. I have problem with this:
"TypeError: 'BipFile' object does not support item assignment"
I've got this response when I want to rewrite the band or change the file. Do you know of some solution or advice which could help?
#open file
src = envi.open("C:\soubory_pix\SASI_1.pix.hdr", "C:\soubory_pix\SASI_1.pix")
src_band = src
#rewrite band
src_band[:, 0:319, 96] = src[:, 0:319, 96] * koef_men
#Result
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: 'BipFile' object does not support item assignment
envi.open
?