0

I have the following data available from the hyperspectral imaging:

  • cube_envi32.dat
  • cube_envi32.hdr
  • roi_masks.bmp

How can I plot the reflectance vs wavelength plot? Is there any sample python code that I can use?

S.EB
  • 1,966
  • 4
  • 29
  • 54

1 Answers1

1

To plot an arbitrary pixel, you can use the spectral module to read the pixel data and wavelengths (assuming wavelength metadata are in the ENVI header):

import spectral as spy
import matplotlib.pyplot as plt

img = spy.envi.open('cube_envi32.hdr')
(i, j) = (10, 10) # coordinates of pixel to display
plt.plot(img.bands.centers, img[i,j])

If you want to plot spectra interactively, see the spectral documentation here.

bogatron
  • 18,639
  • 6
  • 53
  • 47