STScI logoSTSDAS Help Pages
centroid stlocal.testfgs centroid

NAME · USAGE · DESCRIPTION · PARAMETERS · EXAMPLES · BUGS · SEE_ALSO

NAME

centroid -- Compute average rectangular coordinates and observation time.

USAGE

centroid input intable outtable output

DESCRIPTION

This task reads the encoder positions from an FGS file, computes the average rectangular coordinates and time of observation, creates an output table, and puts the average positions and other information into that table. Centroid defines the columns used by subsequent tasks in the FGS package; some of these columns are filled in with preliminary values from the data file header, while other columns are left with null values. After rejecting outliers, the average rectangular coordinates are derived by fitting a low-order curve by a least squares method, and evaluating the curve at the average time. The curve may be either a quadratic, a linear fit, or just the mean value; the same degree of fit is used for both X vs. time and Y vs. time.

If an input FGS file contains a transfer function (AASTMODE = TRANSFER) then a different type of output table will be produced. Several parameters will be written to the table header rather than to columns in the first row. The data will be written to four columns (X & Y positions, normalized fine error signal for X and for Y) and as many rows as are required. Data flagged as bad in the input file will not be copied to output (i.e., all table entries will be valid, none INDEF), so the X and Y positions may be unequally spaced. Centroid does not identify and reject outliers from transfer-function data. Only 32-Kbps transfer-function data may be processed.

PARAMETERS

input [file name template]
A list of FGS files for which centroided positions are to be computed, or which contain transfer-function data.
intable [string]
File name of a table containing calibration parameters for all files to be processed.
outtable [file name template]
A list of output tables, one for each input file. The results will be put in these tables, which serve as input to subsequent tasks in the FGS package. The columns whose values are actually computed by centroid are (for positional astrometry data):

	TIME	Modified Julian Date of the average time of observation
	X	direction cosine
	Y	direction cosine
	X_X	variance of X (mean of squared deviations)
	X_Y	covariance of X and Y
	Y_Y	variance of Y
	DXDT	slope of fitted curve of X vs time (sec**-1)
	DXDT2	curvature of fitted curve for X (sec**-2)
	DYDT	slope of fitted curve of Y vs time (sec**-1)
	DYDT2	curvature of fitted curve for Y (sec**-2)
	NUMPTC	number of points used in computing averages

The columns for transfer-function data are:

	X	X coordinate relative to reference position
	FESX	normalized fine error signal in the X coordinate
	Y	Y coordinate relative to reference position
	FESY	normalized fine error signal in the Y coordinate

The reference position is an (X,Y) pair along the scan, and the values of X & Y are given by the table header parameters REF_X and REF_Y respectively.
output [string]
An optional list of output files for residuals, one for each input file. If this parameter is blank, no output file will be created. If output file names are specified, each file will consist of four sub-images which contain (1) the X coordinates, (2) residuals of the X coordinates (value - fitted curve), (3) the Y coordinates and, (4) residuals of the Y coordinates. The data type of each sub-image is single-precision real. Note that these values are rectangular coordinates, not encoder positions. Each sub-image will be the same length, but that length will, in general, be less than the length of the corresponding input file. Values that were flagged as missing in the input file (using the FILL2 keyword) will be set to INDEF in the output file.

No output data file is produced if the input data are for a transfer function.

(choice = "default") [string, allowed values: actual | average | default]

This specifies whether the actual encoder positions or the average encoder positions should be used to determine the coordinates. This must agree with whatever times were computed by puttime. If you do not set choice="default", you had better know what you are doing. Choice is ignored for transfer-function data.

(degree = 1) [integer, min=-1, max=2]
Curves of up to second order may be fit to X vs. time and to Y vs. time. The centroided values of X and Y are obtained by evaluating the curve fit at the average time. Degree specifies the degree of curve to fit (degree=0 just takes the mean values). degree=-1 means that the centroid task should select the degree of fit based on the residuals. Degree is ignored for transfer-function data.
(reject = 5.0) [real, min=0.0, max=INDEF]
To reject outliers, straight lines are fit to X vs. time and to Y vs. time by minimizing the sum of the absolute values of the deviations. The median of the absolute values of the deviations (MAD) is computed for each line. Points that lie beyond reject * MAD are rejected. Reject is ignored for transfer-function data.
(verbose = yes) [boolean]
Print each file name and average positions on the terminal screen?

EXAMPLES

1. Compute centroided positions for the file f1m.a1h.

fg>centroid f1m.a1h cdbs.tab f1m.tab resid_f1m.hhh

BUGS

SEE ALSO

puttime


Source Code · Package Help · Search Form · STSDAS

Maintained by the Science Software Group at STScI
This file last updated on 10 Mar 2011