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

Home » Public Forums » archive » idl: turn string value into variable name part2
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
idl: turn string value into variable name part2 [message #86010] Tue, 24 September 2013 01:10 Go to next message
zimttee.xperia is currently offline  zimttee.xperia
Messages: 2
Registered: September 2013
Junior Member
Hi,

i'm new to IDL and have a problem, similar to that discussed here: https://groups.google.com/forum/#!topic/comp.lang.idl-pvwave /WZ2RAMWK-0o
But i could not solve my problem and the topic is very old, so i thought it's better to start a new one?!

I have arrays with 1032 columns and (usually, but the number of rows can vary, depending on my number of scans i measure) 720 rows, which I want to cut into (1032,80)-arrays and name the new arrays as "data1","data2",..."datan". I need them as seperated variables for a second procedure.
I've tried some possibilities yesterdays and searched with google, but i was not able to solve that problem. Maybe i was looking for the wrong keywords, i don't know... I also tried that "execute" they talked about in the discussion i've mentioned before. I copied the code and changed the variables name, but i couldn't make it work...

I hope someone can help me :-)

Ramona
Re: idl: turn string value into variable name part2 [message #86012 is a reply to message #86010] Tue, 24 September 2013 02:39 Go to previous messageGo to next message
Moritz Fischer is currently offline  Moritz Fischer
Messages: 32
Registered: June 2013
Member
Hi,
I think you are looking for "scope_varfetch". Something like this:

FOR i=0,n-1 DO (scope_varfetch('data'+strtrim(i,2),/ENTER)) =
array[*,i*80 : (i+1)*80 - 1]

But I recommend you try stacking the data in a third dimension:

array = reform( array, 1032, 80, n )

It's less error-prone, and you may be able to avoid loops.
Do it the IDL way! (http://www.idlcoyote.com/idl_way/idl_way.php)

cheers

Am 24.09.2013 10:10, schrieb zimttee.xperia@googlemail.com:
> Hi,
>
> i'm new to IDL and have a problem, similar to that discussed here:
> https://groups.google.com/forum/#!topic/comp.lang.idl-pvwave /WZ2RAMWK-0o
>
> But i could not solve my problem and the topic is very old, so i thought
it's better to start a new one?!
>
> I have arrays with 1032 columns and (usually, but the number of rows
> can vary, depending on my number of scans i measure) 720 rows, which
> I want to cut into (1032,80)-arrays and name the new arrays as
> "data1","data2",..."datan". I need them as seperated variables for a
> second procedure. I've tried some possibilities yesterdays and
> searched with google, but i was not able to solve that problem. Maybe
> i was looking for the wrong keywords, i don't know... I also tried
> that "execute" they talked about in the discussion i've mentioned
> before. I copied the code and changed the variables name, but i
> couldn't make it work...
>
> I hope someone can help me :-)
>
> Ramona
>
Re: idl: turn string value into variable name part2 [message #86013 is a reply to message #86010] Tue, 24 September 2013 05:13 Go to previous message
zimttee.xperia is currently offline  zimttee.xperia
Messages: 2
Registered: September 2013
Junior Member
Thank you, this helped a lot!
I already tried the scope_varfetch command, bu i think I used it in a wrong way...
Now it works! Thanks thanks thanks :-)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Adding elements in an Array
Next Topic: logical_true vs nothing in an if statment

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

Current Time: Wed Oct 08 11:44:23 PDT 2025

Total time taken to generate the page: 0.00654 seconds