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

Home » Public Forums » archive » Re: Referencing various variables through string( )?
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: Referencing various variables through string( )? [message #47797] Tue, 07 March 2006 09:31
Daelomin is currently offline  Daelomin
Messages: 7
Registered: March 2006
Junior Member
It doesn't work for me when I assign that column to a new array
(say

tmp=fltarr(NPoints)
tmp=tcwv[4,*]

)...

I had used 'reform' in 2001, I had just totally forgotten it ever
existed :D
Thanks David, you rule.
Re: Referencing various variables through string( )? [message #47799 is a reply to message #47797] Tue, 07 March 2006 09:18 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
> Daelomin writes:
>
>
>> The reason why I didnt store values in a bigger array
>> (tcwv=fltarr(7,NPoints) for example) is that when I assign a column to
>> a variable, I always get a variable of size (1,Npoints) instead of
>> Npoints... There must be a function to drop the "useless" reference to
>> a 1D array in 2 variables, I just dont know it...
>
>
> col = Reform(tcwv[4,*])

Alternatively you can construct your monster array like so:

tcwv=fltarr(NPoints,7)

and let IDL do the (usually) superflous dimension removal for you (much to the
consternation of some c.l.i-p readers I believe).

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Re: Referencing various variables through string( )? [message #47801 is a reply to message #47799] Tue, 07 March 2006 09:01 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Daelomin writes:

> The reason why I didnt store values in a bigger array
> (tcwv=fltarr(7,NPoints) for example) is that when I assign a column to
> a variable, I always get a variable of size (1,Npoints) instead of
> Npoints... There must be a function to drop the "useless" reference to
> a 1D array in 2 variables, I just dont know it...

col = Reform(tcwv[4,*])

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Referencing various variables through string( )?
Next Topic: create string of fixed length

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

Current Time: Wed Oct 08 17:42:39 PDT 2025

Total time taken to generate the page: 0.00404 seconds