Sarah Douglas
2015-01-26 14:05:25 UTC
Hi,
I am quite new to IDL so this might be just a basic problem which I am overlooking.
I am trying to write a .dat file of an image which can be read in ENVI. I am able to write the array to the file but then when I open it in ENVI, I get an image with vertical stripes in every other pixel. However, if i re-read the file into IDL, I do not see these stripes.
I believe this could be to do with how ENVI reads .dat files or how the data is written to the file. Here is some example code,
nrows = 382L
ncols = 38L
num_bd = 102
test_arr = uintarr(nrows, num_bd, ncols)
for i=0,num_bd-1 do test_arr(*,i,*) = i+1
FILENAME = '/home/sarah/Data/Upscaled_pre_SVD/'+ 'test.dat'
openw, 1, filename
writeu, 1, test_arr
close, 1
result = 0
result = uintarr(nrows, num_bd, ncols)
openr, 1, filename
readu, 1, result
close, 1
I am quite new to IDL so this might be just a basic problem which I am overlooking.
I am trying to write a .dat file of an image which can be read in ENVI. I am able to write the array to the file but then when I open it in ENVI, I get an image with vertical stripes in every other pixel. However, if i re-read the file into IDL, I do not see these stripes.
I believe this could be to do with how ENVI reads .dat files or how the data is written to the file. Here is some example code,
nrows = 382L
ncols = 38L
num_bd = 102
test_arr = uintarr(nrows, num_bd, ncols)
for i=0,num_bd-1 do test_arr(*,i,*) = i+1
FILENAME = '/home/sarah/Data/Upscaled_pre_SVD/'+ 'test.dat'
openw, 1, filename
writeu, 1, test_arr
close, 1
result = 0
result = uintarr(nrows, num_bd, ncols)
openr, 1, filename
readu, 1, result
close, 1