[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strange memory problem
In article <firstname.lastname@example.org>, Peter Mason <email@example.com> writes:
>firstname.lastname@example.org (R. Kyle Justice) wrote:
>> Actually I should have given my real problem rather than a
>> simplified version of it. Acutally I have two big arrays of
>> equal size and I am trying to copy one into the other:
>The best way I know of to do this sort of thing (in IDL) is to use
>array-insertion starting offsets.
>e.g., If you have 2-dimensional arrays and you want to copy one on top
>of another, do: TEMP1(0,0)=TEMP2.
>This is much, *much* more efficient than using '*'. It also converts
>what it copies to the datatype of TEMP1 if necessary.
>This issue goes back a long way, so I'd expect the "solution" to work
>on PV-Wave as well.
This is definitely the best way to do this. Note that you don't need both
subscripts. You can just say:
a = bytarr(100,100,25)+10b ; Create array of all 10's
b = bytarr(100,100,25) ; Create a zero filled array
b(0) = a ; This copies a into b