Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | images | |
Tool | image |
outfile | in | Output image file name | |
Allowed: | String | ||
Default: | unset | ||
infile | in | Input ascii disk file name | |
Allowed: | String | ||
shape | in | Shape of image | |
Allowed: | Vector of integers | ||
sep | in | Separator in ascii file | |
Allowed: | String | ||
Default: | ' ' | ||
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 |
This constructor is used to convert an ascii disk file to an AIPS++ image file. 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.
You must specify the shape of the image. The image must be stored in the ascii file, one row at a time. This row must be of the correct length and there must be the correct number of rows. For example, let us say the shape of your image is [nx,ny,nz] = [3,4,2], then the image should be stored as
1 1 1 # row 1; y = 1, z = 1 2 2 2 # row 2; y = 2, z = 1 3 3 3 # row 3; y = 3, z = 1 4 4 4 # row 4; y = 4, z = 1 1.5 1.5 1.5 # row 5; y = 1, z = 2 2.5 2.5 2.5 # row 6; y = 2, z = 2 3.5 3.5 3.5 # row 7; y = 3, z = 2 4.5 4.5 4.5 # row 8; y = 4, z = 2
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 (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.
- im := imagefromascii('myimage.app', 'myimage.ascii', shape=[128,128])