This task builds a band-stacked raster (also called a metaspectral raster), which is a stack of ENVIRasters with the same dimensions. A common use is to include bands from different rasters.
- The input rasters must have the same number of rows and columns.
- The input rasters do not need to be georeferenced, but you can georeference the resulting metaspectral raster using the SPATIALREF keyword.
- The input rasters can be of different interleave types, but the resulting metaspectral raster will be BSQ.
- The input rasters can be of different data types, but the resulting metaspectral raster will be cast to the highest data type out of all the rasters.
- See Working with Metaspectral Datasets in the ENVI API for guidelines on using Landsat and ASTER imagery.
This task is different than the LayerStack task, where the input rasters can have different numbers of rows and columns.
The virtual raster associated with this task is ENVIMetaspectralRaster.
This example creates one raster that consists of Band 2 from a 1985 Landsat TM image and Band 2 from a 2005 TM image. Both images have the same number of rows and columns; they are also in the same coordinate system and have the same pixel size (30 m).
The example uses sample images that are available from our ENVI Tutorials web page. Click the Landsat Case Studies link to download the .zip file to your machine, then unzip the files. Update the file location with your own directory.
e = ENVI()
File1 = 'LasVegasMay1985.dat'
Raster1 = e.OpenRaster(File1)
File2 = 'LasVegasMay2005.dat'
Raster2 = e.OpenRaster(File2)
RedRaster1 = ENVISubsetRaster(Raster1, BANDS=2)
RedRaster2 = ENVISubsetRaster(Raster2, BANDS=2)
Task = ENVITask('BuildBandStack')
Task.INPUT_RASTERS = [RedRaster1, RedRaster2]
View = e.GetView()
Layer1 = View.CreateLayer(Task.OUTPUT_RASTER)
Layer2 = View.CreateLayer(Task.OUTPUT_RASTER, BANDS=)
View.Animate, 2.0, /FLICKER
Result = ENVITask('BuildBandStack')
Input properties (Set, Get): INPUT_RASTERS, OUTPUT_RASTER_URI, SPATIAL_REFERENCE
Output properties (Get only): OUTPUT_RASTER
Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.
This task inherits the following methods from ENVITask:
This task inherits the following properties from ENVITask:
This task also contains the following properties:
Specify an array of ENVIRasters from which to build a band-stacked raster.
This is a reference to the output raster of filetype ENVI.
Specify a string with the fully qualified filename and path to export the associated OUTPUT_RASTER.
- If you set this property to an asterisk symbol (*), the output raster will be virtual and not written to disk.
- If you do not specify this property, or set it to an exclamation symbol (!), a temporary file will be created.
Set this parameter to an ENVIStandardRasterSpatialRef, ENVIPseudoRasterSpatialRef, or ENVIRPCRasterSpatialRef object to be used by OUTPUT_RASTER. If this is not specified, then the first valid SPATIALREF property found in the INPUT_RASTERS array will be used.
OUTPUT_RASTER_URI now supports '*', which allows OUTPUT_RASTER to be virtual output.
ENVITask, ENVIMetaspectralRaster, RegridRaster Task, ENVISubsetRaster