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

Home » Public Forums » archive » Re: PV-WAVE/HDF/SDS
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: PV-WAVE/HDF/SDS [message #4630] Wed, 28 June 1995 00:00
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <DAvn1G.M76@news.dlr.de>, grueber@dv.kp.dlr.de (Wilhelm Grueber) writes:
> 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
> -------------------

This is not a problem with the SDS interface, it is an intrinsic problem in IDL
and PV-WAVE. When you pass a subset of an array (buffer(0:len,k) to a routine
you are actually passing an EXPRESSION, which is a COPY of that part of the
array. You cannot store back into the original array using this syntax. Your
workaround is the only way to do it.

I am surprised the copies are taking as long as you say. You might try the
syntax:
buffer(0, k) = tmpbuf

which should be equivalent to buffer(0:len, k)=tmpbuf, but may be faster.

____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Feature with PV-WAVE routine INVERT
Next Topic: PV-WAVE/HDF/SDS

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

Current Time: Wed Oct 08 18:07:01 PDT 2025

Total time taken to generate the page: 0.00599 seconds