Hi All,
I am having an issue when using congrid on a 3 band bsq image file, where the output from the congrid is still 3 bands, the values for all the bands are only from the 1st band.
What I am trying to do is replicate the ENVI (I have v4.8) resize function programmatically in IDL (v8.01), which I have tested with this same bsq file and works correctly, but am getting the error as mentioned with congrid.
My process in IDL is that I am reading 3 separate ascii files (corresponding to the 3 bands) into an array (3x 7000pix by 7000pix, so the array is 7000x21000), then saving the array as a bsq file with ENVI_WRITE_ENVI_FILE.
Next, I am then performing the congrid on the array and then saving the resized array in another bsq file.
My code example is:
red_data = READ_ASCII(redfile, DATA_START = 6, DELIMETER = string (' '), COUNT = nl)
rnd_data = [red_data.(0)]
mir_data = READ_ASCII(mirfile, DATA_START = 6, DELIMETER = string (' '))
rnd_data = [[rnd_data], [mir_data.(0)]]
tir_data = READ_ASCII(tirfile, DATA_START = 6, DELIMETER = string (' '))
rnd_data = [[rnd_data], [tir_data.(0)]]
ENVI_WRITE_ENVI_FILE, rnd_data, BNAMES = ['Red', 'MIR', 'TIR'], FILE_TYPE = 0, INTERLEAVE = 0, NB = 3, NS = ns, NL = nl, OUT_DT = 4, OUT_NAME = ofname
res_file = CONGRID(rnd_data, 175, 175, /INTERP)
ENVI_WRITE_ENVI_FILE, res_file, BNAMES = ['Red', 'MIR', 'TIR'], FILE_TYPE = 0, INTERLEAVE = 0, NB = 3, NS = nrs, NL = nrl, OUT_DT = 4, OUT_NAME = ofrname
As mentioned, the output creates a 3 band bsq file, but with all the values from the 1st band of the array. I cannot see where I am going wrong with my code and would very much appreciate if you could point out where the code is incorrect.
Alternatively, if there is a better way of performing the operation, I would much appreciate advice (the read ascii steps each take 4 minutes, so the whole routine is lengthy and I would like to speed it up a bit).
Many thanks in advance
Simon
|