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 #65207 is a reply to message #65206] Sun, 15 February 2009 11:44 Go to previous messageGo to previous message
polystethylene is currently offline  polystethylene
Messages: 28
Registered: February 2009
Junior Member
On Feb 15, 7:35 pm, polystethylene <polystethyl...@hotmail.com> wrote:
> On Feb 15, 7:05 pm, David Fanning <n...@dfanning.com> wrote:
>
>
>
>> polystethylene writes:
>>> 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...
>
>> Whoops! Didn't notice your loop variables before.
>> IDL is a zero indexed language. You loops will
>> have to go from 0 to n-1, not from 1 to n.
>
>> I think this might be what the error is about.
>> I think I=125 is out of bounds of your last array
>> dimension, which should go from 0 to 124.
>
>> 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.")
>
> Ah yes of course. I know that as well, that's just me being stupid.
> Actually, looking at it, I know why I set the loop from 1 to 125: I
> make use of the loop index to open each file.
>
> If I change the loop counter to 0,124, it tries to open file 000.dump,
> which doesn't exist. Is there anyway to specify i+1 in my second line?
>
> Thanks David

Nevermind, i was stupidly trying to put the +1 on the format specifier
(getting mixed up between i for integer and i the index)

Thanks for all your help David, it appears to be working now.

p.s. When's the 3rd edition of your book due, is it imminent enough
that I should hold out on buying the 2nd edition?
[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: Wed Oct 08 18:15:08 PDT 2025

Total time taken to generate the page: 0.00499 seconds