|
|||
NRAO Home > CASA > CASA Toolkit Reference Manual |
|
regionmanager.tofile - Function
1.1.2 Create a region record file that can be read by from filetorecord.
Description
This function is to store a region created by the regionmanager in a disk file
for future use
Arguments
Inputs |
| ||
filename |
| List of files containing the Image Regions
| |
| allowed: | string |
|
| Default: | File name(s) |
|
region |
| region record/dict to store in the file
| |
| allowed: | record |
|
| Default: |
|
|
bool
Example
- img = ia.open(’hcn’)
- imcs=ia.coordsys()
- blc = [’16:28:25.50’, ’+040.49.05.61’]
- trc = [’16:24:28.67’, ’+041.45.28.43’]
- r1 = rg.wbox(blc=blc,trc=trc,pixelaxes=[0,1],csys=imcs.torecord())
- rg.tofile(’myboxregion’, r1)
- r1readback=rg.fromfiletorecord(’myboxregion’)
In this example we create a box region using world coordinates for blc and trc. We save that on disk in a file called {\tt ’myboxregion’}.
Then we read it back using the function rg.fromfiletorecord and store it in a variable {\tt r1readback}. {\tt r1} and {\tt r1readback} should be
identical.
__________________________________________________________________
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