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

Home » Public Forums » archive » Re: array chicanery
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: array chicanery [message #28052 is a reply to message #28051] Thu, 15 November 2001 16:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rochelle Hatton (nrh@imag.wsahs.nsw.gov.au) writes:

> I've experienced some wierd business with arrays, and I'm hoping somebody can explain.
> I have been using the IDL function PCOMP, calculating the pricipal components of some data.
> If I feed in a float array to the function,
> eg.
> result=PCOMP(data,coefficients=eigenvectors,eigenvalues=eige nvalues,/covariance,/standardize)
>
> I get a result, but when I redisplay the data array, it has changed. Since PCOMP only returns
> a result, what is it doing to my original array, and why? There are no common variables, as far
> as I know, so the original data should not change. I apologise in advance if this is blindingly
> obvious, and of course, I can just make a copy of the original data into another variable to use
> later, I am just curious as to what is going on.
> Any thoughts?

Lousy programming. On someone's part other than yours. :-)

Try this:

IDL> result=PCOMP(data+0,coefficients=eigenvectors,$
eigenvalues=eigenvalues,/covariance,/standardize)
IDL> Help, data

Does that help?

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TV and T3D?
Next Topic: re-warping an image file

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

Current Time: Wed Dec 03 01:49:15 PST 2025

Total time taken to generate the page: 1.04568 seconds