| evalfit | noao.digiphot.photcal | evalfit |
evalfit -- evaluate the fit
evalfit observations config parameters calib
EVALFIT evaluates the the transformation equations for the program and/or standard objects in observations , using the transformation equations defined in config , the fitted parameter values in the file parameters produced by the FITPARAMS task, and writes the output to the file calib . If append is "yes" output may be appended to an existing file.
EVALFIT computes the values of the catalog variables for the program stars by inserting the observations variables directly into the transformation equations. EVALFIT can evaluate any number of transformation equations, but if there are any standard catalog variables in the right-hand side of the transformation equation, EVALFIT will assign INDEF to the fitted for that equation.
Below are two sets of transformation equations. The first set can be evaluated with EVALFIT, the second set cannot and must be inverted with INVERTFIT. In both cases the catalog variables to be fit are V and BV, and the observed quantities are mv, mb, Xv, and Xb.
System 1: V = v0 + mv + v1 * (Xv + Xb) / 2. + v2 * (mb - mv)
BV = b0 + b1 * (Xv + Xb) / 2. + b2 * (mb - mv)
System 2: mv = v0 + V + v1 * Xv + v2 * BV
mb = b0 + V + BV + b1 * Xb + b2 * BV
Formal errors for each fit may be computed by, 1) setting errors to "obserrors" and using the error columns defined in the observations section of config to estimate the errors or 2) evaluating the error equations defined in config .
If the user wishes to match the objects in observations with those in catalogs in order for example, to compute the residuals of the fit, catalogs must be defined. Similarly if objects is "program" or "standard", catalogs must be defined in order to enable id matching.
Legal catalog and observations files are multi-column text files whose columns are delimited by whitespace. The first column of a catalog file is always reserved for an object id. The first column of an observations file is reserved for an object id which can be used to match the observational data with the corresponding catalog data. All other columns may contain any quantity which can be expressed as an integer or real number. Sexagesimal format numbers (hh:mmm:ss) are interpreted internally as real numbers. The constant INDEF can be used to represent data that is missing or undefined. Double precision and complex data are not supported. Lines beginning with "#" are treated as comment lines.
By default EVALFIT prints out the object id, followed by the variables listed in the print parameter, followed by the fit value, estimated error (if errors is not "undefined"), and residual of the fit (for any standard star observations that can be matched with the catalog values) for each fitted equation. The user can format the output by setting the format parameter to an SPP style string. SPP format strings are described in detail below.
A format specification has the form "%w.dCn", where w is the field width, d is the number of decimal places or the number of digits of precision, C is the format code, and n is radix character for format code "r" only. The w and d fields are optional. The format codes C are as follows:
b boolean (YES or NO)
c single character (c or '\c' or '\0nnn')
d decimal integer
e exponential format (D specifies the precision)
f fixed format (D specifies the number of decimal places)
g general format (D specifies the precision)
h hms format (hh:mm:ss.ss, D = no. decimal places)
m minutes, seconds (or hours, minutes) (mm:ss.ss)
o octal integer
rN convert integer in any radix N
s string (D field specifies max chars to print)
t advance To column given as field W
u unsigned decimal integer
w output the number of spaces given by field W
x hexadecimal integer
z complex format (r,r) (D = precision)
Conventions for w (field width) specification:
W = n right justify in field of N characters, blank fill
-n left justify in field of N characters, blank fill
0n zero fill at left (only if right justified)
absent, 0 use as much space as needed (D field sets precision)
Escape sequences (e.g. "\n" for newline):
\b backspace (\fBnot implemented\fR)
\f formfeed
\n newline (crlf)
\r carriage return
\t tab
\" string delimiter character
\' character constant delimiter character
\\ backslash character
\nnn octal value of character
Examples
%s format a string using as much space as required
%-10s left justify a string in a field of 10 characters
%-10.10s left justify and truncate a string in a field of 10 characters
%10s right justify a string in a field of 10 characters
%10.10s right justify and truncate a string in a field of 10 characters
%7.3f print a real number right justified in floating point format
%-7.3f same as above but left justified
%15.7e print a real number right justified in exponential format
%-15.7e same as above but left justified
%12.5g print a real number right justified in general format
%-12.5g same as above but left justified
\n insert a newline
Note that deferred value fields are not implemented in EVALFIT.
1. Evaluate the fit for a list of program stars in m92. Use the errors in the observed quantities to estimate the errors.
ph> evalfit m92.obs m92.cfg m92.fit m92.cal
2. Repeat the fit computed above but include the variables xu and yu which are the positions of the objects in the u frame in the output.
ph> evalfit m92.obs m92.cfg m92.fit m92.cal print="xu,yu"
3. Repeat the fit computed above but format the output. The user has determined that the output will have 5 columns containing the object id, xu, yu, fit value and fit error respectively.
ph> evalfit m92.obs m92.cfg m92.fit m92.cal print="xu,yu"\ format="%-10.10s %-7.2f %-7.2f %-7.3f %-6.3f\n"
mkconfig,chkconfig,fitparams,invertfit