X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 10 Aug 2018 11:36 AM by  MariM
use Convert Interleave through API
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

jia xue



New Member


Posts:
New Member


--
10 Aug 2018 08:13 AM
    I try use "Convert Interleave" tool to convert an ENVI file from BSQ to BIL format, it works fine. But when I try to convert it with ENVI API, it doesn't work, the output is still BSQ, can you help me check? below is my code, thanks. Also you have any tutorial for FLAASH API?

    PRO BSQ_BIL
    ; COMPILE_OPT IDL2

    ; Start the application
    e = ENVI(/HEADLESS)

    ; Select input files
    dirs = ['/media/satellite_imagery/WV3/calibration']
    filter = '*_cal'
    files = file_search(dirs, filter)
    FOREACH file, files DO BEGIN
    PRINT, file
    Raster = e.OpenRaster(file)
    in = '/media/satellite_imagery/WV3/calibration/'
    out = '/media/satellite_imagery/WV3/BIL/'
    outpath = file.Replace(in,out)
    Raster.Export, outpath, 'ENVI', INTERLEAVE=bil
    ENDFOREACH
    e.Close
    END

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    10 Aug 2018 11:36 AM
    The interleave keyword should be in single quotes here because it is a string:

    Raster.Export, outpath, 'ENVI', INTERLEAVE='bil'

    If it is not, this keyword will be ignored and the original interleave will be retained.
    You are not authorized to post a reply.