It is hard to tell from your short description, but I assume that you are doing a wildcard FILE_SEARCH that returns the entire contents of a directory full of ENVI files, no? I presume also that the array of file paths consists solely of a set of ENVI image data files that have no extensions in their names and a set of corresponding header files that all have '.hdr' extension in their names. If that is so, then the algorithm you require is just one that programatically finds all the '.hdr' files and filters them out. Here is an example that demonstrates the algorithm:
IDL> files = ['envi_img', 'envi_img.hdr', 'another_envi_img', 'another_envi_img.hdr']
IDL> void = where(strmid(files, 3, 4, /REVERSE_OFFSET) eq '.hdr', $
IDL> COMPLEMENT=rawDataFileIndexes)
IDL> rawDataFiles = files[rawDataFileIndexes]
IDL> print, rawDataFiles
;envi_img another_envi_img
The "STRMID" function syntax above strips off the last 4 characters of all files returned by FILE_SEARCH, so that WHERE can find the indexes of the elements in the 'files' array, whose names finish with ".hdr". Is that not a solution for your problem?
James Jones
|