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 
Return to the default flat view Create a new topic Submit Reply
Re: Reading multiple ASCII files in as 2d arrays and putting them into a 3d array [message #65210 is a reply to message #65209] Sun, 15 February 2009 10:39 Go to previous message
polystethylene is currently offline  polystethylene
Messages: 28
Registered: February 2009
Junior Member
On Feb 15, 6:27 pm, David Fanning <n...@dfanning.com> wrote:
> 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.")

Hi David,

Thanks for the swift response!

I've just tried that, and it fails with the message:

% Attempt to subscript DATA with I is out of range.

a quick print of framearray and data reveal that 'framearray' contains
the values of the 125th file, but 'data' is full of zeros.

Not quite sure what it's complaint means...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Creating a composite image, avoid fill data values
Next Topic: Re: another IDL oddity

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

Current Time: Thu Oct 09 11:03:37 PDT 2025

Total time taken to generate the page: 1.35396 seconds