spectralpython / spectral

Python module for hyperspectral image processing
MIT License
563 stars 138 forks source link

envi file containing complex values #135

Closed Nipouradar1995 closed 1 year ago

Nipouradar1995 commented 2 years ago

hello I've just started to work with SPy to read envi files which contains complex values ,after runing this code 1 i got this parameter 2 all seems okey because my envi header file is : dtype=6 which refer to 32*2 complex 3 but when i checked the values of the array i noticed that it contains just the real parts and the complex part is 0
5 which is different from what i got with IDL , here is some values of the first column which contain real and imaginary part 6 so there is something wrong on my code or SPy dont support the files which contains complex value. thanks in advance .

tboggs commented 2 years ago

I've never processed complex images with SPy but it seems like it should be possible. What happens if you modify your code to replace img.load() with img.load(dtype=np.csingle)?

Nipouradar1995 commented 2 years ago

thank you a lot ... it works with your modification .

tboggs commented 2 years ago

Great. I'll update the code so the correct dtype is automatically used for complex data types.