| text2mask | proto | text2mask |
text2mask -- convert text description to pixel mask
text2mask text mask ncols nlines
A text file describing individual pixels or rectangular regions is converted to a pixel mask image in pixel list format. The name of the text file, the name of the pixel mask to be created, and the dimensions of the pixel mask image are specified.
The text file consists of lines of two or four numbers. If two numbers are given, separated by whitespace, they define a single pixel and the values are the column and line pixel coordinates. If four numbers are given, separated by whitespace, they define a rectangular region. The four numbers are the pixel coordinates for the starting column, the ending column, the starting line, and the ending line. This format is the same as the old (pre-V2.11) "fixpix" format. This task may be used to convert these old "fixpix" data files to pixel masks (as used by the new fixpix task) or to create pixel masks.
The different region shapes may be coded by the mask values. This is useful with the fixpix task which can select different replacement methods based on the mask codes. In particular, one may want to interpolate along the narrower dimension of a rectangular region. The region shapes that may be coded are individual pixels, square regions, and rectangular regions with narrow dimension along lines or columns.
In addition to this task, pixel mask images may be made in a variety of ways. Any task which produces and modifies image values may be used. Some useful tasks are imexpr, imreplace, imcopy, and mkpattern . If a new image is specified with the explicit ".pl" extension then the pixel mask format is produced. Another way to make masks are with the task ccdmask . The task ccdmask is specialized to make a mask of bad pixels from flat fields or, even better, from the ratio of two flat fields of different exposure levels.
1. Convert a text region description into a mask and then use it to replace pixels by interpolation along the narrower dimension.
cl> list2mask fp.dat mask
cl> fixpix pix mask linterp=1,3,4 cinterp=2
imreplace, imexpr, imcopy, imedit, fixpix