Metadata

class hsi.HSIHeader(shape, interleave, dtype, description=None, default_bands=None, capture=None, byte_order=Ellipsis, wavelength_info=None, data_offset=None, measurement_info=None, **py_kwargs)

Header information.

The header type contains a union of the metadata supported by the different HSI file formats. PAM files ignore certain entries, while ENVI and the custom yaml format support the full set of keys.

Parameters:
  • shape (Shape)

  • interleave (Interleave)

  • dtype (DType)

  • description (str)

  • default_bands (list[int] | None) – Rgb bands to use for creating a fake color image

  • byte_order (Endianness)

  • wavelengths (list[WavelengthMeta] | None)

  • None (int |) – data_offset

extra()
Returns:

Dictionary of extra metadata.

Return type:

dict[str, Any]

n_planes()

Get the number of planes in the image, i.e. the dimension of the outer axis. Depends on the interleave.

plane_shape()

Get the natural plane shape, i.e. the shape of the two innermost dimensions of the interleave shape.

byte_order

Data byte-ordering.

data_offset

Get optional data offset (used for binary files with embedded headers).

Getter:

Type:

int | None

default_bands

Bands indexes used for displaying false color images.

Getter:

Get current bands

Type:

list[int] | None

description

Description. An arbitrary string that describes the image.

Getter:

Type:

String | None

dtype

Image data type.

Type:

DType

interleave

Image interleave mode.

Type:

Interleave

measurement_info

Image data type.

Type:

DType

shape

Image shape.

Type:

Shape

wavelength_info

Information about data wavelengths.

Getter:

Type:

WavelengthMeta | None

class hsi.Interleave

Data interleave mode.

Defines the memory layout of the file. To achieve good performance, as suitable interleave mode should be used for a given application.

  • BSQ: The full image for each spectral band is stored consecutively in memory. This format is

    effective for spatial access.

  • BIP: All spectral bands for each pixel is stored consecutively, followed by a line of pixels.

    This format is effective for spectral access.

  • BIL: Each line of pixels is stored consecutively for each band. This format achieves improved

    spatial access along the width of the image while retaining good performance for spectral access as well.

A good default for images is the BIL format which is balanced between spatial and spectral access.

axis_num(axis)
BIL = BIL
BIP = BIP
BSQ = BSQ
class hsi.WavelengthMeta(band_data, unit)

Data wavelength information.

Describes the wavelength for each band in the represented data. All units supported by the ENVI format are supported.

band_data

Value for each band.

unit

Unit of each wavelength.

class hsi.WavelengthUnit

Wavelength units.

Angstroms = WavelengthUnit.Angstroms
Centimeter = WavelengthUnit.Centimeter
GHz = WavelengthUnit.GHz
Index = WavelengthUnit.Index
MHz = WavelengthUnit.MHz
Meter = WavelengthUnit.Meter
Micrometer = WavelengthUnit.Micrometer
Millimeter = WavelengthUnit.Millimeter
Nanometer = WavelengthUnit.Nanometer
Unknown = WavelengthUnit.Unknown
WaveNumber = WavelengthUnit.WaveNumber
class hsi.Endianness

Specifies the byte-ordering of multi-byte types in files.

Big = Endianness.Big
Little = Endianness.Little