Below is an example of ENVI batch code that does not start the ENVI GUI. Hope it helps.
PRO CLASSIC_WRITE_FILE
COMPILE_OPT IDL2
; Start ENVI Classic
ENVI, /RESTORE_BASE_SAVE_FILES
ENVI_BATCH_INIT
; Open file
file = FILEPATH('qb_boulder_msi', ROOT_DIR=ENVI_GET_PATH(), $
SUBDIR=['..','data'])
ENVI_OPEN_FILE, file, R_FID = fid
ENVI_FILE_QUERY, fid, DIMS = dims
; Retrieve the first band of the data
data = ENVI_GET_DATA(FID = fid, DIMS = dims, pos = 0)
help,data
END
|