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

Home » Public Forums » archive » Problem with array concatenation
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
Problem with array concatenation [message #8616] Tue, 25 March 1997 00:00
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Hello,

I'm using IDL4.0.1 and I'm having a problem with array concatenation
that defies any explanation on my part. Here goes....

I'm using the following to code to read in binary data (in a weird
format) :

LOOP over n_panels....

rad = fltarr( panel_header.n_pts, /nozero )
tau = fltarr( panel_header.n_pts, /nozero )

readu, lbl_file_lun, rad
readu, lbl_file_lun, tau

tmp = [ [ temporary( rad ) ], [ temporary( tau ) ] ]
if n_panels eq 0 then begin
lbl_spc = temporary( tmp )
endif else begin
lbl_spc = [ temporary( lbl_spc ), temporary( tmp ) ]
endelse


What I want to end up with, in array lbl_spc, is data in the form
[N, 2] where a total of N points was read in and lbl_spc(*,0) references
all the "rad" data read in and lbl_spc(*,1) references all the "tau"
data read in. Typically, panel_header.n_pts is LE 2400 but the total
number of data points read in after looping a bzillion times can be >
5e+06.

Anyway, for the data I'm reading, when I exit my procedure I can get the
following:

IDL> help, lbl_spc
LBL_SPC FLOAT = Array(4152834, 2)

which is fine and dandy....right? Well why does this happen:

IDL> help, lbl_spc(*,0)
help, lbl_spc(*,0)
^
% Syntax error.

And...even more bizarre, I get this:

IDL> help, lbl_spc(0,0)
<Expression> STRING = ''

What gives? My float array suddenly is composed of STRINGS??? The same
occurs when I use help on any SINGLE element of the array. Any more than
one element returns a syntax error.

I can retrieve the data if I assign the array to another variable name
and then everything behaves as it should. Is the method of 2-dimensional
array concatenation that I'm using a brain-dead way of doing it? BTW, it
doesn't matter whether I concatenate it as [N,2] or[2,N].

Any help/info/comments/suggestions appreciated.

thanks,

Paul van Delst
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Hex to decimal???
Next Topic: precisely specifying size of MAP

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

Current Time: Wed Oct 08 19:25:26 PDT 2025

Total time taken to generate the page: 0.00468 seconds