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

Home » Public Forums » archive » Re: Reading multiple ASCII files in as 2d arrays and putting them into a 3d array
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: Reading multiple ASCII files in as 2d arrays and putting them into a 3d array [message #65211] Sun, 15 February 2009 10:27
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
polystethylene writes:

> I've tried two approaches. First of all, I've tried reading each file
> into the array 'framearray', and then subsequently (within the loop)
> placing the 2-d array (framearray) into the 3-d array (data), with
> something like this:
>
> data[*,*,i] = framearray
>
> but this complains that array is the wrong size. (I assume its
> possible to put a smaller array into a larger array without IDL
> complaining - I figured it would fill the rest of the space with
> zeros?).

Well, sorta. :-)

The * indicates a data range, (eg, 0:sizeOfX-1). Your
data is, occasionally, smaller than that. And the array
on the left hand size will have to equal the size of the
array on the right hand side, or IDL will complain like
this.

There is a trick, though. If you specified only the
*first* value of the data range, IDL will try to fit
your array into the larger "space" on the left hand side.
Try this:

data[0,0,I] = framearray

I think there is a good chance you will get away with that. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Reading multiple ASCII files in as 2d arrays and putting them into a 3d array
Next Topic: majority voting

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

Current Time: Wed Oct 08 15:48:25 PDT 2025

Total time taken to generate the page: 0.00550 seconds