uk.ac.starlink.coco
Class CoordinateConversion

java.lang.Object
  extended by uk.ac.starlink.coco.CoordinateConversion

public class CoordinateConversion
extends Object

Converts Coordinates between various systems.


Constructor Summary
CoordinateConversion()
          Start a new instance of the CoordinateConversion Loads the Pal Library.
CoordinateConversion(char in, char out)
          The main constuctor, loads the Pal Library.
 
Method Summary
 String convert(AngleDR ra)
          Convert the angle into the output system.
 String convert(String data)
          Convert the coordinates
 AngleDR normalize(AngleDR ra)
          Normalize the input angle to FK5.
 void setDegrees()
          Set input and output angles to degrees format.
 void setHigh()
          Set High precision results.
 void setHours()
          Set input and output angles to hours format ( ie H M S ).
 void setInEpoch(String ep)
          Set the input Epoch.
 void setInEquinox(String eq)
          Set the input Equinox.
 void setInSystem(char in)
          Set the input System.
 void setLow()
          Set Low precision results.
 void setMedium()
          Set Medium precision results.
 void setOutEpoch(String ep)
          Set the output Epoch.
 void setOutEquinox(String eq)
          Set the output Equinox.
 void setOutSystem(char out)
          Set the output System.
 void setPrecision(char prec)
           
 void setPrecision(String prec)
          Set the precision.
 void setUnits(char unit)
           
 void setUnits(String unit)
          Set the RA mode.
 AngleDR validate(String value)
          Validate a coordinate string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoordinateConversion

public CoordinateConversion()
Start a new instance of the CoordinateConversion Loads the Pal Library.


CoordinateConversion

public CoordinateConversion(char in,
                            char out)
The main constuctor, loads the Pal Library.

Parameters:
in - The input system code
out - The Output System code
Method Detail

convert

public String convert(String data)
Convert the coordinates

Parameters:
data - The Coordinates to convert
Returns:
The converted coordinates as a string

setInSystem

public void setInSystem(char in)
Set the input System.

Parameters:
in - The input system.

Allowable systems are:

4
Mean [alpha, delta], old system, with E-terms (loosely FK4, usually B1950) (default)
5
Mean [alpha, delta], old system, no E-terms (some radio positions)
A
Mean [alpha, delta], new system (loosely FK5, usually J2000)
B
Geocentric apparent [alpha, delta], new system
E
Ecliptic coordinates [lamda, beta], new system (mean of date)
G
Galactic coordinates [l, b], IAU 1958 system


setInEpoch

public void setInEpoch(String ep)
Set the input Epoch.

Parameters:
ep - The epoch, eg. 1984.53 or 1983 2 26.4

setInEquinox

public void setInEquinox(String eq)
Set the input Equinox.

Parameters:
ep - The epoch, eg. 1950 (optional B or J prefix)

setOutSystem

public void setOutSystem(char out)
Set the output System.

Parameters:
out - The output system.

Allowable systems are:

4
Mean [alpha, delta], old system, with E-terms (loosely FK4, usually B1950)
5
Mean [alpha, delta], old system, no E-terms (some radio positions)
A
Mean [alpha, delta], new system (loosely FK5, usually J2000) (default)
B
Geocentric apparent [alpha, delta], new system
E
Ecliptic coordinates [lamda, beta], new system (mean of date)
G
Galactic coordinates [l, b], IAU 1958 system


setOutEpoch

public void setOutEpoch(String ep)
Set the output Epoch.

Parameters:
ep - The epoch, eg. 1984.53 or 1983 2 26.4

setOutEquinox

public void setOutEquinox(String eq)
Set the output Equinox.

Parameters:
ep - The epoch, eg. 1950 (optional B or J prefix)

setHigh

public void setHigh()
Set High precision results.


setMedium

public void setMedium()
Set Medium precision results.


setLow

public void setLow()
Set Low precision results.


setPrecision

public void setPrecision(String prec)
Set the precision.

Parameters:
prec - Precision of results, either 'H', 'M' (default) or 'L'

setPrecision

public void setPrecision(char prec)

setDegrees

public void setDegrees()
Set input and output angles to degrees format.


setHours

public void setHours()
Set input and output angles to hours format ( ie H M S ).


setUnits

public void setUnits(String unit)
Set the RA mode.

Parameters:
unit - The RA Mode, either 'D' or 'H' (default).

setUnits

public void setUnits(char unit)

validate

public AngleDR validate(String value)
Validate a coordinate string.

Parameters:
value - The coordinate string.
Returns:
The angle in the FK5 system (null if invalid)

normalize

public AngleDR normalize(AngleDR ra)
Normalize the input angle to FK5.

Parameters:
ra - The angle in specified input system.
Returns:
The angle in the FK5 system

convert

public String convert(AngleDR ra)
Convert the angle into the output system.

Parameters:
ra - The angle in the FK5 system.
Returns:
The coordinates in the requested output system


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