Fits a polynomial surface to two-dimensional data array
Unlike SURFIT, neither does it bin the data nor does it reject outliers.
"World"
or "Data"
. If COSYS="World"
the co-ordinates used to fits
the surface are pixel co-ordinates. If COSYS="Data"
the data co-ordinates used are used
in the fit, provided there are axis centres present in the NDF. COSYS="World"
is
recommended. [
Current co-ordinate system]
"Polynomial"
for a polynomial or "Spline"
for a bi-cubic spline.
["Polynomial"]
1
creates one interior knot, [5,4]
gives five along the x
axis and four along the y direction. Increasing this parameter values increases the
flexibility of the surface. Normally, 4
is a reasonable value. The upper limit of
acceptable values will be reduced along each axis when its binned array dimension is
fewer than 29. KNOTS is only accessed when FITTYPE="Spline"
. The default is
the current value, which is 4
initially. []
1
gives a constant, 2
a linear
fit, 3
a quadratic etc. Increasing this parameter increases the flexibility of
the surface in the x direction. The upper limit of acceptable values will be
reduced for arrays with an x dimension fewer than 29. NXPAR is only accessed when
FITTYPE="Polynomial"
. 1
gives a constant, 2
a linear fit, 3
a quadratic etc. Increasing this
parameter increases the flexibility of the surface in the y direction. The
upper limit of acceptable values will be reduced for arrays with a y dimension
fewer than 29. NYPAR is only accessed when FITTYPE="Polynomial"
. TRUE
, allows an NDF extension containing an existing
surface fit to be overwritten. OVERWRITE=FALSE
protects an existing surface-fit
extension, and should one exist, an error condition will result and the task
terminated. [TRUE]
TRUE
and the NDF contains a variance array this will be used to define
the weights, otherwise all the weights will be set equal. [TRUE]
!
) value
is supplied, the value used is the maximum x co-ordinate of the fitted data.
[!]
!
) value is supplied, the value used is the minimum x co-ordinate of the
fitted data. [!]
!
) value is supplied, the value used is the maximum y
co-ordinate of the fitted data. [!]
!
) value is supplied, the value used is
the minimum y co-ordinate of the fitted data. [!]
For further details of the CHEBYSHEV variant see SGP/38. The CHEBYSHEV variant includes the fitting variance for each coefficient.
The BSPLINE variant structure is provisional. It contain the spline coefficients in the two-dimensional DATA_ARRAY component, the knots in XKNOTS and YKNOTS arrays, and a scaling factor to restore the original values after spline evaluation recorded in component SCALE. All of these components have type _REAL.
Also stored in the SURFACEFIT extension are the r.m.s. deviation to the fit (component
RMS), the maximum absolute deviation (component RSMAX), and the co-ordinate system
(component COSYS) translated to AST Domain names AXIS (for Parameter COSYS="Data"
) and
PIXEL ("World"
).
This routine correctly processes the AXIS, DATA, QUALITY, VARIANCE, and HISTORY components of an NDF data structure.
Processing of bad pixels and automatic quality masking are supported.
All non-complex numeric data types can be handled. Arithmetic is performed using double-precision floating point.