|
|||
NRAO Home > CASA > CASA Toolkit Reference Manual |
|
image.adddegaxes - Function
1.1.1 Add degenerate axes of the specified type to the image
Description
This method adds degenerate axes (i.e. axes of length 1) of the specified type.
Sometimes this can be useful although you will generally need to modify the
coordinate system of the added axis to give it the coordinate you want (do this
with the Coordsys tool). This method supports both float and complex
valued images.
You specify which type of axes you want to add. You can’t add an axis type that already exists in the image. For the Stokes axis, the allowed value (a string such as I, Q, XX, RR) can be found in the Coordsys newcoordsys function documentation.
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 the 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 generated Image tool (with the done function) this temporary image is deleted.
Arguments
Inputs |
| ||
outfile |
| Output image file name. Default is unset.
| |
| allowed: | string |
|
| Default: |
| |
direction |
| Add direction axes?
| |
| allowed: | bool | |
| Default: | false |
|
spectral |
| Add spectral axis?
| |
| allowed: | bool | |
| Default: | false |
|
stokes |
| Add Stokes axis? Default is empty string.
| |
| allowed: | string |
|
| Default: |
|
|
linear |
| Add linear axis?
| |
| allowed: | bool |
|
| Default: | false |
|
tabular |
| Add tabular axis?
| |
| allowed: | bool |
|
| Default: | false |
|
overwrite |
| Overwrite (unprompted) pre-existing output file?
| |
| allowed: | bool |
|
| Default: | false |
|
silent |
| Skip silently existing axes?
| |
| allowed: | bool |
|
| Default: | false |
|
image
Example
"""
#
print "\t----\t adddegaxes Ex 1 \t----"
ia.maketestimage()
print ia.shape()
#[113L, 76L]
mycs=ia.coordsys()
print mycs.axiscoordinatetypes()
#[’Direction’, ’Direction’]
mycs.done()
im2 = ia.adddegaxes(spectral=T)
print im2.shape()
#[113L, 76L, 1L]
mycs=im2.coordsys()
print mycs.axiscoordinatetypes()
[’Direction’, ’Direction’, ’Spectral’]
mycs.done()
im3 = im2.adddegaxes(stokes=’Q’)
print im3.shape()
#[113L, 76L, 1L, 1L]
mycs = im3.coordsys()
print mycs.axiscoordinatetypes()
#[’Direction’, ’Direction’, ’Spectral’, ’Stokes’]
mycs.done()
im2.done()
im3.done()
ia.close()
#
"""
In this example, all the images are virtual (temporary images).
__________________________________________________________________
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