programme driven variable names [message #52602] |
Thu, 22 February 2007 06:19 |
Ingo von Borstel
Messages: 54 Registered: September 2006
|
Member |
|
|
Hi there,
I have a set of routines that act on similar sets of data. In order to
have these pre-processed data easily available for further analysis I
save the appropriate data structures in an IDL sav file for later
retrieval via the restore command.
Unfortunately, the variables saved will always bear the same name. This
is inconvenient, if I like to compare data from several of these data
sets, restored from several *.sav files.
Is there a way to rename variables during run-time without user interaction?
I have somthing along these lines in my mind:
PRO pre_process_data, datasetname
... ; do the pre-processing
; and save the pre-processed data
SAVE, filename=datasetname, datasetname_variable1,
datasetname_variable2, datasetname_variable3
END
And the following usage of restore on an IDL prompt:
IDL> pre_process_data, 'set1'
IDL> pre_process_data, 'set2'
...
IDL> reset
...
IDL>restore, 'set1.sav'
IDL>showvars
set1_var1
set1_var2
set1_var3
IDL>restore, 'set2.sav'
IDL>showvars
set1_var1
set1_var2
set1_var3
set2_var1
set2_var2
set2_var3
Best regards,
Ingo
--
Ingo von Borstel <newsgroups@planetmaker.de>
Public Key: http://www.planetmaker.de/ingo.asc
If you need an urgent reply, replace newsgroups by vgap.
|
|
|