

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.jscience.astronomy.solarsystem.AstronomicalCoordinates
public class AstronomicalCoordinates
The AstronomyCoordinates
class is for storage of an array of positions in
space, such as those of satellites, planets or stars. The position stored
is rectangular, and the unit is Gm. Typical heights above sea level are
then 10^{9}, while c/H, the speed of light divided by the Hubble
constant, is 10^{26}. The radius of a proton would be on the
order of 10^{24}. So this is a sensible unit to describe
anything in the Universe. All these numbers are within the range of a
double precision number, most probably even their fourth powers are.
The epoch (state of proper motion for stars, time for which the ephemeris of a comet etc is caltulated, etc.) is unspecified. The positions refer to the mean equinox of J2000.0. Hence the state of precession is known and the state of nutation ignored. Positions beyond the Solar System are heliocentric, i.e. parallax and annual aberration are not applied. Positions within the Solar System are mean geocentric astrometric, i.e. the light travel time from the planet to the Earth has been corrected for, but annual aberration is not applied.
The positions can be stored and retrieved in a variety of coordinate systems other than J2000, which is used internally. But in all cases we deal with mean rather than true and astrometric positions rather than true, apparent or observed positions. The coordinate systems we deal with form a logical sequence of four with three branches. Arguably you could rearange this into a sequence of six with one branch:
B1950  J2000  mean  topo.       gal. ecl. hori.
An overview of terms used in stellar and planetary coordinates seems useful here. For stars:
For planets the terminology is a little different. Planetary ephemeris are often expressed in the mean equinox and ecliptic of date, meaning they use the orientation of ecliptic and equator as it is at the time for which the ephemeris is valid.
Sputnik uses mean positions for stars and astrometric positions for planets. In converting to topocentre, Sputnik ignores nutation, all three annual effects, diurnal aberration and polar motion. Refraction is taken into account only for calculating rise and set times.
Copyright: © 20022003 Horst Meyerdierks.
This programme 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 programme 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 programme; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id: AstronomicalCoordinates.java,v 1.2 2007/11/13 22:35:06 virtualcall Exp $
org.jscience.astronomy.solarsystem
Constructor Summary  

AstronomicalCoordinates()


AstronomicalCoordinates(double[] coords)


AstronomicalCoordinates(double x,
double y,
double z)

Method Summary  

static double[] 
convertB1950ToGalactic(double[] inTriplet)
Convert B1950 to galactic coordinates. 
static double[] 
convertB1950ToJ2000(double[] inTriplet)
Convert B1950 to J2000 coordinates. 
static double[] 
convertEclipticToMean(JulianTime aEquinox,
double[] inTriplet)
Convert equinox of date ecliptic coordinates to RA/Dec. 
static double[] 
convertGalacticToB1950(double[] inTriplet)
Convert galactic to B1950 coordinates. 
static double[] 
convertHorizontalToTopocentric(EarthStation aStation,
double[] inTriplet)
Convert azimuth and elevation to HA/Dec. 
static double[] 
convertJ2000ToB1950(double[] inTriplet)
Convert J2000 to B1950 coordinates. 
static double[] 
convertJ2000ToMean(JulianTime aEquinox,
double[] inTriplet)
Convert J2000 to equinox of date coordinates. 
static double[] 
convertMeanToEcliptic(JulianTime aEquinox,
double[] inTriplet)
Convert equinox of date RA/Dec to ecliptic coordinates. 
static double[] 
convertMeanToJ2000(JulianTime aEquinox,
double[] inTriplet)
Convert equinox of date to J2000 coordinates. 
static double[] 
convertMeanToTopocentric(EarthStation aStation,
JulianTime time,
double[] inTriplet)
Convert geocentric RA/Dec to topocentric HA/Dec. 
static double[] 
convertTopocentricToHorizontal(EarthStation aStation,
double[] inTriplet)
Convert HA/Dec to azimuth and elevation. 
static double[] 
convertTopocentricToMean(EarthStation aStation,
JulianTime time,
double[] inTriplet)
Convert topocentric HA/Dec to geocentric RA/Dec. 
static double[] 
getHorizontal(EarthStation aStation,
JulianTime time,
double[] aTriplet)
Get the horizontal spherical coordinates. 
double[] 
getJ2000()

double[] 
getPosition()
Defines the position in an unspecified manner. 
static double[] 
getTopocentric(EarthStation aStation,
JulianTime time,
double[] aTriplet)
Get the topocentric spherical coordinates. 
static double 
obliquity(JulianTime aTime)
Obliquity of the ecliptic. 
void 
setB1950(double[] aTriplet)
Set the B1950 rectangular coordinates. 
void 
setEcliptic(JulianTime aEquinox,
double[] aTriplet)
Set the mean equinoxofdate ecliptic rectangular coordinates. 
void 
setGalactic(double[] aTriplet)
Set the galactic rectangular coordinates. 
void 
setHorizontal(EarthStation aStation,
JulianTime time,
double[] aTriplet)
Set the horizontal rectangular coordinates. 
void 
setJ2000(double[] aTriplet)
Set the J2000 rectangular coordinates. 
void 
setMean(JulianTime aEquinox,
double[] aTriplet)
Set the mean equinoxofdate rectangular coordinates. 
void 
setTopocentric(EarthStation aStation,
JulianTime time,
double[] aTriplet)
Set the topocentric HA/Dec rectangular coordinates. 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public AstronomicalCoordinates()
public AstronomicalCoordinates(double x, double y, double z)
public AstronomicalCoordinates(double[] coords)
Method Detail 

public double[] getJ2000()
public double[] getPosition()
Positioned
getPosition
in interface Positioned
public static final double[] convertB1950ToGalactic(double[] inTriplet)
This method does not change the state, it merely operates on aNpos given triplets to generate aNpos returned triplets.
The transform uses Euler angles of 282.25°, 327° and 62.6°. The last of these is the inclination of the galactic plane, as the galactic pole is defined to be at declination 27.4°. The second angle comes from the distance of 33° between the Galactic Centre and the node of the galactic plane with the equator. The first angle is 90° larger than the right ascension of the galactic pole. See e.g. Jean Meeus, 1991, Astronomical Algorithms, WillmannBell, Richmond VA, p.89f.
The matrix to transform from B1950 to galactic is
M_{11} = cos(282.25°) cos(327°)
 sin(282.25°) sin(327°) cos(62.6°)
M_{12} = sin(282.25°) cos(327°)
+ cos(282.25°) sin(327°) cos(62.6°)
M_{13} = sin(327°) sin(62.6°)
M_{21} = cos(282.25°) sin(327°)
 sin(282.25°) cos(327°) cos(62.6°)
M_{22} = sin(282.25°) sin(327°)
+ cos(282.25°) cos(327°) cos(62.6°)
M_{23} = cos(327°) sin(62.6°)
M_{31} = sin(282.25°) sin(62.6°)
M_{32} = cos(282.25°) sin(62.6°)
M_{33} = cos(62.6°)
inTriplet
 Array of 3*aNpos given numbers, each group of three forming an xyz
position in Gm.
public static final double[] convertB1950ToJ2000(double[] inTriplet)
This method does not change the state, it merely operates on aNpos given triplets to generate aNpos returned triplets.
Jean Meeus, 1991, Astronomical Algorithms, WillmannBell, Richmond VA, p.130. illustrates the conversion from FK4 to FK5 and in particular from B1950 FK4 to a Julian epoch and FK5. In that case his start epoch is signified by T = 0.5. We specialise further and fix the end to J2000, hence the epoch difference is t = 0.5, also.
T = (B1950.0  B1900.0) / 100 = 0.5
t = (J2000.0  B1950.0) / 100 = 0.5
ζ = (2304.250 + 1.396 T) t
+ 0.302 t^{2}
+ 0.018 t^{3}
z/" = ζ/"
+ 0.791 t^{2}
+ 0.001 t^{3}
θ = (2004.682  0.853 T) t
 0.426 t^{2}
 0.042 t^{3}
ζ = 1152.552"
z = 1152.750"
θ = 1002.016"
Jean Meeus, 1991, Astronomical Algorithms, WillmannBell, Richmond VA, p.126, does not give the transform matrix. From USNO/RGO, 1990, The Astronomical Almanach for the Year 1992, U.S. Government Printing Office, Washington DC, Her Majesty's Stationery Office, London, p.B18, we presume that for transfrom from T to T+t it is:
M_{11} = cos(ζ) * cos(θ) * cos(z)
 sin(ζ) * sin(z)
M_{12} = sin(ζ) * cos(θ) * cos(z)
 cos(ζ) * sin(z)
M_{13} = sin(θ) * cos(z)
M_{21} = cos(ζ) * cos(θ) * sin(z)
+ sin(ζ) * cos(z)
M_{22} = sin(ζ) * cos(θ) * sin(z)
+ cos(ζ) * cos(z)
M_{23} = sin(θ) * sin(z)
M_{31} = cos(ζ) * sin(θ)
M_{32} = sin(ζ) * sin(θ)
M_{33} = cos(θ)
Returning to Jean Meeus, 1991, Astronomical Algorithms, WillmannBell, Richmond VA, p.130, dealing with the precession between 1950 and 2000 like this is not sufficient. We have to add to the right ascension the equinox correction
Δα = (0.0775 + 0.0850 T) s = 1.8"
inTriplet
 Array of 3*aNpos given numbers, each group of three forming an xyz
position in Gm.
public static final double[] convertEclipticToMean(JulianTime aEquinox, double[] inTriplet)
See also convertMeanToEcliptic
.
public static final double[] convertGalacticToB1950(double[] inTriplet)
See also convertB1950ToGalactic
.
public static final double[] getHorizontal(EarthStation aStation, JulianTime time, double[] aTriplet)
This retrieves the position stored with conversion to horizontal spherical coordinates (azimuth and elevation).
aStation
 The time and location of the observatory. The station clock is also
the date of the equinox.
public static final double[] getTopocentric(EarthStation aStation, JulianTime time, double[] aTriplet)
This retrieves the position stored with conversion to topocentric spherical coordiaates (hour angle and declination).
aStation
 The time and location of the observatory. The station clock is also
the date of the equinox.
public static final double[] convertHorizontalToTopocentric(EarthStation aStation, double[] inTriplet)
The transform is
( ( ( 
x' y' z' 
) ) ) 
=  ( ( ( 
sin(φ) 0 cos(φ) 
0 1 0 
cos(φ) 0 sin(φ) 
) ) ) 
( ( ( 
x" y" z" 
) ) ) 
The matrix here includes an inversion of the x and y axes, which amounts to a rotation by 180 degrees about the z axis. This takes account of the fact that azimuth counts from North while hour angle counts from South. Both count retrograde (clockwise).
aStation
 The location of the observatory.inTriplet
 Array of 3 given numbers, forming an xyz
position in Gm.
public static final double[] convertJ2000ToB1950(double[] inTriplet)
See also B19502J2000
.
public static final double[] convertJ2000ToMean(JulianTime aEquinox, double[] inTriplet)
This method does not change the state, it merely operates on aNpos given triplets to generate aNpos returned triplets.
The transform uses a matrix calculated from USNO/RGO, 1990, The Astronomical Almanach for the Year 1992, U.S. Government Printing Office, Washington DC, Her Majesty's Stationery Office, London, p.B18.
t = (Ep  J2000.0) / 100
ζ/°
= 0.6406161 t + 8.39 10^{5} t^{2}
+ 5 10^{6} t^{3}
z/° = 0.6406161 t + 3.041 10^{4} t^{2}
+ 5.1 10^{6} t^{3}
θ/°
= 0.556753 t  1.185 10^{4} t^{2}
 1.16 10^{5} t^{3}
M_{11} = cos(ζ) * cos(θ) * cos(z)
 sin(ζ) * sin(z)
M_{12} = sin(ζ) * cos(θ) * cos(z)
 cos(ζ) * sin(z)
M_{13} = sin(θ) * cos(z)
M_{21} = cos(ζ) * cos(θ) * sin(z)
+ sin(ζ) * cos(z)
M_{22} = sin(ζ) * cos(θ) * sin(z)
+ cos(ζ) * cos(z)
M_{23} = sin(θ) * sin(z)
M_{31} = cos(ζ) * sin(θ)
M_{32} = sin(ζ) * sin(θ)
M_{33} = cos(θ)
This matrix transforms from J2000 to Ep. The inverse transform is achieved with the transposed matrix.
aEquinox
 The equinox to which the returned coordinates should refer.inTriplet
 Array of 3*aNpos given numbers, each group of three forming an xyz
position in Gm.
public static final double[] convertMeanToEcliptic(JulianTime aEquinox, double[] inTriplet)
This method does not change the state, it merely operates on aNpos given triplets to generate aNpos returned triplets.
The matrix to transform from RA/Dec to ecliptic is
M =  ( ( ( 
1 0 0 
0 cos(ε) sin(ε) 
0 sin(ε) cos(ε) 
) ) ) 
aEquinox
 The equinox to which the given coordinates refer, also the time for
which the obliquity of the ecliptic needs to be calculated.inTriplet
 Array of 3*aNpos given numbers, each group of three forming an xyz
position in Gm.
public static final double[] convertMeanToJ2000(JulianTime aEquinox, double[] inTriplet)
See also convertJ2000ToMean
.
public static final double[] convertMeanToTopocentric(EarthStation aStation, JulianTime time, double[] inTriplet)
This method does not change the state, it merely operates on aNpos given triplets to generate aNpos returned triplets.
The transform is
( ( ( 
x' y' z' 
) ) ) 
=    ( ( ( 
itsX 0 itsZ 
) ) ) 
+  ( ( ( 
cos(LST) sin(LST) 0 
sin(LST) cos(LST) 0 
0 0 1 
) ) ) 
( ( ( 
x y z 
) ) ) 
The matrix here includes an inversion of the topocentric y' axis. While the geocentric y axis points towards Orion, the topocentric y' axis points to the West point on the horizon. Therefore RA = atan(y/x) counts direct (counterclockwise), but HA = atan(y'/x') counts retrograde (clockwise).
aStation
 The time and location of the observatory. There is an assumption that
the given geocentric coordinates are mean RA/Dec for the equinox of the
same date as the station clock shows.inTriplet
 Array of 3*aNpos given numbers, each group of three forming an xyz
position in Gm.
public static final double obliquity(JulianTime aTime)
We use the expression from Jean Meeus, 1991, Astronomical Algorithms, WillmannBell, Richmond VA, p.135:
U = (Ep  2000) / 10000
ε
= 23° + 26'
+ (21.448
 4680.93 U
 1.55 U^{2}
+ 1999.25 U^{3}
 51.38 U^{4}
 249.67 U^{5}
 39.05 U^{6}
+ 7.12 U^{7}
+ 27.87 U^{8}
+ 5.79 U^{9}
+ 2.45 U^{10})"
aTime
 The time for which the obliquity (w.r.t. the equator and equinox of
date) is required.public final void setB1950(double[] aTriplet)
This sets the position stored from the given B1950/FK4 coordinates. Conversion to J2000 for internal storage is performed.
aTriplet
 Three floating point numbers containing the x, y and z coordinates.
These should normally be in Gm.public final void setEcliptic(JulianTime aEquinox, double[] aTriplet)
This sets the position stored from the given mean ecliptic coordinates. Conversion to J2000 for internal storage is performed.
aEquinox
 The equinox to which the given coordinates refer, also the time for
which the obliquity of the ecliptic needs to be calculated.aTriplet
 Three floating point numbers containing the x, y and z coordinates.
These should normally be in Gm.public final void setGalactic(double[] aTriplet)
This sets one stored position from the given galactic coordinates. Conversion to J2000 for internal storage is performed.
aTriplet
 Three floating point numbers containing the x, y and z coordinates.
These should normally be in Gm.public final void setHorizontal(EarthStation aStation, JulianTime time, double[] aTriplet)
This sets the position stored from the given horizontal coordinates. Conversion to J2000 for internal storage is performed.
aStation
 The time and location of the observatory. The station clock is also
the date of the equinox.aTriplet
 Three floating point numbers containing the x, y and z coordinates.
These should normally be in Gm. Note that the coordinates are
lefthanded and that azimuth counts from North, i.e. the x axis points
to the North point and the y axis points to the East point on the
horizon.public final void setJ2000(double[] aTriplet)
This sets the position stored from the given J2000/FK5 coordinates.
aTriplet
 Three floating point numbers containing the x, y and z coordinates.
These should normally be in Gm.public final void setMean(JulianTime aEquinox, double[] aTriplet)
This sets the position stored from the given mean coordinates for the equinox of date. The date of the equinox also needs to be given. Conversion to J2000 for internal storage is performed.
aEquinox
 The equinox to which the given coordinates refer.aTriplet
 Three floating point numbers containing the x, y and z coordinates.
These should normally be in Gm.public final void setTopocentric(EarthStation aStation, JulianTime time, double[] aTriplet)
This sets the position stored from the given topocentric coordinates. Conversion to J2000 for internal storage is performed.
aStation
 The time and location of the observatory. The station clock is also
the date of the equinox.aTriplet
 Three floating point numbers containing the x, y and z coordinates.
These should normally be in Gm. Note that the coordinates are
lefthanded, i.e. the y axis points to the West point on the horizon.public static final double[] convertTopocentricToHorizontal(EarthStation aStation, double[] inTriplet)
This method does not change the state, it merely operates on aNpos given triplets to generate aNpos returned triplets.
The transform is
( ( ( 
x" y" z" 
) ) ) 
=  ( ( ( 
sin(φ) 0 cos(φ) 
0 1 0 
cos(φ) 0 sin(φ) 
) ) ) 
( ( ( 
x' y' z' 
) ) ) 
The matrix here includes an inversion of the x and y axes, which amounts to a rotation by 180 degrees about the z axis. This takes account of the fact that azimuth counts from North while hour angle counts from South. Both count retrograde (clockwise).
aStation
 The location of the observatory.inTriplet
 Array of 3*aNpos given numbers, each group of three forming an xyz
position in Gm.
public static final double[] convertTopocentricToMean(EarthStation aStation, JulianTime time, double[] inTriplet)
This method does not change the state, it merely operates on aNpos given triplets to generate aNpos returned triplets.
The transform is
( ( ( 
x y z 
) ) ) 
=  ( ( ( 
cos(LST) sin(LST) 0 
sin(LST) cos(LST) 0 
0 0 1 
) ) ) 
( ( ( 
x' + itsX y' z' + itsZ 
) ) ) 
The matrix here includes an inversion of the topocentric y' axis. While the geocentric y axis points towards Orion, the topocentric y' axis points to the West point on the horizon. Therefore RA = atan(y/x) counts direct (counterclockwise), but HA = atan(y'/x') counts retrograde (clockwise).
aStation
 The time and location of the observatory. There is an assumption that
the given geocentric coordinates are mean RA/Dec for the equinox of the
same date as the station clock shows.inTriplet
 Array of 3*aNpos given numbers, each group of three forming an xyz
position in Gm.


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