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 |
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:
|
|
|
The names of image bands. |
(required) |
The number of bands per image file. |
Lists the bad band multiplier values of each band in an image, typically 0 for bad bands and 1 for good bands. |
|
(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:
|
|
Lists class colors using RGB color definitions for classification files. For example, black is |
|
Lists class names for classification files. |
|
Defines the number of classes, including unclassified regions, for classification files. |
|
Percentage of cloud cover within the raster. |
|
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. |
|
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 |
|
When you save a georeferenced file to ENVI raster format, ENVI adds a A geographic coordinate system (for example, Geographic Lat/Lon) string contains the word 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 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. |
|
Gain values for each band. Units are W/(m2 * µm * sr). |
Pixel values that should be ignored in image processing. |
|
|
Offset values for each band. |
|
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) |
|
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) |
(required) |
The type of data representation:
|
|
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. |
|
The type of stretch to use when ENVI displays the image. The choices are as follows:
|
|
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. |
|
Path and filename of a DEM associated with the image. |
A string describing the image or the processing performed. |
|
(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. |
|
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. |
|
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. |
(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. |
(required) |
Refers to whether the data interleave is BSQ, BIL, or BIP. |
(required) |
The number of lines per image for each band. |
|
Lists geographic information in the following order:
|
|
Indicates x and y pixel size in meters for non-georeferenced files. |
|
If you defined a custom projection in ENVI Classic, this field contains that map information. A |
|
The names of spatial and spectral read routines used in ENVI Classic custom file readers. |
|
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. |
|
Lists Rational Polynomial Coefficient (RPC) geolocation information for files that have RPC reference information instead of a standard map projection. |
(required) |
The number of samples (pixels) per image line for each band. |
|
A string with security information inherited from formats that typically contain security classification levels (such as NITF). |
|
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. |
|
Top of the atmosphere solar irradiance per band. Units are W/(m2 * µm). |
|
A comma-separated list of spectra names enclosed in {curly brackets}; for spectral library files only. |
|
Angle of the sun (in degrees) from due north in a clockwise direction. |
|
Angle of the sun (in degrees) above the horizon. |
|
The timestamp names of temporal cube bands. |
Lists the center wavelength values of each band in an image. Units should be the same as those used for the |
|
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 |
|
|
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 Changing these values does not affect the way ENVI reads the image data from the file. |
|
The number of pixels in the x and y directions to average for Z plots. |
|
The default minimum and maximum values for Z plots. |
|
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)