Terrenus HRPT v2.2

terrenus.orbit
Class AbstractSpacecraft

java.lang.Object
  extended by terrenus.orbit.AbstractSpacecraft
All Implemented Interfaces:
Spacecraft
Direct Known Subclasses:
FY1Spacecraft, NOAAKLMSpacecraft

public abstract class AbstractSpacecraft
extends java.lang.Object
implements Spacecraft

The AbstractSpacecraft class implements some of the main methods of the Spacecraft interface to deliver position, velocity, hour angle, name, and launch date. Subclasses must implement the Spacecraft.getInstruments() method.


Constructor Summary
AbstractSpacecraft(int noradId)
          Creates a new spacecraft using the NORAD ID.
 
Method Summary
 double getHourAngle(java.util.Date date)
          Gets the Greenwich hour angle.
 java.util.Date getLaunchDate()
          Gets the spacecraft launch date.
 java.lang.String getName()
          Gets the spacecraft common name.
 double[] getPosition(java.util.Date date, double[] output)
          Gets the position of the spacecraft in earth-centered inertial coordinates.
 java.lang.String getProperty(java.lang.String name)
          Gets a spacecraft property by name.
 double[] getVelocity(java.util.Date date, double[] output)
          Gets the velocity of the spacecraft in earth-centered inertial coordinates.
static void main(java.lang.String[] argv)
          Tests this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface terrenus.orbit.Spacecraft
getInstruments
 

Constructor Detail

AbstractSpacecraft

public AbstractSpacecraft(int noradId)
Creates a new spacecraft using the NORAD ID.

Parameters:
noradId - the NORAD orbital element ID.
Throws:
java.lang.RuntimeException - if the spacecraft properties cannot be found or parsed.
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Spacecraft
Gets the spacecraft common name.

Specified by:
getName in interface Spacecraft

getHourAngle

public double getHourAngle(java.util.Date date)
Gets the Greenwich hour angle.

Specified by:
getHourAngle in interface Spacecraft
Parameters:
date - the date for Greenwich hour angle retrieval.
Returns:
the Greenwich hour angle in radians.

getPosition

public double[] getPosition(java.util.Date date,
                            double[] output)
Gets the position of the spacecraft in earth-centered inertial coordinates.

Specified by:
getPosition in interface Spacecraft
Parameters:
date - the date for position retrieval.
output - the output position array to fill. If null, an output array is created.
Returns:
the output position array as [x,y,z] in kilometers.

getVelocity

public double[] getVelocity(java.util.Date date,
                            double[] output)
Gets the velocity of the spacecraft in earth-centered inertial coordinates.

Specified by:
getVelocity in interface Spacecraft
Parameters:
date - the date for velocity retrieval.
output - the output velocity array to fill. If null, an output array is created.
Returns:
the output velocity array as [x,y,z] in kilometers/second.

getLaunchDate

public java.util.Date getLaunchDate()
Description copied from interface: Spacecraft
Gets the spacecraft launch date.

Specified by:
getLaunchDate in interface Spacecraft

getProperty

public java.lang.String getProperty(java.lang.String name)
Description copied from interface: Spacecraft
Gets a spacecraft property by name.

Specified by:
getProperty in interface Spacecraft
Parameters:
name - the name of the property.
Returns:
the property value or null if no property with the specified name exists.

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Tests this class.

Throws:
java.lang.Exception

Terrenus HRPT v2.2