I can open and read a hyperspectral image using GDAL according to the instructions brought by Max König here:

So after reading the data like this :

data = gdal.Open( filename )

then I can see the x, y, dim information of the dataset :

x = data.RasterXSize
y = data.RasterYSize
dim = data.RasterCount

Is there any way to find out that each band is actually representing what electromagnetic spectrum?

After reading all bands as a list in python like this:

RasterBands =[]
for i in range(data.RasterCount):    

I can write:


This will give me two float values, but I am not sure if they are representing the wavelengths of band 1 or not.

  • Link reports that it is to a Dangerous Site.
    – PolyGeo
    Dec 15, 2023 at 3:27

1 Answer 1


As @user30184 says, gdal is just reading the values of your raster band, but you should be able to know the wavenlenght of each band based on the metadata (information you should get about the data).

the two values returned by "ComputeBandStats()" will be the mean and standard deviation of the values in your bands. If the mean value is between zero and one, you can assume that your data stores the reflectance, otherwise the values are probably digit numbers.

Usually, hyperspectral data have a very large number of bands (several hundreds) with a constant sampling interval in the wavelengths (e.g. 6 nm), so if you know the value of the wavelength range (e.g. 400-900 nm), you can derive the central wavelength of each bands using a rule of 3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.