public class PolyMap
- extends Mapping
Java interface to the AST PolyMap class
- map coordinates using polynomial functions.
A PolyMap is a form of Mapping which performs a general polynomial
transformation. Each output coordinate is a polynomial function of
all the input coordinates. The coefficients are specified separately
for each output coordinate. The forward and inverse transformations
are defined independantly by separate sets of coefficients. If no
inverse transformation is supplied, an iterative method can be used
to evaluate the inverse based only on the forward transformation.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public Licence as
published by the Free Software Foundation; either version 2 of
the Licence, or (at your option) any later version.
This program is distributed in the hope that it will be
useful,but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public Licence for more details.
You should have received a copy of the GNU General Public Licence
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street,Fifth Floor, Boston, MA
- See Also:
- AST PolyMap
Creates a PolyMap.
|Methods inherited from class uk.ac.starlink.ast.Mapping
decompose, getInvert, getNin, getNout, getReport, getTranForward, getTranInverse, invert, linearApprox, mapBox, mapSplit, rate, rebin, rebinD, rebinF, rebinI, resample, resampleB, resampleD, resampleF, resampleI, resampleL, resampleS, setInvert, setReport, simplify, tran1, tran2, tranGrid, tranN, tranP
|Methods inherited from class uk.ac.starlink.ast.AstObject
annul, clear, copy, delete, equals, finalize, getAstConstantI, getB, getC, getD, getF, getI, getID, getIdent, getL, getNobject, getObjSize, getRefCount, hashCode, isThreaded, reportVersions, sameObject, set, setB, setC, setD, setF, setI, setID, setIdent, setL, show, test, tune
public PolyMap(int nin,
- Creates a PolyMap.
nin - The number of input coordinates.
nout - The number of output coordinates.
ncoeff_f - The number of non-zero coefficients necessary to define the
forward transformation of the PolyMap. If zero is supplied, the
forward transformation will be undefined.
coeff_f - An array containing
"ncoeff_f*( 2 + nin )" elements. Each group of "2 + nin"
adjacent elements describe a single coefficient of the forward
transformation. Within each such group, the first element is the
coefficient value; the next element is the integer index of the
PolyMap output which uses the coefficient within its defining
polynomial (the first output has index 1); the remaining elements
of the group give the integer powers to use with each input
coordinate value (powers must not be negative, and floating
point values are rounded to the nearest integer).
If "ncoeff_f" is zero, a NULL pointer may be supplied for "coeff_f".
For instance, if the PolyMap has 3 inputs and 2 outputs, each group
consisting of 5 elements, A groups such as "(1.2, 2.0, 1.0, 3.0, 0.0)"
describes a coefficient with value 1.2 which is used within the
definition of output 2. The output value is incremented by the
product of the coefficient value, the value of input coordinate
1 raised to the power 1, and the value of input coordinate 2 raised
to the power 3. Input coordinate 3 is not used since its power is
specified as zero. As another example, the group "(-1.0, 1.0,
0.0, 0.0, 0.0 )" describes adds a constant value -1.0 onto
output 1 (it is a constant value since the power for every input
axis is given as zero).
Each final output coordinate value is the sum of the "ncoeff_f" terms
described by the "ncoeff_f" groups within the supplied array.
ncoeff_i - The number of non-zero coefficients necessary to define the
inverse transformation of the PolyMap. If zero is supplied, the
inverse transformation will be undefined.
coeff_i - An array containing
"ncoeff_i*( 2 + nout )" elements. Each group of "2 + nout"
adjacent elements describe a single coefficient of the inverse
transformation, using the same schame as "coeff_f",
except that "inputs" and "outputs" are transposed.
If "ncoeff_i" is zero, a NULL pointer may be supplied for "coeff_i".
AstException - if an error occurred in the AST library
Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.