comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Using ASSOC function
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Using ASSOC function [message #12131 is a reply to message #12130] Thu, 02 July 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Bernard Puc (puc@gsfc.nasa.gov) writes:

> Using ASSOC, I can access an image array stored in a datafile. Is it
> possible to instead select a subimage of that array? I'm looking to
> optimize the file access speed by not having to read the entire file or
> array into a variable. Thanks in advance.

If you are asking if you can do this:

file = FilePath(SubDir=['examples', 'data'], 'cereb.dat')
OpenR, lun, file, /Get_Lun
images = Assoc(lun, BytArr(512, 512))
thisPartImage = (images(0))[0:255,256:512]
Help, thisPartImage
TV, thisPartImage

Then the answer, amazingly enough, is yes.

I can't quite believe this, because I would have thought
it mattered how the data was laid out in the file (i.e,
in row order) as to whether you get what you think you
are going to get, but apparently it doesn't. I've tried
all kinds of subscripts. They all work.

Don't you just LOVE IDL! :-)

Cheers,

David

P.S. As to whether this is faster or not, I can't tell.
This is image is read so fast on my 400 MHz machine I
can't separate the time meaningfully from zero.

--
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Determining machine endian-ness
Next Topic: Re: Polynomial warping of satellite images

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 14:48:05 PDT 2025

Total time taken to generate the page: 1.43859 seconds