![]()
|
|||
|
|
|||
| NRAO Home > CASA > CasaRef |
|
||
1.1.1 Construct a CASA image from an array
Description
This function converts an array of any size into a CASA image file.
If outfile is given, the image is written to the specified disk file. If outfile is unset, the on-the-fly Image tool returned by this function is associated with a temporary image. This temporary image may be in memory or on disk, depending on its size. When you destroy the on-the-fly Image tool (with the done function) this temporary image is deleted.
At present, no matter what type the pixels array is, a real-valued image will be written (the input pixels will be converted to Float). In the future, Complex images will be supported.
The Coordinate System, provided as a record describing a Coordsys tool (via coordsys.torecord(), for instance) is optional. If you provide it, it must be dimensionally consistent with the pixels array you give (see also coordsys).
If you don’t provide the Coordinate System (unset), a default Coordinate System is made for you. If linear=F (the default) then it is a standard RA/DEC/Stokes/Spectral Coordinate System depending exactly upon the shape of the pixels array (Stokes axis must be no longer than 4 pixels and you may find the spectral axis coming out before the Stokes axis if say, shape=[64,64,32,4]). Extra dimensions are given linear coordinates. If linear=T then you get a linear Coordinate System.
Arguments
| Inputs |
| ||
| outfile |
| Output image file name. Default is unset.
| |
| allowed: | string |
|
| Default: |
| |
| pixels |
| A numeric array is required.
| |
| allowed: | any |
|
| Default: | variant | |
| csys |
| Coordinate System. Default is unset.
| |
| allowed: | any |
|
| Default: | record |
|
| linear |
| Make a linear Coordinate System if csys not given
| |
| allowed: | bool |
|
| Default: | false |
|
| overwrite |
| Overwrite (unprompted) pre-existing output file?
| |
| allowed: | bool |
|
| Default: | false |
|
| log |
| Write image creation messages to logger
| |
| allowed: | bool |
|
| Default: | true |
|
Example
The first example creates a zero-filled image file named test.data which is of shape [64,64,4,128]. If you examine the header with ia.summary() you will see the default RA/DEC/Stokes/Frequency coordinate information. In the second example, a Coordinate System describing the first two axes of the image test.data is created and used to create a 2D image temporary image.
Please send any comments or questions about CASA or AIPS++ to aips2-requests@nrao.edu
Copyright © 2008 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
Updated daily during alpha development.