|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.astronomy.Station
org.jscience.astronomy.solarsystem.EarthStation
public class EarthStation
The Station class represents an observatory (a location on
the Earth's surface) that has a clock.
Copyright: © 2002, 2004 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: EarthStation.java,v 1.3 2007/10/21 21:07:05 virtualcall Exp $
org.jscience.astronomy.solarsystem.sputnik| Constructor Summary | |
|---|---|
EarthStation()
Initialise the object. |
|
EarthStation(java.lang.String name,
double longitude,
double latitude,
double height)
Initialise the object. |
|
| Method Summary | |
|---|---|
void |
commandRead(java.lang.String aCommand)
Serve the station/read command. |
JulianTime |
getLocalSideralTime(JulianTime time)
Return local sidereal time. |
double[] |
getLocalSideralTimeAshms(JulianTime time)
Return local sidereal time as triplet. |
double[] |
getX0Z()
Return the station rectangular position. |
void |
readByName(java.lang.String aFileName,
java.lang.String aName)
Read Station from file. |
void |
setGeodetic(java.lang.String aName,
double aLong,
double aLat,
double aHeight)
Set the station parameters. |
void |
setXYZ(java.lang.String aName,
double[] aTriplet)
Set the station rectangular position. |
void |
showToFile(java.io.PrintStream aFile,
JulianTime time)
Display the position and time in various representations. |
| Methods inherited from class org.jscience.astronomy.Station |
|---|
getHeight, getLatitude, getLongitude, getName, setHeight, setLatitude, setLongitude, setName, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EarthStation()
This initialises the JulianTime part, then sets the location to Edinburgh.
public EarthStation(java.lang.String name,
double longitude,
double latitude,
double height)
| Method Detail |
|---|
public void commandRead(java.lang.String aCommand)
throws java.lang.Exception,
java.io.IOException
station/read command.
This reads the parameters of the observatory location from a file. The command line includes both the file name and the name of the station to look for in the file. The file with a station list looks somewhat like this:
# List of observatories, one per line. # East longitude [deg], # north latitude [deg], # altitude above geoid [m], # name (in a pair of double quotes). +6.723 +50.570 435 "Stockert" +6.885 +50.527 369 "Effelsberg" -3.183 +55.925 146 "Royal Observatory Edinburgh" -0.528 +44.835 73 "Floirac"
When it is read, the station names in the double quotes are looked for. The line that makes a match with the requested station will then be scanned for the three numbers at the line's beginning. The numbers are longitude and latitude in degrees and height above sea level in metres.
aCommand - The command line, including the parameters to be read.
java.lang.Exception
java.io.IOException
public void readByName(java.lang.String aFileName,
java.lang.String aName)
throws java.lang.Exception,
java.io.IOException
This reads the parameters of the observatory location from a file. The file with a station list looks somewhat like this:
# List of observatories, one per line. # East longitude [deg], # north latitude [deg], # altitude above geoid [m], # name (in a pair of double quotes). +6.723 +50.570 435 "Stockert" +6.885 +50.527 369 "Effelsberg" -3.183 +55.925 146 "Royal Observatory Edinburgh" -0.528 +44.835 73 "Floirac"
When it is read, the station names in the double quotes are looked for. The line that makes a match with the requested station will then be scanned for the three numbers at the line's beginning. The numbers are longitude and latitude in degrees and height above sea level in metres.
aFileName - The name of the file with the station data.aName - The name of the observatory to be looked for in the file.
java.lang.Exception
java.io.IOExceptionpublic final JulianTime getLocalSideralTime(JulianTime time)
This returns the local sidereal time (sidereal time since previous culmination of the mean equinox at the observatory) in hours. LST is the right ascension of the station, which is of course set off from Greenwich by its geographic longitude. Hence:
LST = GST + λ
public final double[] getLocalSideralTimeAshms(JulianTime time)
This returns the local sidereal time (sidereal time since previous
culmination of the mean equinox at the observatory) as a
triplet of hours (0-23), minutes (0-59) and seconds (0-60.0).
See getLocalSideralTime for a definition of LST.
public final double[] getX0Z()
This gives access to the stored fields itsX and itsZ. The second returned number is always zero, as here the x axis is in the meridian of the Station, not of Greenwich. The numbers are in m.
public final void setGeodetic(java.lang.String aName,
double aLong,
double aLat,
double aHeight)
Given the longitude and latitude in radian and the height in m, this will store the numbers in the class instance and calculate the remaining station parameters accordingly. The longitude is normalised to the interval [-π,+π].
Cut through the ellipsoidal geoid along the meridian of the station.
The meridian through the station is an ellipse marking the sea level, or the surface of the geoid. The radii of the geoid are a at the equator and b at the pole. The equation of the ellipse is
(x2 / a2) + (z2 / b2) = 1
The horizon is the tangential plane to the geoid. Since the geoid is an equi-potential surface, the normal to the horizon is defined by the direction of the gravi-centrifugal force. Hence the geodetic latitude can be defined as the elevation of the north celestial pole above the horizon. The equation of the horizon is (Helmut Sieber, 1973, Mathematische Begriffe und Formeln, Klett, Stuttgart)
(x x0 / a2) + (z z0 /b2) = 1
Considering the slope of the horizon we find
cot(φ) = ± (b2 / a2) (x0 / z0)
With some arithmetics these two equations result in expressions of the coordinates as function of the geodetic latitude. The effect of the station's altitude above the geoid is simple to calculate from the geodetic latitude and this all combines to
x1 = h cos(φ) + a [1 - [1 / {1 + (a/b)2 cot2(φ)}]]0.5
z1 = h sin(φ) ± b [1 / {1 + (a/b)2 cot2(φ)}]0.5
φ' = arctan(z1/x1)
r = (x12 + z12)0.5
To give an idea of the magnitude of the difference between geodetic and geocentric latitude, at 56° the geocentric latitude is smaller by 0.18°.
aName - The name of the observatory.aLong - The geographic longitude in rad.aLat - The geodetic latitude in rad.aHeight - The elevation above sea level in m.
public final void setXYZ(java.lang.String aName,
double[] aTriplet)
Given the rectangular coordinates in m this fills in the instance correctly. The x axis points to the Gulf of Guinea (longitude and latitude zero), the y axis to the Indian Ocean and the z axis to the North Pole.
Cut through the ellipsoidal geoid along the meridian of the station.
To convert from geocentric latitude φ' to geodetic (geographic) latitude φ we use the iteration of (USNO/RGO, 1990, The Astronomical Almanach for the Year 1992, U.S. Government Printing Office, Washington DC, Her Majesty's Stationery Office, London, p.K12). The starting value is the geocentric latitude. In the iteration the distance r from the axis and the eccentricity e are used.
r = (x12 + z12)0.5
e2 = 1 - (b/a)2 = 2 f - f2
φ(1) = φ'
C(i) = [1 / {1 - e2 sin2(φ(i))}0.5]
φ(i+1) = arctan[(z + a C(i) e2 sin(φ(i))) / r]
h = [r / cos(φ(∞))] - a C(∞)
aName - The name of the observatory.aTriplet - The geocentric rectangular coordinates in the coordinate system where
the x axis points to the Gulf of Guinea.
public final void showToFile(java.io.PrintStream aFile,
JulianTime time)
This writes information about the currently stored observatory position and time to the given open file. The format is
Observatory: Royal Observatory Edinburgh East long. -3.182500 deg Latitude 55.925000 deg Altitude 146 m UT: 2003-04-21-19:15:33.1 (JD 2452751.302467) TT: 2003-04-21-19:16:38.9 (JDE 2452751.303228) Ep: 2003.302678243 GST 09:13:21.0 = 138.337426 deg LST 09:00:37.2 = 135.154926 deg
aFile - The output stream to which to write the information.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||