STScI Logo

imcreate xray.ximages



imcreate -- create an IRAF image from input data or a constant


imcreate output_image output_dims output_datatype input_value input_datatype input_header


imcreate creates an IRAF image of size specified by the output_dims parameter and type specified by the output_datatype parameter. The value(s) of the pixels in the new image is determined by the input_value parameter. If the input value is a numeral, imcreate will create an image with that value as a constant.

If the input value is the name of an accessible file, imcreate will use the contents of that file as the values for the image. In this case, the user must be intimately aquainted with the structure of the input file. In particular, one must know the size of the header to be skipped, and the dimensionlity and data type of the data itself. These parameters are related to the file size as:

	input file size = ((dim1*dim2*...*dimn) *
		sizeof(input type)) + hsize * SZB_CHAR

where dim1, dim2, ... dimn are the dimensions of the output file as specified in the output_dims parameter, hsize is the header size in SPP chars as specfied in the input_headersize parameter, sizeof(input_type) is the size of the input type in SPP chars, and SZB_CHAR is a constant defined in <mach.h> equal to the number of machine bytes per SPP char. When a file is used as input, the data type of the input file is prompted for. It need not be the same data type as the output.


output_image = "" prompt = name of output image file

Name of the output image file to be created.

output_dims = "" prompt = dimensions in output image file

A string of the form "dim1 dim2 dim3 ... dimn" specifying the number of dimensions and length of each dimension of the output image. The maximum number of dimensions is currently 7.

output_datat = "r" prompt = data type of output image file

The data type of the output image. May be one of the following: silrdx.

input_value = "" prompt = name of input file or a pixel value

The name of a binary input file, or a pixel value when making a constant image.

input_datatype = "r" prompt = data type of input file

The data type of the binary input file. May be one of the following: silrdx.

input_headersize = prompt = size of header of input file in
					 SPP char

The size of the header of the input file in SPP chars. An SPP char is not necessarily (or usually) one machine byte in length. The number of machine bytes in an SPP char is given in <mach.h> in the define'd value SZB_CHAR. For example, on the Sun 3/60 the value of SZB_CHAR is 2.

(output_title = "") [string]

An image title to go into the image header.

(clobber = no) [string]

Boolean flag specifying whether or not the IRAF image file can be overwritten, if it already exists.


1. Create a 515 x 512 x 3 double image named foo with constant value 101.

ni> imcreate foo "512 512 3" d 101

2. Create a 9 x 4 int image named foo using a binary file foo.bin that contains 36 real*4 values, and a header 10 bytes long (assume 2 bytes per SPP char).

ni> imcreate foo "9 4" i foo.bin r 5


The time required depends on the speed of the IRAF IMIO.


It is not possible to skip a number of machine bytes in the header which is not a multiple of SZB_CHAR.

This task is very simple-minded. It attempts to provide a simple way to import arbitrary array data into IRAF. Becuase of this, the user must know quite a lot about the input file structure.


Source Code · Search Form · STSDAS