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

Home » Public Forums » archive » Re: Converting v[3,N] to vx[N], vy[N], vz[N] without additionalmemory
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: Converting v[3,N] to vx[N], vy[N], vz[N] without additionalmemory [message #19883] Tue, 02 May 2000 00:00
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
Ricardo Fonseca wrote:
>
> Hi everyone
>
> I need to transform an array v[3,Nx,Ny,Nz] to three arrays vx[Nx,Ny,Nz],
> vy[Nx,Ny,Nz], vz[Nx,Ny,Nz] for use with the interpolate function. The simple
> way to do it is
>
> vx = reform(v[0,*,*,*])
>
> and so on, and then freeing the memory used by v. But the problem is v is a
> very large (>180 Mb) array so the additional memory needed to do this
> becomes a problem. Is there another way of doing this, that doesn't require
> additional memory?

Trace it upstream to the creation of v, and, if you can, modify it to be in 3
separate cubes instead of a single hypercube. If you'd like to keep it all neat
and avoid having separate variables carried around, make v[3] a list of 3
pointers to heap data containing each cube. Then *v[0],*v[1],*v[2] yield the
three. Be sure to free the pointers when necessary to avoid a major memory
leak. It's possible you don't have control of how v is created, but this is the
most straightforward route.

JD

--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: gaussfit
Next Topic: Re: Converting v[3,N] to vx[N], vy[N], vz[N] without additional memory

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

Current Time: Fri Oct 10 03:08:48 PDT 2025

Total time taken to generate the page: 1.44122 seconds