STScI Logo

imreplicate xray.ximages



imreplicate -- expand the 1st two dimensions of an N-dimensional IRAF image by replication.


imreplicate image outimage rfactor


IMREPLICATE expands an IRAF image by replicating each pixel n (an integer) times. The image is replicated spatially in the first 2 dimensions. The task first runs over the image and is then optionally repeated for an associated error image.

If an image of dimension (128,128,3) is replicated by a factor of 2, then the output image is of dimension (256,256,3) and the total number of counts in the image increases by a factor of 4. The value of each pixel in the 2-d portion of the input image is now saved in consecutive 2x2 boxes in the output image.


image = prompt = Input Image name

Name of the input image file to be read.

outimage = prompt = Output Image name

Name of the output image file to be created.

rfactor = prompt = Replication Factor (a pos. integer)

The factor by which the image will be expanded.

(error = "NONE") [string]

Name of the input error image file to be read. An input of NONE will skip the error file.

(outerror = "NONE") [string]

Name of the output error image to be created. This must be set if the above error image name is not "NONE".

(clobber = no) [boolean]

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


1. Imreplicate a qpoe file and error image by 2.

        xi> imreplicate error="i6757_err.imh" outerror="efoo"
	Input Image name: i6757.qp
	Output Image name: foo
	Replication Factor (1:): 2
	Replicating Image i6757.qp by factor of 2
	Writing to output file foo.imh
	Replicating Error i6757_err.imh by factor of 2
	Writing to output file efoo

Outputs an image and error file made by replicating each pixel into a 2x2 area in the output file.

2. Imreplicate a 128x128x3 image by 4.

        xi> imreplicate
	Input Image name: foo
	Output Image name: goo
	Replication Factor (1:): 4
	Replicating Image foo by factor of 4
	Writing to output file goo.imh

Outputs 512x512x3 image with each pixel in the 2-d portion of foo replicated into a 4x4 area in goo.





See also the IRAF task help magnify for a more sophisticated option.

Source Code · Search Form · STSDAS