[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: VARRAY, memory & extracting subarrays
You've probably thought about this, but it appears that your images
array is a stack of images (a 3-D array) - if you can get away with
processing a single image at a time, or extracting a subsection of
each image in succession, you can always use the ASSOC command to
set up an associated variable. This is very handy when you are working
with a huge number of individual images. For example, let's say
you had 20 images of size 500 x 600:
images = fltarr(500,600,20)
and you wanted to make a sub=array of (100:300, 200:400, 11:14) of
this hunk. You could do:
openr,lun,/GET_LUN,image_file
image=ASSOC(fltarr(500,600))
sub_array=fltarr(201,201,4)
for i=11,14 do begin
sub_array[0,0,i]=(image[i])[100:300,200:400]
endfor
THis way, you never need to have the entire large image cube in
memory at a given time.
I do this all the time for sequences of astronomical images which
are stored in time order in an image cube. For your application, it
may or may not be a time-saver.
Hope this helps,
Dick French