KPG1_PL2GE

Reads two-dimensional polynomial information from a POLYNOMIAL structure

Description:

This routine reads information describing a two-dimensional polynomial surface from a standard Starlink POLYNOMIAL structure, as defined in SGP/38. All floating-point information within the structure is returned as DOUBLE PRECISION.

It is assumed the calling programme needs a one-dimensional array of coefficients, where COEFF( (IX-1)NYPAR + IY ) contains the coefficient for the (IX,IY)th term (with NYPAR being the total number of Y terms). Such a one-dimensional array is used by the NAG routines and defined in the NAG manual (see Chapter E02 on " Curve and Surface fitting" ).

This routine will convert read the two-dimensional coefficient array from the POLYNOMIAL structure (in the format described in SGP/38) and load a flipped version of this into the required one-dimensional array. If there is a variance array present, the VARPRE flag is set .TRUE., and the variances returned in VARIAN.

The routine will also read the TMIN and TMAX arrays from the structure and return XMIN, XMAX, YMIN and YMAX. Note that these items are compulsory when VARNT= CHEBYSHEV but optional when VARNT= SIMPLE . In the latter case an attempt will be made to read TMIN and TMAX from the structure, but their absence will not be regarded as an error. The returned parameter LIMITS will indicate if these items have been read successfully.

Invocation

CALL KPG1_PL2GE( LOC, MXPAR, VARNT, NXPAR, NYPAR, LIMITS, XMIN, XMAX, YMIN, YMAX, COEFF, VARPRE, VARIAN, WORK, STATUS )

Arguments

LOC = CHARACTER( DAT__SZLOC ) (Given)
Locator to the existing POLYNOMIAL structure.
MXPAR = INTEGER (Given)
The maximum number of parameters in either x or y. The declared size of the coefficient arrays given to this routine is assumed to be MXPAR MXPAR (see below).
VARNT = CHARACTER() (Returned)
Variant of the polynomial ( CHEBYSHEV or SIMPLE ). This item should be at least CHARACTER9.
NXPAR = INTEGER (Returned)
Number of x parameters (= order of polynomial in x direction + 1).
NYPAR = INTEGER (Returned)
Number of y parameters (= order of polynomial in Y direction + 1).
LIMITS = LOGICAL (Returned)
When VARNT= SIMPLE this logical flag indicates whether any TMIN and TMAX limits have been read from the polynomial structure and returned in the next four arguments (in which case LIMITS will be .TRUE.).
XMIN = DOUBLE PRECISION (Returned)
Minimum value along x axis for which polynomial is valid.
XMAX = DOUBLE PRECISION (Returned)
Maximum value along x axis for which polynomial is valid.
YMIN = DOUBLE PRECISION (Returned)
Minimum value along y axis for which polynomial is valid.
YMAX = DOUBLE PRECISION (Returned)
Maximum value along y axis for which polynomial is valid.
COEFF( MXPAR MXPAR ) = DOUBLE PRECISION (Returned)
Array of polynomial coefficients, in the format used by NAG routines (see KPS1_FSPF2).
VARPRE = LOGICAL (Returned)
Whether or not there are coefficient variances present in the POLYNOMIAL structure.
VARIAN( MXPAR MXPAR ) = DOUBLE PRECISION (Returned)
Array of polynomial coefficient variances, in the format used by NAG routines. The values are only assigned when VARPRE is .TRUE..
WORK( MXPAR, MXPAR ) = DOUBLE PRECISION (Returned)
Work array containing the two-dimensional array of coefficients as read from the POLYNOMIAL structure.
STATUS = INTEGER (Given and Returned)
Global status value.

Notes: