X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 13 Sep 2017 12:58 PM by  MariM
Management of ALLOW_MULTIPLE
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

allendej



New Member


Posts:2
New Member


--
11 Sep 2017 05:09 AM
    Apologies for the basic question, I am new to the ENVI API.

    I would like to import multiple rasters using SelectInputData(/ALLOW_MULTIPLE).

    If I have something like this:

    Flats = UI.SelectInputData(/RASTER, /ALLOW_MULTIPLE, /TITLE 'Select Frames lowest to highest')

    Is it necessary to then do:
    L9 = e.OpenRaster(Flats[0])
    L8 = e.OpenRaster(Flats[1])
    L7 = e.OpenRaster(Flats[2])

    Because the input to OpenRaster needs to be a scalar string, which the Flats[0]... etc is not. Are the rasters considered 'open' once they are stored in the Flats array?

    Thanks.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    13 Sep 2017 12:58 PM
    Using SelectInputData requires user interaction to select the data sets in the opened dialog. You can use the dialog to open files from the icon on the bottom of the dialog that is opened but it has not 'selected' the data until the user manually selects them. For example, when I enter the following:

    ENVI> UI = e.UI
    ENVI> rasters = UI.SelectInputData(/RASTER, /allow_multiple)

    Brings up the File Selection dialog. I can open files on disk from here and then I can then choose the 'Select All' button to select all of the data sets open in the dialog. However if I only open files on disk and do not select (highlight) any of the files shown in the dialog, it will not return any rasters. So I choose the 'select all' button or manually select open files and then it returns the array of rasters selected:

    ENVI> help, rasters
    RASTERS OBJREF = Array[2]
    You are not authorized to post a reply.