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

Home » Public Forums » archive » Re: Speed penalty using START and COUNT with HDF_SD_GETDATA
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: Speed penalty using START and COUNT with HDF_SD_GETDATA [message #26494] Wed, 05 September 2001 17:29 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
From: "Bob Fugate" <rqfugate@mindspring.com>


> I don't have any control over how the data are written or stored. How can
I
> do what you suggest? I am doing something like the following now (assumes
> there are 8000 frames in the SDS):
>
> hdf_sd_getdata,arrayid,data,start=[46,43,0],count=[32,32,800 0]
>
> where the first two numbers are the indices where I want to start
extracting
> the data from the 128x128 array and 32 is the size of the extracted array.
> The above is much slower than
>
> hdf_sd_getdata,arrayid,data
>
> or even
>
> hdf_sd_getdata,arrayid,data,start=[0,0,0],count=[128,128,800 0]

One strategy you might consider is

data = fltarr(32,32,8000)
for i=0,7999 do begin
hdf_sd_getdata,arrayid, frame, start=[0,0,i], count=[128,128,1]
data[*,*,i] = frame[46:77,43:74,0]
endfor

The motivation for this is that reading data along the final dimension is
slow in any case (for reasons explained by Reimar) so the loop won't hurt
you too much. By reading a full frame of data on each step you are reading
contiguous data, which is fast. And by looping you avoid having to store
large amounts of unneeded data.

But test it for yourself!

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research




--
Posted from clam.niwa.cri.nz [202.36.29.1]
via Mailgate.ORG Server - http://www.Mailgate.ORG
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: MPEG_SAVE
Next Topic: Re: cmyk colorcoded postscript file

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

Current Time: Thu Oct 09 14:22:40 PDT 2025

Total time taken to generate the page: 0.83252 seconds