PV-WAVE/HDF/SDS [message #4631] |
Wed, 28 June 1995 00:00 |
grueber
Messages: 3 Registered: June 1995
|
Junior Member |
|
|
I want to read a one dimensional array of a scientific data set (SDS)
from a HDF file via the function SDreaddate into a two dimensional array
(respective into a subarry of buffer array).
For example:
-------------------------
length = 3000000L
number = 12L
buffer = intarr(length,number)
k = 2
...
status = SDreaddata(sdsid,[0],[1],[len],buffer(0:len,k))
------------------------ ^^^^^^^^^^^^^
This example doesn`t work, despite it's possible to address subarrays
in this manner (array(from:to)) in PV-Wave. Status doesn't indicate
an error! I work around it in this way:
------------------
tmpbuf = intarr(len)
...
status = SDreaddata(sdsid,[0],[1],[len],tmpbuf)
buffer(0:len,k) = tmpbuf
-------------------
But the disadvantage of this work around is the unacceptable
waste of time for the additional copy operation.
Reading 4 MB via SDreaddata lasts about 2 seconds, but copying
the buffer lasts about 10 seconds !!??!!
(This tests were made on a Sparc 20 with enough memory and fast
hard disks)
Does anybody have a solution or a more efficient work around for this
problem?
Thanks for help in advance
Wilhelm Gr"uber
|
|
|