X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 12 Jun 2017 03:25 PM by  jareds1
Writing ENVI Raster from ENVI Task
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

jareds1



New Member


Posts:29
New Member


--
10 Jun 2017 02:39 PM
    Hi all,

    I'm trying to write a foreach loop to convert all bands in an existing ENVI Raster into output PNGs. When I run the following loop:

    "foreach i, bandGet do begin
    Subset = ENVISubsetRaster(raster, bands=[i])

    print, (baseName + bNames[i])

    ; Creating the PNG routine from ENVI Docs

    Task = ENVITask('ExportRasterToPNG')

    Task.INPUT_RASTER = Subset

    Task.OUTPUT_RASTER_URI = (baseName + bNames[i])

    Task.Execute

    Task.output_raster = outName
    end"

    I get the exact filenames I want printed, but no files are written. I also get a message saying "This task has no parameter named OUTPUT_RASTER_URI" - is that a feature introduced in a newer version of ENVI?

    Any pointers to get this working in ENVI 5/2/IDL 8.4 would be greatly appreciated!

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    12 Jun 2017 09:23 AM
    According to the ENVI 5.2 help, the syntax for output is a little different than in newer versions. It looks like it uses "output_URI" :

    Task.OUTPUT_URI = e.GetTemporaryFilename('png')

    jareds1



    New Member


    Posts:29
    New Member


    --
    12 Jun 2017 03:25 PM
    Replacing Task.OUTPUT_RASTER_URI with Task.OUTPUT_URI and deleting the Task.output_raster achieved the exact results I wanted. Thanks!
    You are not authorized to post a reply.