STScI Logo

rfindx stsdas.hst_calib.foc.focgeom



rfindx -- Accurately locate reseau marks in an image.


rfindx input inres refentry outres entry modelfile


This program will accurately locate reseau marks in an image, given approximate locations of the marks and one or more model templates for the marks. A search area is also needed. Within the search area, the program will try to find marks near their approximate positions. Each model template is scaled to the local mean image value, and the square deviation from the image is calculated over the search area. The model with the lowest minimum is chosen as the best fit, and the position of the minimum is refined by quadratic fitting to the adjacent pixels in the line and pixel directions. The positions can be written out to a reseau file. Script variables are available---providing quick evaluation of the program's success in finding marks.

Some methods of finding initial approximate positions are discussed in the focgeom help screen. Type "help focgeom opt=sys" for a description of these methods.

Particular reseau marks which cannot be located for some reason, (for example, the models do not fit well enough, the approximate locations are too close to the edge of the image, or the location has nothing but fill values around it) will be marked as a "hole", using INDEF coordinates.


input [file name]
Name of the input image.
inres [file name]
Name of the input reseau table. If inres is omitted, the name of a coordinate file must be given.
refentry [string]
Template describing the entries in inres that are to be used as references.
outres [file name]
File name for the reseau table produced by rfindx.
entry [string]
Entry name for the output reseau marks written to outres. If no value is provided for this parameter, then the entry will take the name of the image header keyword ROOTNAME from input; if that name can not be determined, the entry name will be DUMMY.
modelfile [file name]
The name of a text file containing up to 20 model templates, represented as free-format integers. For each model, the first two numbers give the size of the model in number of pixels and lines, maximum 50 x 50, followed by the model data itself---which is assumed to be normalized to a surrounding image mean of 100. The models must be symmetrical about their center point, or else there will be a systematic bias in locations.
(search= 7) [integer, min=3, max=INDEF]
Number of pixels to search in each line; the search will be centered on the approximate location of each reseau mark.
(search= 7) [integer, min=3, max=INDEF]
Number of lines to search for each pixel coordinate; the search will be centered on the approximate location of each reseau mark.
(depth = 50.0) [real, min=0., max=100.]
The percentage depth of the correlation matrix, 100*(max-min)/max, which must be exceeded for a mark to be located. The value of depth should be in the range of 50.0 to 100.0. A value of 100 is a perfect match between the mark template and the reseau mark, that is, the fit must be exact. Higher values of depth mean that model must more closely fit the data. However, spurious data points within the search area can lead to a spuriously large maximum value in the correlation matrix, and therefore, a spuriously good fit of a model to the data for any particular mark.
(coordfile) [file name]
This parameter provides an alternative to supplying approximate reseau locations in a reseau table; coordfile is a free-format text file containing the locations. Reseau positions are represented as X,Y pairs. The number of pairs must match the result of multiplying the value of the RSIZE keywords, unless RSIZE contains INDEF. The coordfile will be used in preference to the inres file.
(ncols = INDEF) [integer]
Number of columns in the reseau grid. This can be INDEF, in which case the grid is assumed to have one column. This parameter must be given if a coordinate file is given, and is ignored if one is not given. This parameter is set to the actual grid size used by rfindx.
(nrows = INDEF) [integer]
Number of rows in the reseau grid. This can be INDEF, in which case the grid is assumed to have one row. This parameter is required when a coordinate file is used, and ignored if a reference reseau file is used. This parameter is set to the actual grid size used by rfindx.
(verbose = yes) [boolean]
Display all text output on the terminal screen? If verbose = no, all text output except error and warning messages will be suppressed.
(noindefs = yes) [boolean]
Prohibit input coordinates from being changed to INDEF coordinates? If a mark cannot be located, the input coordinate will be copied to the output.
(inner) [integer]
Program-defined variable giving the number of reseau marks that were found in the grid's interior (as specified by nrows, ncols).
(outer) [integer]
Program-defined variable giving the number of marks that were found on the grid's boundary (as specified by nrows, ncols).

The values of inner and outer together give some idea of how well the program fared. Inner and boundary marks are separated because boundary marks can affect the fit a bit more than interior marks.


1. Locate reseau marks in a file called image using model data from the reseau grid in the file inres. Diagnostic log output will be printed to the terminal screen. The output reseau grid will be written to the file outres along with a copy of the file inres, which will have a newly-generated entry inserted in correct alphabetic order.

  fo> rfindx image inres outres



This task was written by David Giaretta.


rgenx, rprintx, rplotx

Type "help focgeom opt=sys" for a higher-level description of the focgeom package.

Type "help reseau" for more information about reseau files.

Source Code · Package Help · Search Form · STSDAS