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

Home » Public Forums » archive » Re: Reading a table of data quickly
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 a table of data quickly [message #34290 is a reply to message #34146] Sat, 01 March 2003 10:54 Go to previous message
grunes is currently offline  grunes
Messages: 68
Registered: September 1993
Member
> doesn't it require
>
> data = dblarr(numberOfColumns, numberOfRows)?
>
> i.e. isn't the "column" the index that would vary the fastest (just
> like in ASCII files)?

This addresses one of the most obvious flaws of IDL and PV-WAVE.

Mathematically, the first subscript index is always the row, the
second is the col.

But IDL and PV-WAVE treat it the other way around for the PRINT,
PRINTF and TV statements. I suspect this has to do with storage
order: IDL took its order from languages like FORTRAN, where the first
index increments fastest with storage location (i.e., matrix elements
with the same second index are stored contiguously).

(Let us leave out more than 2D arrays for this discussion.)

The early IDL documentation documented this quite well. They
basically said the "real" representation was (row,col), but the print,
printf and TV statements got it transposed. So, for example, "#", not
"##" was standard matrix multiplication. (TV is a little more
complicated, since by default !order, it goes bottom up rather than
top down.)

This got more complicated with later versions. PV-WAVE added PM
(print matrix?) which fixed the problem for print.

IDL documentation is now quite mixed, last I checked (i.e., IDL 5.4 or
so). Some of it views colomns as along the first dimension, some as
along the second dimension. Sometimes the only way to figure things
out is to try them. Sometimes they try to explain this as "col-order"
vs "row-order" storage order, but that actually explains nothing; it
is a seperate issue altogether.

This is the sort of thing that sometimes makes me just want to sit
down and design my own language. I might do it if I ever get the time
to understand how to do graphics under windows and X. (Perhaps based
on APL? The presence of empty arrays simplifies program logic so
much.) RSI and VNI ought to keep both the language and the
documentation upwards compatible, but they don't.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: WTB: Used documentation for IDL, PV-WAVE.
Next Topic: Re: Random spherical distributions

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

Current Time: Sat Oct 11 08:58:16 PDT 2025

Total time taken to generate the page: 0.64756 seconds