# Wavelength Information¶

If wavelength information is defined for each band of a raster image, the EnMAP-Box can use it to easily select pre-defined band combinations or to better compare spectral profiles of sensors with different number of bands.

The wavelength information needs to be defined similar to the ENVI metadata standard:

1. wavelength units defines the metric unit of the wavelength, e.g. nm, mu, cm,..
2. wavelength defines the band values in wavelength units, e.g. 450 nm.
3. fwhm defines the full width at half maximum in wavelength units

Wavelength information can be inspected with the Tools -> Metadata Viewer

In the QGIS python shell, wavelength information can be read as followed:

from enmapbox.gui.utils import parseWavelength, parseFWHM
source = 'path to raster file / QgsRasterLayer / GDAL DataSource'
wavelength, wavelength_unit = parseWavelength(source)
fwhm = parseFWHM(source)
print(wavelength)
print(wavelength_unit)
print(fwhm)


from osgeo import gdal
path = r'path to image'
dataset: gdal.DataSet = gdal.Open(path)


Wavelength information can be set in the same way:

from osgeo import gdal
path = r'path to image'
dataset: gdal.DataSet = gdal.Open(path)