STScI Logo

mosproc irred



mosproc -- Prepare images for quick look mosaicing


mosproc input output nxsub nysub


The list of input images to be mosaiced. The images are assumed to be ordered either by row, column, or in a raster pattern. If the image list is not in order then the iraf files task plus the editor must be used to construct an image list. The images in the input list are assumed to all be the same size.
The name of the output mosaiced image.
The number of subrasters along a row of the output image.
The number of subrasters along a column of the output image.
skysubtract = yes
Subtract a sky image from all the input images. The sky image to be subtracted is either sky or a sky image computed by median filtering selected input images after weighting the images by the exposure time..
sky = ""
The name of the sky image.
exclude = ""
The input images to be excluded from the computation of the sky image. For example if exclude ="1,3-5" then input images 1, 3, 4, 5 are not used for computing the sky frame.
expname = "exptime"
The image header exposure time keyword. If the sky frame is computed internally by median filtering the input images, the individual images are weighted by the exposure time defined by the exposure time keyword expname . Weights of 1 are assigned when no exposure time is given.
flatten = yes
Divide all the images by a flat field image. Flat fielding is done after sky subtraction. If the name of a flat field image flat is supplied that image is divided directly into all the input images. Otherwise the skyframe computed above is normalized by the mode of the pixels and divided into all the input images.
flat = ""
The name of the flat field image.
transpose = no
Transpose the input images before inserting them into the mosaic.
trim_section = "[*,*]"
The section of the input images to be mosaiced into the output image. Section can be used to flip and/or trim the individual subrasters before adding them to the mosaic. For example if we want to flip each subraster around the y axis before adding it to the mosaic, then trim_section = "[*,-*]".
corner = "lr"
The starting position in the output image. The four options are "ll" for lower left corner, "lr" for lower right corner, "ul" for upper left corner and "ur" for upper right corner.
direction = "row"
Add input images to the output image in row or column order. The options are "row" for row order and "column" for column order. The direction specified must agree with the order of the input list.
raster = no
Add the columns or rows to the output image in a raster pattern or return to the start of a column or a row.
median_section = ""
Compute the median of each input image inserted into the mosaic using the specified section.
subtract = no
Subtract the computed median from each input image before inserting it into the mosaic.
oval = -1.0
The value of border pixels.
delete = yes
Delete sky subtracted, flat fielded and transposed images upon exit from the script.
logfile = STDOUT
The name of the log file.


MOSPROC takes the list of input images input of identical dimensions and inserts them into a single output image output . Before mosaicing the user can optionally sky subtract, flat field or transpose the input images. If skysubtract = yes, a single sky image is subtracted from all the input images. The sky image may be the externally derived image sky or calculated internally by computing the exposure time weighted median of the input images, minus those input images specifically excluded by the exclude parameter. If flatten = yes, the input images are flat fielded using either the externally defined flat field image flat or the internally derived sky image normalized by its mode. If transpose is enabled all the input images are optionally transposed before mosaicing.

MOSPROC takes the list of processed images and inserts them into the output image in positions determined by their order in the input list, nxsub , nysub and the parameters corner , direction and raster . The orientation and size of each individual subraster in the output image may be altered by setting the parameter trim_section . The size of the output image is determined by nxsub and nysub and the size of the individual input images. A one column wide border is drawn between each of the output image subrasters with a pixel value of oval . The user may optionally compute and subtract the median from each input image before inserting it into the mosaic.

MOSPROC produces an output mosaiced image output and an accompanying database file dboutput . These two files plus an interactively generated coordinate list comprise the necessary input for the IRALIGN, IRMATCH1D and IRMATCH2D tasks. The temporary images generated (sky substracted, flat fielded, and transposed) can be deleted automatically if delete=yes , before the task completes. Otherwise they will be left in the same directory of the input images. The temporary sky and flat field images if created are not deleted.

The computation of the sky frame is done with IMAGES.IMCOMBINE and the subsequent sky subraction with IMAGES.IMARITH. The computation of the flat field is done with PROTO.BSCALE and the flat field division with FLATTEN. The task IMAGES.TRANSPOSE transpose the input. The mosaicing itself is done with PROTO.IRMOSAIC.


1. Mosaic a list of 64 infrared images onto an 8 by 8 grid after sky subtraction and flat fielding. Use an externally derived sky and flat field image

ir> mosproc @imlist mosaic 8 8 skysub+ sky=skyimage flatten+ \ >>> flat=flatfield

2. Mosaic a list of 64 infrared images onto an 8 by 8 grid after sky subtraction and flat fielding. Derive the sky and flat field frames from the data excluding image number 5

ir> mosproc @imlist mosaic 8 8 skysub+ exclude="5" flatten+




images.imcombine, images.imarith, proto.bscale, images.imtrans, proto.irmosaic

Source Code · Search Form · STSDAS