Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: regionmanager.fromtabletorecord - Function Up: regionmanager - Tool Previous: regionmanager.fromrecordtotable - Function


regionmanager.fromtabletoglobal - Function



Package general
Module images
Tool regionmanager


Restore a region from a Table to Glish


Synopsis
fromtabletoglobal(tablename, verbose, regionname)


Arguments

tablename in The table
    Allowed: Image tool, table tool or String
verbose in Report successful restores
    Allowed: T or F
    Default: T
regionname in Name of the region to restore
    Allowed: String


Returns
Region tool or fail



Description

This function restores a region from an AIPS++ Table to the global name space of Glish.

For the tablename argument, you can specify an image tool, a table tool, or a string. If you give a string, it should be the name of an existing AIPS++ table on disk (any kind of table).

You can use the function namesintable to find out the names of the regions in the Table.



Example
- im := image('hcn')
- names := drm.namesintable(im)
  for (i in 1:length(names)) {
+    cmd := spaste(names[i], ' := drm.fromtabletoglobal(im, regionname=\'', names[i], '\')')
+    print 'cmd=', cmd
+    eval(cmd)
+ }
cmd= x1 := drm.fromtabletoglobal(im, regionname='x1')
Successful restore of region x1
cmd= x2 := drm.fromtabletoglobal(im, regionname='x2')
Successful restore of region x2

We find out the names of the regions in the Table, and then restore them in a loop with the Glish command eval; it creates the region with the name given in the array names. Because the output region name is not known to the function fromtabletoglobal, it cannot prompt for confirmation if the symbol already exists in Glish. That's your job.





next up previous contents index
Next: regionmanager.fromtabletorecord - Function Up: regionmanager - Tool Previous: regionmanager.fromrecordtotable - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01