NRAO Home > CASA > CASA Toolkit Reference Manual
regionmanager.fromfiletorecord - Function

1.1.2 Create a region record(s) from a file(s).


Description

This function reads files containing ImageRegion objects and turns them into Region Records.

The intended use for this method is to read the file saved by the casa viewer and turn the files contents into regions that are usabla by the image analysis tool.

Arguments





Inputs

filename

List of files containing the Image Regions

allowed:

string

Default:

File name(s)

verbose

Report successful saves

allowed:

bool

Default:

true

true

regionname

Name(s) of the region(s) when saved in the table

allowed:

string

Default:

Self naming

Returns
record

Example

 
 
- img = ia.open(’hcn’)  
- rg.fromfiletorecord(T, "x1 x2", "file1, file2", r1, r2)  
- ia.statistics( region=r1, verbose=True )  
- ia.statistics( region=r2, verbose=True )  
 
 
In this example, we create two regions called  {\stf r1} and {\stf r2}  
from the files ???  
The regions are renamed to ‘x1’ and ‘x2’ as they are stored.  
 

Example

 
e  
- img = ia.open(’hcn’)  
- r1 = rg.box()f  
- r2 = rg.quarter()  
- rg.fromglobaltotable(img, T, F, "", r1, r2)  
- rg.namesintable(img)  
x1 x2  
 
 
In this example, we save two regions called {\stf r1} and {\stf r2} to  
the table (previously containing no regions) referred to by the image  
tool {\stf im}.  The names for regions are made up for us as we don’t  
specify them.  Note that because the regions are specified by the  
special \glish\ ‘...’ argument (it has no actual argument name), we  
must give the {\stfaf regionname} argument explcitly as an empty vector  
of strings (else \glish\ will take the empty string as a region).  
 

__________________________________________________________________


More information about CASA may be found at the CASA web page

Copyright © 2016 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search