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

Home » Public Forums » archive » Re: Array assignment problems
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: Array assignment problems [message #13635] Sat, 21 November 1998 00:00
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
In article <7355qm$nqo$1@nnrp1.dejanews.com> seanr@possys.com writes:

> IDL> displayImage[i,0,0] = BytScl(reform(image[i,*,*]), Max=maxThresh,
[..]
> IDL> displayImage[0,0,i] = BytScl(reform(image[*,*,i]), Max=maxThresh,
Min=minThresh)

> why does the first (displayimage[i,0,0]) not work, but the second does?

Remove the reform() statement in the first one, and it works.
Apparently, IDL tries to match up existing dimensions starting from
the leftmost. So, the fact that you've lost the *last* dimension
(as in the last example) doesn't matter, but it does matter if you
loose the first one, since the one moving up is way too big!

> If I enter it as displayimage[i,*,*] =... then it works, but this is a much
> slower assignment.

This syntax matches up elements by their one-dimensional index. I.e.,
displayimage[i,*,*] (on the left hand side) uniquely identifies (and
indeed generates!) a series (vector) of one-dimensional indices, which
are used to store each of the (ordered) element on the right hand
side, regardless of their dimensional organization (i.e., it could be
a 7-dimensional array with the same numer of elements). The giveaway
is that this works:

IDL> displayimage[i,*,*]=(image(i,*,*))(*)

Regards,

Stein Vidar
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Reading FileMaker Pro files?
Next Topic: Array assignment problems

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

Current Time: Wed Oct 08 19:14:39 PDT 2025

Total time taken to generate the page: 0.00509 seconds