|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ast.AstObject
uk.ac.starlink.ast.Mapping
uk.ac.starlink.ast.PcdMap
public class PcdMap
Java interface to the AST PcdMap class - apply 2-dimensional pincushion/barrel distortion. A PcdMap is a non-linear Mapping which transforms 2-dimensional positions to correct for the radial distortion introduced by some cameras and telescopes. This can take the form either of pincushion or barrel distortion, and is characterized by a single distortion coefficient.
A PcdMap is specified by giving this distortion coefficient and the coordinates of the centre of the radial distortion. The forward transformation of a PcdMap applies the distortion:
RD = R * ( 1 + C * R * R )
where R is the undistorted radial distance from the distortion centre (specified by attribute PcdCen), RD is the radial distance from the same centre in the presence of distortion, and C is the distortion coefficient (given by attribute Disco).
The inverse transformation of a PcdMap removes the distortion produced by the forward transformation. The expression used to derive R from RD is an approximate inverse of the expression above.
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 02110-1301, USA
Nested Class Summary |
---|
Nested classes/interfaces inherited from class uk.ac.starlink.ast.Mapping |
---|
Mapping.Interpolator, Mapping.Spreader |
Field Summary |
---|
Fields inherited from class uk.ac.starlink.ast.Mapping |
---|
LINEAR_INTERPOLATOR, LINEAR_SPREADER, NEAREST_INTERPOLATOR, NEAREST_SPREADER |
Fields inherited from class uk.ac.starlink.ast.AstObject |
---|
AST__BAD, AST__TUNULL, pointer |
Constructor Summary | |
---|---|
PcdMap(double disco,
double[] pcdcen)
Creates a PcdMap. |
Method Summary | |
---|---|
double |
getDisco()
Get pcdMap pincushion/barrel distortion coefficient. |
double |
getPcdCen(int axis)
Get centre coordinates of pincushion/barrel distortion by axis. |
void |
setDisco(double disco)
Set pcdMap pincushion/barrel distortion coefficient. |
void |
setPcdCen(int axis,
double pcdCen)
Set centre coordinates of pincushion/barrel distortion by axis. |
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 |
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PcdMap(double disco, double[] pcdcen)
disco
- The distortion coefficient. Negative values give barrel
distortion, positive values give pincushion distortion, and
zero gives no distortion.pcdcen
- A 2-element array containing the coordinates of the centre of the
distortion.
AstException
- if an error occurred in the AST libraryMethod Detail |
---|
public double getDisco()
Note that the forward transformation of a PcdMap applies the distortion specified by this attribute and the inverse transformation removes this distortion. If the PcdMap is inverted (e.g. using astInvert), then the forward transformation will remove the distortion and the inverse transformation will apply it. The distortion itself will still be given by the same value of Disco.
public void setDisco(double disco)
Note that the forward transformation of a PcdMap applies the distortion specified by this attribute and the inverse transformation removes this distortion. If the PcdMap is inverted (e.g. using astInvert), then the forward transformation will remove the distortion and the inverse transformation will apply it. The distortion itself will still be given by the same value of Disco.
disco
- the Disco attribute of this objectpublic double getPcdCen(int axis)
axis
- the index of the axis to get the value for (1 or 2)
IndexOutOfBoundsException
- if axis
is not in
the range 1..2.public void setPcdCen(int axis, double pcdCen)
axis
- the index of the axis to set the value for (1 or 2)pcdCen
- the PcdCen attribute for the indicated axis of
this mapping
IndexOutOfBoundsException
- if axis
is not in
the range 1..2.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |