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


next up previous contents index
Next: imagemaketestimage - Constructor Up: image - Tool Previous: imagefromimage - Constructor


imagefromshape - Constructor



Package general
Module images
Tool image


Construct an empty AIPS++ image from a shape


Synopsis
imagefromshape(outfile, shape, csys, linear, overwrite, log)


Arguments

outfile in Name of output image file
    Default: unset
shape in Shape of image
csys in Coordinate System
    Allowed: Coordsys tool
    Default: unset
linear in Make a linear Coordinate System if csys not given ?
    Allowed: T or F
    Default: F
overwrite in Overwrite (unprompted) pre-existing output file ?
    Allowed: T or F
    Default: F
log in Write image creation messages to logger
    Allowed: T or F
    Default: T


Returns
Image tool


Description

This constructor creates an AIPS++ image file with the specified shape. All the pixel values in the image are set to 0.

If outfile is given, the image is written to the specified disk file. If outfile is unset, the Image tool is associated with a temporary image. This temporary image may be in memory or on disk, depending on its size. When you destroy the Image tool (with the done function) this temporary image is deleted.

The Coordinate System, provided as a Coordsys tool, 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, 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 (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.



Example
- im := imagefromshape('test.data', [64,64,128])
- cs := im.coordsys(axes=[1,3])
- im2 := imagefromshape(shape=[10, 20], csys=cs)

The first example creates a zero-filled image file named test.data of shape [256,512]. If you examine the header with im.summary() you will see the RA/DEC/Spectral coordinate information. In the second example, a Coordinate System describing the first and third axes of the image test.data is created and used to create a 2D temporary image.





next up previous contents index
Next: imagemaketestimage - Constructor Up: image - Tool Previous: imagefromimage - Constructor   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