uk.ac.starlink.ast
Class SphMap

java.lang.Object
  extended by uk.ac.starlink.ast.AstObject
      extended by uk.ac.starlink.ast.Mapping
          extended by uk.ac.starlink.ast.SphMap

public class SphMap
extends Mapping

Java interface to the AST SphMap class - map 3-d Cartesian to 2-d spherical coordinates. A SphMap is a Mapping which transforms points from a 3-dimensional Cartesian coordinate system into a 2-dimensional spherical coordinate system (longitude and latitude on a unit sphere centred at the origin). It works by regarding the input coordinates as position vectors and finding their intersection with the sphere surface. The inverse transformation always produces points which are a unit distance from the origin (i.e. unit vectors).

Licence

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 02110-1301, USA

See Also:
AST SphMap

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
SphMap()
          Creates a SphMap.
 
Method Summary
 double getPolarLong()
          Get the longitude value to assign to either pole.
 boolean getUnitRadius()
          Get sphMap input vectors lie on a unit sphere.
 void setPolarLong(double polarLong)
          Set the longitude value to assign to either pole.
 void setUnitRadius(boolean unitRadius)
          Set sphMap input vectors lie on a unit sphere.
 
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

SphMap

public SphMap()
Creates a SphMap.

Throws:
AstException - if an error occurred in the AST library
Method Detail

getUnitRadius

public boolean getUnitRadius()
Get sphMap input vectors lie on a unit sphere. This is a boolean attribute which indicates whether the 3-dimensional vectors which are supplied as input to a SphMap are known to always have unit length, so that they lie on a unit sphere centred on the origin.

If this condition is true (indicated by setting UnitRadius non-zero), it implies that a CmpMap which is composed of a SphMap applied in the forward direction followed by a similar SphMap applied in the inverse direction may be simplified (e.g. by astSimplify) to become a UnitMap. This is because the input and output vectors will both have unit length and will therefore have the same coordinate values.

If UnitRadius is zero (the default), then although the output vector produced by the CmpMap (above) will still have unit length, the input vector may not have. This will, in general, change the coordinate values, so it prevents the pair of SphMaps being simplified.

Notes


- This attribute is intended mainly for use when SphMaps are involved in a sequence of Mappings which project (e.g.) a dataset on to the celestial sphere. By regarding the celestial sphere as a unit sphere (and setting UnitRadius to be non-zero) it becomes possible to cancel the SphMaps present, along with associated sky projections, when two datasets are aligned using celestial coordinates. This often considerably improves performance.
- Such a situations often arises when interpreting FITS data and is handled automatically by the FitsChan class.
- The value of the UnitRadius attribute is used only to control the simplification of Mappings and has no effect on the value of the coordinates transformed by a SphMap. The lengths of the input 3-dimensional Cartesian vectors supplied are always ignored, even if UnitRadius is non-zero.

Returns:
this object's UnitRadius attribute

setUnitRadius

public void setUnitRadius(boolean unitRadius)
Set sphMap input vectors lie on a unit sphere. This is a boolean attribute which indicates whether the 3-dimensional vectors which are supplied as input to a SphMap are known to always have unit length, so that they lie on a unit sphere centred on the origin.

If this condition is true (indicated by setting UnitRadius non-zero), it implies that a CmpMap which is composed of a SphMap applied in the forward direction followed by a similar SphMap applied in the inverse direction may be simplified (e.g. by astSimplify) to become a UnitMap. This is because the input and output vectors will both have unit length and will therefore have the same coordinate values.

If UnitRadius is zero (the default), then although the output vector produced by the CmpMap (above) will still have unit length, the input vector may not have. This will, in general, change the coordinate values, so it prevents the pair of SphMaps being simplified.

Notes


- This attribute is intended mainly for use when SphMaps are involved in a sequence of Mappings which project (e.g.) a dataset on to the celestial sphere. By regarding the celestial sphere as a unit sphere (and setting UnitRadius to be non-zero) it becomes possible to cancel the SphMaps present, along with associated sky projections, when two datasets are aligned using celestial coordinates. This often considerably improves performance.
- Such a situations often arises when interpreting FITS data and is handled automatically by the FitsChan class.
- The value of the UnitRadius attribute is used only to control the simplification of Mappings and has no effect on the value of the coordinates transformed by a SphMap. The lengths of the input 3-dimensional Cartesian vectors supplied are always ignored, even if UnitRadius is non-zero.

Parameters:
unitRadius - the UnitRadius attribute of this object

getPolarLong

public double getPolarLong()
Get the longitude value to assign to either pole. This attribute holds the longitude value, in radians, to be returned when a Cartesian position corresponding to either the north or south pole is transformed into spherical coordinates. The default value is zero.

Returns:
this object's PolarLong attribute

setPolarLong

public void setPolarLong(double polarLong)
Set the longitude value to assign to either pole. This attribute holds the longitude value, in radians, to be returned when a Cartesian position corresponding to either the north or south pole is transformed into spherical coordinates. The default value is zero.

Parameters:
polarLong - the PolarLong attribute of this object


Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.