ENVI Header Files

The ENVI header file contains metadata for ENVI-format images. ENVI creates a new header file whenever you save an image to ENVI raster format. The header file uses the same name as the image file, with the file extension .hdr.

Use the Metadata Viewer to view the metadata for ENVI-format images and other supported data types. Use the Edit Raster Metadata dialog to edit the metadata fields of ENVI-format images.

See the following sections:

The ENVI Header Format

The following table lists header fields in alphabetical order. See Example for an example header file.

Field

Description

acquisition time

Data acquisition time string that conforms to the ISO-8601 standard. The string can be in any of the following formats:

YYYY-MM-DD

YYYY-MM-DDTHH:MM:SS.DZ

YYYY-MM-DDTHH:MM:SS:Dooo:mm

Where:

  • YYYY is the four-digit year
  • MM is the two-digit month
  • DD is the two-digit day
  • T separates the date and time
  • HH is the two-digit hour
  • MM is the two-digit minute
  • SS is the two-digit second
  • D is the decimal fraction of a second with up to double-precision
  • Z indicates that the time is in Coordinate Universal Time (UTC)
  • ooo is a two-digit offset in hours from UTC time. If the offset is negative, a minus symbol (-) precedes the value.
  • mm is an optional partial-hour offset (in minutes) from UTC time.

band names

The names of image bands.

bands

(required)

The number of bands per image file.

bbl

Lists the bad band multiplier values of each band in an image, typically 0 for bad bands and 1 for good bands.

byte order

(required)

The order of the bytes in integer, long integer, 64-bit integer, unsigned 64-bit integer, floating point, double precision, and complex data types. Use one of the following:

  • Byte order=0 (Host (Intel) in the Header Info dialog) is least significant byte first (LSF) data (DEC and MS-DOS systems).
  • Byte order=1 (Network (IEEE) in the Header Info dialog) is most significant byte first (MSF) data (all other platforms).

class lookup

Lists class colors using RGB color definitions for classification files. For example, black is 0,0,0.

class names

Lists class names for classification files.

classes

Defines the number of classes, including unclassified regions, for classification files.

cloud cover

Percentage of cloud cover within the raster.

color table

Default color table to use when ENVI displays the image. This is stored as an array of 768 numbers of type byte, representing the 3 by 256 color table to use.

complex function

Specifies the values to calculate from a complex image and to use when displaying the image, calculating statistics for the image, or writing the image to a new file. Values include Real, Imaginary, Power, Magnitude, and Phase. The default value is Power.

coordinate system string

When you save a georeferenced file to ENVI raster format, ENVI adds a coordinate system string field to the header file. It lists the parameters used for a geographic or projected coordinate system. Following are some examples:

A geographic coordinate system (for example, Geographic Lat/Lon) string contains the word GEOGCS and lists the coordinate system name, datum, spheroid, prime meridian, and units:

coordinate system string = 
GEOGCS["GCS_WGS_1984",
DATUM["D_WGS_1984",
SPHEROID["WGS_1984",6378137.0,298.257223563]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]]

A projected coordinate system string contains the word PROJCS and lists all of the geographic coordinate system parameters, plus detailed parameters that describe the projected coordinate system:

coordinate system string = 
PROJCS["WGS_1984_South_Georgia_Lambert",
GEOGCS["GCS_WGS_1984",
DATUM["D_WGS_1984",
SPHEROID["WGS_1984",6378137.0,298.257223563]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],
PROJECTION["Lambert_Conformal_Conic"],
PARAMETER["False_Easting",0.0],
PARAMETER["False_Northing",0.0],
PARAMETER["Central_Meridian",-37.0],
PARAMETER["Standard_Parallel_1",-54.0],
PARAMETER["Standard_Parallel_2",-54.75],
PARAMETER["Latitude_Of_Origin",-55.0],
UNIT["Meter",1.0]]

See Coordinate System Strings and Codes for more information.

data gain values

Gain values for each band. Units are W/(m2 * µm * sr).

data ignore value

Pixel values that should be ignored in image processing.

data offset values

Offset values for each band.

data reflectance gain values

An array of reflectance gain values.

With Landsat-8 files, the reflectance gains have been scaled by the sine of the sun elevation, as follows:

data reflectance gain values = REFLECTANCE_MULT_BAND_1/sin(sun elevation)

data reflectance offset values

An array of reflectance offset values. With Landsat-8 files, the reflectance offsets have been scaled by the sine of the sun elevation, as follows:

data reflectance offset values = REFLECTANCE_ADD_BAND_1/sin(sun elevation)

data type

(required)

The type of data representation:

  • 1 = Byte: 8-bit unsigned integer
  • 2 = Integer: 16-bit signed integer
  • 3 = Long: 32-bit signed integer
  • 4 = Floating-point: 32-bit single-precision
  • 5 = Double-precision: 64-bit double-precision floating-point
  • 6 = Complex: Real-imaginary pair of single-precision floating-point
  • 9 = Double-precision complex: Real-imaginary pair of double precision floating-point
  • 12 = Unsigned integer: 16-bit
  • 13 = Unsigned long integer: 32-bit
  • 14 = 64-bit long integer (signed)
  • 15 = 64-bit unsigned long integer (unsigned)

default bands

Indicates which band numbers to automatically load into the Data Manager Greyscale or R, G, and B fields every time the file is opened. By default, a new image is automatically loaded when a file that has default bands defined in its header is opened. If only one band number is used, then ENVI loads a greyscale image.

default stretch

The type of stretch to use when ENVI displays the image. The choices are as follows:

  • bipolar
  • equalization: You can optionally enter a minimum and maximum pixel value to use in the stretch. For multi-band images, these values will apply to all of the bands. You cannot set individual minimum/maximum values for each band. Here is an example: equalization 0 200.
  • Gaussian: Optionally enter the standard deviation to use; for example: 0.3 Gaussian. You can optionally enter a minimum and maximum pixel value to use in the stretch. For multi-band images, these values will apply to all of the bands. You cannot set individual minimum/maximum values for each band. Here is an example: 0.3 Gaussian 0 1000.
  • linear: Optionally specify the percentage of the data to clip; for example: 5.0 linear. Or, enter the minimum and maximum pixel values to use in the stretch; for example: 0 200 linear.
  • logarithmic: You can optionally enter a minimum and maximum pixel value to use in the stretch. For multi-band images, these values will apply to all of the bands. You cannot set individual minimum/maximum values for each band. Here is an example: logarithmic 0 1000.
  • optimized linear
  • square root: Optionally enter the square root factor to use; for example: 0.5 square root. You can optionally enter a minimum and maximum pixel value to use in the stretch. For multi-band images, these values will apply to all of the bands. You cannot set individual minimum/maximum values for each band. Here is an example: 0.5 square root 0 200.

dem band

Index (starting at 1) of a selected DEM band associated with the image. The dem band is not written if the DEM file contains a single band, or if the first band of an image was chosen. In these cases, the dem band value defaults to 0.

dem file

Path and filename of a DEM associated with the image.

description

A string describing the image or the processing performed.

file type

(required)

The ENVI-defined file type, such as a certain data format and processing result. The string must exactly match an entry in the File Type drop-down list in the Edit ENVI Header dialog.

fwhm

Lists full-width-half-maximum (FWHM) values of each band in an image. Units should be the same as those used for wavelength and set in the wavelength units parameter.

geo points

Geographic corners for non-georeferenced files. Enter one to four locations. Each location must contain the following items, in this order:

pixel_x_coordinate, pixel_y_coordinate, latitude, longitude

For example:

geo points = {
1.0000, 1.0000, 32.89380137, -117.07201460,
1002.0000, 1.0000, 32.87364744, -116.95855862,
1.0000, 1002.0000, 32.80628336, -117.09960891,
1002.0000, 1002.0000, 32.78615422, -116.98625969}

Pixel coordinates [1,1] correspond to the top-left corner of the image.

header offset

(required)

The number of bytes of embedded header information present in the file. ENVI skips these bytes when reading the file. The default value is 0 bytes.

interleave

(required)

Refers to whether the data interleave is BSQ, BIL, or BIP.

lines

(required)

The number of lines per image for each band.

map info

Lists geographic information in the following order:

  • Projection name
  • Reference (tie point) pixel x location (in file coordinates)
  • Reference (tie point) pixel y location (in file coordinates)
  • Pixel easting
  • Pixel northing
  • x pixel size
  • y pixel size
  • Projection zone (UTM only)
  • North or South (UTM only)
  • Datum
  • Units

pixel size

Indicates x and y pixel size in meters for non-georeferenced files.

projection info

If you defined a custom projection in ENVI Classic, this field contains that map information. A projection info line is added to the ENVI header file if the image uses a user-defined projection instead of a standard projection defined in the file map_proj.txt file of the ENVI distribution. If the header file contains a coordinate system string field, any existing projection info line information is ignored.

read procedures

The names of spatial and spectral read routines used in ENVI Classic custom file readers.

reflectance scale factor

The value that, when divided into your data, would scale it from 0-1 reflectance. For example, if the value of 10,000 in your data represents a reflectance value of 1.0, enter a reflectance scale factor of 10,000.

rpc info

Lists Rational Polynomial Coefficient (RPC) geolocation information for files that have RPC reference information instead of a standard map projection.

samples

(required)

The number of samples (pixels) per image line for each band.

security tag

A string with security information inherited from formats that typically contain security classification levels (such as NITF).

sensor type

Instrument types, such as Landsat TM, SPOT, RADARSAT, and so on. The string must exactly match an entry in the Sensor Type drop-down list in the Edit ENVI Header dialog.

solar irradiance

Top of the atmosphere solar irradiance per band. Units are W/(m2 * µm).

spectra names

A comma-separated list of spectra names enclosed in {curly brackets}; for spectral library files only.

sun azimuth

Angle of the sun (in degrees) from due north in a clockwise direction.

sun elevation

Angle of the sun (in degrees) above the horizon.

timestamp

The timestamp names of temporal cube bands.

wavelength

Lists the center wavelength values of each band in an image. Units should be the same as those used for the fwhm field and set in the wavelength units parameter.

wavelength units

Text string indicating the wavelength units. ENVI accepts the following strings:

Micrometers

um

Nanometers

nm

Millimeters

mm

Centimeters

cm

Meters

m

Wavenumber

Angstroms

GHz

MHz

Index

Unknown

x start


y start

Defines the image coordinates for the upper-left pixel in the image. Images that are spatial subsets of larger images often use an image coordinate system that references the parent (or larger) image so that you can link and dynamically overlay the two images. The default values for the upper-left pixel are (0,0).

The reference (tie point) pixels in the map info header field are one-based.

Changing these values does not affect the way ENVI reads the image data from the file.

z plot average

The number of pixels in the x and y directions to average for Z plots.

z plot range

The default minimum and maximum values for Z plots.

z plot titles

The x and y axis titles for Z plots.

Example

The following is a typical ENVI header file. Not all available fields are listed:

ENVI
description = {
  Registration Result. Method1st degree Polynomial w/ nearest neighbor [Wed Dec 20 23:59:19 1995] }
samples = 709
lines   = 946
bands   = 7
header offset = 0
file type = ENVI Standard
data type = 1
interleave = bsq
sensor type = Landsat TM
byte order = 0
map info = {UTM, 1, 1, 295380.000, 4763640.000, 30.000000, 30.000000, 13, North}
z plot range = {0.00, 255.00}
z plot titles = {Wavelength, Reflectance}
pixel size = {30.000000, 30.000000}
default stretch = 5.0% linear
band names = {
 Warp (Band 1:rs_tm.img), Warp (Band 2:rs_tm.img), Warp (Band 3:rs_tm.img), Warp (Band 4:rs_tm.img), Warp (Band 5:rs_tm.img), Warp (Band 6:rs_tm.img), Warp (Band 7:rs_tm.img)}
wavelength = {
  0.485000,  0.560000,  0.660000,  0.830000,  1.650000, 11.400000,  2.215000}
fwhm = {
 0.070000, 0.080000, 0.060000, 0.140000, 0.200000, 2.100000, 0.270000}

Classification files include the following additional keywords:

classes = 4
class lookup = {  0,  0,  0,255,  0,  0,  0,255,  0,255,255,  0}
class names = {
  Unclassified,
  region 1,
  region 2,
  region 3}

Spectral library files include the following additional keywords:

spectra names = {
ACTINOLITE IN-4A, ALBITE TS-6A, ALMANDINE GARNET NS-4A, ALUNITE SO-4A,
AMBLYGONITE P-3A, ANALCIME TS-18A, ANATASE SYNTHETIC O-12A,
ANDESINE TS-4A, ANGLESITE SO-10A, ANHYDRITE SO-1A, ANORTHITE TS-5A,
ANTHOPHYLLITE IN-8A, ANTLERITE SO-11A, APATITE P-1A, APHTHITALITE SO-9A}

You can create an ENVI header file using a text editor. The file must start with the text string ENVI for ENVI to recognize it as a native file header. Keywords within the file indicate critical file information.

You can add comments to the file by inserting a line with a semicolon as the first character. ENVI ignores these lines when parsing the header file. Comments begin with a semicolon and must be on their own line. Comments can appear anywhere within a header file except within keyword/value brackets:

band names = {

  Band1

  Band2

  ; comment

  Band 3

}

See Also

Optional ENVI Header Fields, View File Metadata, Edit Raster Metadata, Supported Data Types, ENVIRasterMetadata (API), ENVIRaster::WriteMetadata (API)