X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 24 May 2016 08:05 PM by  anon
Creating Array with Raster Band Names in ENVI 5
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:29
New Member


--
24 May 2016 08:05 PM
    Hi all, One task that has eluded me for the last few days is how to create a string array of band names (['Elevation','Shaded Relief','Roughness']) from a raster image after it has been opened in ENVI. Is there a built-in procedure, or do I need to code around something? Thanks for any tips, Jared

    Deleted User



    New Member


    Posts:29
    New Member


    --
    31 May 2016 06:47 PM
    A fresh look into the problem revealed: ENVI> Raster = e.OpenRaster(inFile) % Loaded DLM: NATIVE. ENVI> fid = ENVIRasterToFID(Raster) ENVI> envi_file_query, fid, bnames=tellme ENVI> print, tellme Mean: Elevation - Minimum Mean: Absolute Roughness Mean: Local Roughness Mean: Slope (degrees) Mean: Point Density Variance: Elevation - Minimum Variance: Absolute Roughness Variance: Local Roughness Variance: Slope (degrees) Variance: Point Density Homogeneity: Elevation - Minimum Homogeneity: Absolute Roughness Homogeneity: Local Roughness Homogeneity: Slope (degrees) Homogeneity: Point Density Contrast: Elevation - Minimum Contrast: Absolute Roughness Contrast: Local Roughness Contrast: Slope (degrees) Contrast: Point Density ENVI> does the trick.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    01 Jun 2016 11:27 AM
    If you are trying to access the band names, it is part of the metadata for the raster. For example: ENVI> file = 'C:\TEMP\qb_boulder_msi.dat' ENVI> raster = e.openraster(file) ENVI> print, raster.metadata ENVIRASTERMETADATA BAND NAMES = 'Band 1', 'Band 2', 'Band 3', 'Band 4' DATA GAIN VALUES = 0.30000000, 0.20000000, 0.50000000, 0.40000000 DATA OFFSET VALUES = 0.00000000, 0.00000000, 0.00000000, 0.00000000 DESCRIPTION = 'Demo QuickBird 2 data courtesy DigitalGlobe', 'Inc. Not for commercial use.' SENSOR TYPE = 'QuickBird' WAVELENGTH = 485.00000, 560.00000, 660.00000, 830.00000 WAVELENGTH UNITS = 'Nanometers' ENVI> bnames=raster.metadata["band names"] ENVI> print, bnames Band 1 Band 2 Band 3 Band 4 ENVI> help, bnames BNAMES STRING = Array[4]
    You are not authorized to post a reply.