Re: Pb to work with huge files [message #34620] |
Thu, 10 April 2003 09:56  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Pavel Romashkin (pavel_romashkin@hotmail.com) writes:
> Slow, isn't it? Couldn't one load like 1/3 of it into ram, process it
> and write back? I am no expert with assoc.
Slow!? With Associated variables you don't read *anything*
into memory until you actually use it. Note only is it
fast, it is about as efficient as it is possible to get!
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
Re: Pb to work with huge files [message #34625 is a reply to message #34622] |
Thu, 10 April 2003 06:09   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
St�phane writes:
> I have a huge multiband file (i.e. 4800*2200*150) and I would like to
> perform a procedure that could write a file with the same dimensions:
> 1. openr: to open the input file
> 2. assoc: to extrac some images on which I would like to work
> 3. replace extracted images in the same place
> 4. write the output file
> My problem is that I can't create a 4800*2200*150 "integer array",
> because I haven't enought memory.
>
> Is there another way to write file like that?
Why don't you just open the file for Updating (OPENU).
Then you could just perform the file manipulation
in place and close the file with the new information
built right into it.
OPENU, lun, filename, /Get_Lun
data = Assoc(lun, INTARR(4800,2200))
image = data(55)
newImage = Hist_Equal(image)
data(55) = newImage
Free_lun, lun
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Pb to work with huge files [message #34759 is a reply to message #34620] |
Thu, 10 April 2003 14:21  |
Pavel Romashkin
Messages: 166 Registered: April 1999
|
Senior Member |
|
|
David Fanning wrote:
>
> Slow!? With Associated variables you don't read *anything*
> into memory until you actually use it. Note only is it
> fast, it is about as efficient as it is possible to get!
I thought seek is one of the slowest hardware functions of hard drives.
Continuous read is much faster, although with cache it may be
insignificant. I thought if you wanted to do a lot of random HD access
then seeking would slow things down.
I may be wrong! And indeed this is purely theoretical argument.
Pavel
|
|
|