

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object uk.ac.starlink.ast.AstObject uk.ac.starlink.ast.Mapping uk.ac.starlink.ast.WcsMap
public class WcsMap
Java interface to the AST WcsMap class  implement a FITSWCS sky projection. This class is used to represent sky coordinate projections as described in the FITS world coordinate system (FITSWCS) paper II "Representations of Celestial Coordinates in FITS" by M. Calabretta and E.W. Griesen. This paper defines a set of functions, or sky projections, which transform longitudelatitude pairs representing spherical celestial coordinates into corresponding pairs of Cartesian coordinates (and vice versa).
A WcsMap is a specialised form of Mapping which implements these sky projections and applies them to a specified pair of coordinates. All the projections in the FITSWCS paper are supported, plus the now deprecated "TAN with polynomial correction terms" projection which is refered to here by the code "TPN". Using the FITSWCS terminology, the transformation is between "native spherical" and "projection plane" coordinates (also called "intermediate world coordinates". These coordinates may, optionally, be embedded in a space with more than two dimensions, the remaining coordinates being copied unchanged. Note, however, that for consistency with other AST facilities, a WcsMap handles coordinates that represent angles in radians (rather than the degrees used by FITSWCS).
The type of FITSWCS projection to be used and the coordinates (axes) to which it applies are specified when a WcsMap is first created. The projection type may subsequently be determined using the WcsType attribute and the coordinates on which it acts may be determined using the WcsAxis(lonlat) attribute.
Each WcsMap also allows up to 100 "projection parameters" to be associated with each axis. These specify the precise form of the projection, and are accessed using PVi_m attribute, where "i" is the integer axis index (starting at 1), and m is an integer "parameter index" in the range 0 to 99. The number of projection parameters required by each projection, and their meanings, are dependent upon the projection type (most projections either do not use any projection parameters, or use parameters 1 and 2 associated with the latitude axis). Before creating a WcsMap you should consult the FITSWCS paper for details of which projection parameters are required, and which have defaults. When creating the WcsMap, you must explicitly set values for all those required projection parameters which do not have defaults defined in this paper.
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 021101301, USA
Nested Class Summary 

Nested classes/interfaces inherited from class uk.ac.starlink.ast.Mapping 

Mapping.Interpolator, Mapping.Spreader 
Field Summary  

static int 
AST__AIR
Indicates FITSWCS mapping of type AIR. 
static int 
AST__AIT
Indicates FITSWCS mapping of type AIT. 
static int 
AST__ARC
Indicates FITSWCS mapping of type ARC. 
static int 
AST__AZP
Indicates FITSWCS mapping of type AZP. 
static int 
AST__BON
Indicates FITSWCS mapping of type BON. 
static int 
AST__CAR
Indicates FITSWCS mapping of type CAR. 
static int 
AST__CEA
Indicates FITSWCS mapping of type CEA. 
static int 
AST__COD
Indicates FITSWCS mapping of type COD. 
static int 
AST__COE
Indicates FITSWCS mapping of type COE. 
static int 
AST__COO
Indicates FITSWCS mapping of type COO. 
static int 
AST__COP
Indicates FITSWCS mapping of type COP. 
static int 
AST__CSC
Indicates FITSWCS mapping of type CSC. 
static int 
AST__CYP
Indicates FITSWCS mapping of type CYP. 
static int 
AST__GLS
Indicates FITSWCS mapping of type GLS. 
static int 
AST__MER
Indicates FITSWCS mapping of type MER. 
static int 
AST__MOL
Indicates FITSWCS mapping of type MOL. 
static int 
AST__NCP
Indicates FITSWCS mapping of type NCP. 
static int 
AST__PAR
Indicates FITSWCS mapping of type PAR. 
static int 
AST__PCO
Indicates FITSWCS mapping of type PCO. 
static int 
AST__QSC
Indicates FITSWCS mapping of type QSC. 
static int 
AST__SFL
Indicates FITSWCS mapping of type SFL. 
static int 
AST__SIN
Indicates FITSWCS mapping of type SIN. 
static int 
AST__STG
Indicates FITSWCS mapping of type STG. 
static int 
AST__SZP
Indicates FITSWCS mapping of type SZP. 
static int 
AST__TAN
Indicates FITSWCS mapping of type TAN. 
static int 
AST__TPN
Indicates FITSWCS mapping of type TPN. 
static int 
AST__TSC
Indicates FITSWCS mapping of type TSC. 
static int 
AST__WCSBAD
Indicates FITSWCS mapping of type WCSBAD. 
static int 
AST__ZEA
Indicates FITSWCS mapping of type ZEA. 
static int 
AST__ZPN
Indicates FITSWCS mapping of type ZPN. 
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  

WcsMap(int ncoord,
int type,
int lonax,
int latax)
Creates a WcsMap. 
Method Summary  

float 
getNatLat()
Get native latitude of the reference point of a FITSWCS projection. 
float 
getNatLon()
Get native longitude of the reference point of a FITSWCS projection. 
float 
getPVi_m()
Get FITSWCS projection parameters. 
int 
getWcsAxis(int lonlat)
Get FITSWCS projection axes. 
int 
getWcsType()
Get FITSWCS projection type. 
void 
setPVi_m(float pVi_m)
Set FITSWCS projection parameters. 
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 
Field Detail 

public static final int AST__AZP
public static final int AST__TAN
public static final int AST__SIN
public static final int AST__STG
public static final int AST__ARC
public static final int AST__ZPN
public static final int AST__ZEA
public static final int AST__AIR
public static final int AST__CYP
public static final int AST__CAR
public static final int AST__MER
public static final int AST__CEA
public static final int AST__COP
public static final int AST__COD
public static final int AST__COE
public static final int AST__COO
public static final int AST__BON
public static final int AST__PCO
public static final int AST__GLS
public static final int AST__SFL
public static final int AST__PAR
public static final int AST__AIT
public static final int AST__MOL
public static final int AST__CSC
public static final int AST__QSC
public static final int AST__NCP
public static final int AST__TSC
public static final int AST__TPN
public static final int AST__SZP
public static final int AST__WCSBAD
Constructor Detail 

public WcsMap(int ncoord, int type, int lonax, int latax)
ncoord
 The number of coordinate values for each point to be
transformed (i.e. the number of dimensions of the space in
which the points will reside). This must be at least 2. The
same number is applicable to both input and output points.type
 the type of FITSWCS projection to apply.
One of the WcsMap constants (static final int fields) should
be given for this value, e.g. WcsMap.AST__TAN for a tangent plane
projection. You should consult the FITSWCS paper for the
meaning of the available projections.lonax
 The index of the longitude axis. This should lie in the range
1 to "ncoord".latax
 The index of the latitude axis. This should lie in the range
1 to "ncoord" and be distinct from "lonax".
AstException
 if an error occurred in the AST libraryMethod Detail 

public float getNatLat()
FITSWCS paper II introduces the concept of a "fiducial point" which is logical distinct from the projection reference point. It is easy to confuse the use of these two points. The fiducial point is the point which has celestial coordinates given by the CRVAL FITS keywords. The native spherical coordinates for this point default to the values of the NatLat and NatLon, but these defaults mey be overridden by values stored in the PVi_j keywords. Put another way, the CRVAL keywords will by default give the celestial coordinates of the projection reference point, but may refer to some other point if alternative native longitude and latitude values are provided through the PVi_j keywords.
The NatLat attribute is readonly.
public float getNatLon()
The NatLon attribute is readonly.
public float getPVi_m()
These projection parameters correspond exactly to the values stored using the FITSWCS keywords "PV1_1", "PV1_2", etc. This means that projection parameters which correspond to angles must be given in degrees (despite the fact that the angular coordinates and other attributes used by a WcsMap are in radians).
The set of projection parameters used by a WcsMap depends on the type of projection, which is determined by its WcsType parameter. Most projections either do not require projection parameters, or use parameters 1 and 2 associated with the latitude axis. You should consult the FITSWCS paper for details.
Some projection parameters have default values (as defined in the FITSWCS paper) which apply if no explicit value is given. You may omit setting a value for these "optional" parameters and the default will apply. Some projection parameters, however, have no default and a value must be explicitly supplied. This is most conveniently done using the "options" argument of astWcsMap (q.v.) when a WcsMap is first created. An error will result when a WcsMap is used to transform coordinates if any of its required projection parameters has not been set and lacks a default value.
A "get" operation for a parameter which has not been assigned a value will return the default value defined in the FITSWCS paper, or AST__BAD if the paper indicates that the parameter has no default. A default value of zero is returned for parameters which are not accessed by the projection.
Note, the FITSWCS paper reserves parameters 1 and 2 on the longitude axis to hold the native longitude and latitude of the fiducial point of the projection, in degrees. The default values for these parameters are determined by the projection type. The ASTspecific TPN projection does not use this convention  all projection parameters for both axes are used to represent polynomical correction terms, and the native longitude and latitude at the fiducial point may not be changed from the default values of zero and 90 degrees.
public void setPVi_m(float pVi_m)
These projection parameters correspond exactly to the values stored using the FITSWCS keywords "PV1_1", "PV1_2", etc. This means that projection parameters which correspond to angles must be given in degrees (despite the fact that the angular coordinates and other attributes used by a WcsMap are in radians).
The set of projection parameters used by a WcsMap depends on the type of projection, which is determined by its WcsType parameter. Most projections either do not require projection parameters, or use parameters 1 and 2 associated with the latitude axis. You should consult the FITSWCS paper for details.
Some projection parameters have default values (as defined in the FITSWCS paper) which apply if no explicit value is given. You may omit setting a value for these "optional" parameters and the default will apply. Some projection parameters, however, have no default and a value must be explicitly supplied. This is most conveniently done using the "options" argument of astWcsMap (q.v.) when a WcsMap is first created. An error will result when a WcsMap is used to transform coordinates if any of its required projection parameters has not been set and lacks a default value.
A "get" operation for a parameter which has not been assigned a value will return the default value defined in the FITSWCS paper, or AST__BAD if the paper indicates that the parameter has no default. A default value of zero is returned for parameters which are not accessed by the projection.
Note, the FITSWCS paper reserves parameters 1 and 2 on the longitude axis to hold the native longitude and latitude of the fiducial point of the projection, in degrees. The default values for these parameters are determined by the projection type. The ASTspecific TPN projection does not use this convention  all projection parameters for both axes are used to represent polynomical correction terms, and the native longitude and latitude at the fiducial point may not be changed from the default values of zero and 90 degrees.
pVi_m
 the PVi_m attribute of this objectpublic int getWcsType()
The WcsType
attribute specifies which type of
FITSWCS projection will be performed by this WcsMap
.
Its value will be one of the constants (static final int fields)
defined by this class, e.g. WcsMap.AST__TAN for a tangent plane
projection. Its value is the one set when the WcsMap was created.
public int getWcsAxis(int lonlat)
If "lonlat" is 1, the index of the longitude axis is returned. Otherwise, if it is 2, the index of the latitude axis is returned.
lonlat
 if lonlat=1 the index of the longitude axis is returned,
if lonlat=2 the index of the latitude axis is returned.
IndexOutOfBoundsException
 if lonlat is neither 1 or 2.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 