public class UsafGeneralPerturbationElements extends Sgp4Elements
The following example shows how to create a Sgp4Propagator
from a CSV-format USAF General Perturbation elements
file.
// Header is not included in USAF General Perturbation elements CSV file.
// See documentation for USAFGeneralPerturbationElements.readFromCsvFile
// to interpret the format.
final String csvGpString =
"U,5,1958-002B,2020,338.9480997,-3.50E-07,,-2.21E-05,,1," +
"3.42E+01,6.61E+01,1.85E-01,3.51E+01,3.36E+02,1.08E+01," +
"22366,5,2.29E-02,3.79E-02,3.39E+02,3.54E+00,1.30E-05,,3.00E+01,PAYLOAD";
StringBuilder builder = new StringBuilder();
builder.append(csvGpString).append(System.lineSeparator());
Sgp4Propagator propagator;
try (BufferedReader reader = new BufferedReader(new StringReader(builder.toString()))) {
ArrayList<UsafGeneralPerturbationElements> csvGpList = UsafGeneralPerturbationElements.readFromCsvFile(reader);
UsafGeneralPerturbationElements csvGp = csvGpList.get(0);
propagator = new Sgp4Propagator(csvGp);
}
Warning: If the EphemerisType
(get
/ set
) is 4, Sgp4Propagator
will throw an exception if the USAF GP elements is input.
Constructor and Description |
---|
UsafGeneralPerturbationElements()
Initializes a new instance.
|
UsafGeneralPerturbationElements(Sgp4Elements elements,
String name,
String satelliteNumber,
String classification,
String internationalDesignator,
double meanMotionDot,
double meanMotionDotDot,
int ephemerisType,
int elementNumber,
int revolutions,
String originalSatelliteNumber,
double solarRadiationParameter,
double ballisticCoefficient,
double lastObservationTime,
double errorGrowthRate,
double energyDissipationRate,
double visualMagnitude,
double radarCrossSection,
GeneralPerturbationObjectType objectType)
Initializes a new instance from a set of
Sgp4Elements and additional
meta-data contained in a USAF General Perturbation file. |
UsafGeneralPerturbationElements(UsafGeneralPerturbationElements existingInstance)
Initializes a new instance as a copy of an existing instance.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone(CopyContext context)
Clones this object using the specified context.
|
double |
getBallisticCoefficient()
Gets the ballistic coefficient or the area times
the drag coefficient divided by the mass.
|
String |
getClassification()
Gets the classification.
|
int |
getElementNumber()
Gets the element number.
|
double |
getEnergyDissipationRate()
Gets the energy dissipation rate of the
satellite due to atmospheric drag in watts/kg.
|
int |
getEphemerisType()
Gets the ephemeris type.
|
JulianDate |
getEpoch()
Gets the epoch at which these initial conditions are defined.
|
double |
getErrorGrowthRate()
Gets the last calculated error growth rate
in kilometers per day.
|
String |
getInternationalDesignator()
Gets the international designator.
|
double |
getLastObservationTime()
Gets the time of last observation that was used
by orbit determination for the satellite.
|
double |
getMeanMotionDot()
Gets the first derivative of mean motion divided by two, in revolutions per day squared.
|
double |
getMeanMotionDotDot()
Gets the second derivative of mean motion divided by six, in revolutions per day cubed.
|
String |
getName()
Gets the spacecraft name.
|
GeneralPerturbationObjectType |
getObjectType()
Gets the type of orbiting body.
|
String |
getOriginalSatelliteNumber()
Gets the original satellite number of
the object.
|
double |
getRadarCrossSection()
Gets the median radar cross section of
the object.
|
double |
getRawEpoch()
Gets the epoch at which these initial conditions are defined,
represented in the standard form:
YYYYDDD.DDDD . |
int |
getRevolutionNumber()
Gets the revolution number at epoch.
|
String |
getSatelliteNumber()
Gets the satellite number.
|
double |
getSolarRadiationParameter()
Gets the AGOM or the area times
the solar radiation pressure coefficient (gamma)
divided by the mass.
|
double |
getVisualMagnitude()
Gets the median visual magnitude of the
object scaled to the standard distance of 35786 km
(elevation of GEO at zenith).
|
static ArrayList<UsafGeneralPerturbationElements> |
readFromCsvFile(BufferedReader reader)
Reads the USAF General Perturbation elements in from a file (most likely a .csv).
|
static ArrayList<UsafGeneralPerturbationElements> |
readFromCsvFile(String filename)
Reads the USAF General Perturbation elements in from a file (most likely a .csv).
|
void |
setBallisticCoefficient(double value)
Sets the ballistic coefficient or the area times
the drag coefficient divided by the mass.
|
void |
setClassification(String value)
Sets the classification.
|
void |
setElementNumber(int value)
Sets the element number.
|
void |
setEnergyDissipationRate(double value)
Sets the energy dissipation rate of the
satellite due to atmospheric drag in watts/kg.
|
void |
setEphemerisType(int value)
Sets the ephemeris type.
|
void |
setEpoch(JulianDate value)
Sets the epoch at which these initial conditions are defined.
|
void |
setErrorGrowthRate(double value)
Sets the last calculated error growth rate
in kilometers per day.
|
void |
setInternationalDesignator(String value)
Sets the international designator.
|
void |
setLastObservationTime(double value)
Sets the time of last observation that was used
by orbit determination for the satellite.
|
void |
setMeanMotionDot(double value)
Sets the first derivative of mean motion divided by two, in revolutions per day squared.
|
void |
setMeanMotionDotDot(double value)
Sets the second derivative of mean motion divided by six, in revolutions per day cubed.
|
void |
setName(String value)
Sets the spacecraft name.
|
void |
setObjectType(GeneralPerturbationObjectType value)
Sets the type of orbiting body.
|
void |
setOriginalSatelliteNumber(String value)
Sets the original satellite number of
the object.
|
void |
setRadarCrossSection(double value)
Sets the median radar cross section of
the object.
|
void |
setRawEpoch(double value)
Sets the epoch at which these initial conditions are defined,
represented in the standard form:
YYYYDDD.DDDD . |
void |
setRevolutionNumber(int value)
Sets the revolution number at epoch.
|
void |
setSatelliteNumber(String value)
Sets the satellite number.
|
void |
setSolarRadiationParameter(double value)
Sets the AGOM or the area times
the solar radiation pressure coefficient (gamma)
divided by the mass.
|
void |
setVisualMagnitude(double value)
Sets the median visual magnitude of the
object scaled to the standard distance of 35786 km
(elevation of GEO at zenith).
|
getArgumentOfPerigee, getBStar, getEccentricity, getInclination, getMeanAnomaly, getMeanMotion, getRightAscensionOfAscendingNode, getSwitchingMethod, setArgumentOfPerigee, setBStar, setEccentricity, setInclination, setMeanAnomaly, setMeanMotion, setRightAscensionOfAscendingNode, setSwitchingMethod
public UsafGeneralPerturbationElements()
public UsafGeneralPerturbationElements(@Nonnull Sgp4Elements elements, String name, String satelliteNumber, String classification, String internationalDesignator, double meanMotionDot, double meanMotionDotDot, int ephemerisType, int elementNumber, int revolutions, String originalSatelliteNumber, double solarRadiationParameter, double ballisticCoefficient, double lastObservationTime, double errorGrowthRate, double energyDissipationRate, double visualMagnitude, double radarCrossSection, @Nonnull GeneralPerturbationObjectType objectType)
Sgp4Elements
and additional
meta-data contained in a USAF General Perturbation file.elements
- The elements specifying the essential orbit ephemeris data.name
- The name of the satellite.satelliteNumber
- The NORAD satellite catalog number, as a string.classification
- The single character classification for the satellite. All civilian
space objects are classified with 'U' for 'Unclassified'.internationalDesignator
- The international catalog number assigned by the
World Data Center-A for Rockets and Satellites.meanMotionDot
- The first time derivative of the mean motion at epoch in revolutions per day.meanMotionDotDot
- The second time derivative of the mean motion at epoch
in revolutions per day squared.ephemerisType
- The ephemeris type of the elements. Ephemeris Type 0 is the correct type for Sgp4Propagator
.
Ephemeris type 4 is not supported by Sgp4Propagator
, and it will throw an argument exception
if a UsafGeneralPerturbationElements
has ephemeris type 4.elementNumber
- A number assigned to indicate the number of times this ephemeris has been regenerated.revolutions
- The number of times the spacecraft has passed through its ascending node (since launch).originalSatelliteNumber
- The original satellite number of the object. This is often the same as
the satelliteNumber
.solarRadiationParameter
- The AGOM or the area times the solar radiation pressure coefficient (gamma)
divided by the mass. This value has the units of m^2/kg.ballisticCoefficient
- The ballistic coefficient or the area times the drag coefficient divided by the mass.
This value has the units of m^2/kg.lastObservationTime
- The time of last observation that was used by orbit determination for the satellite.
This time is in +/- fractional days relative to the Epoch
(get
/ set
).errorGrowthRate
- The last calculated error growth rate in kilometers per day.energyDissipationRate
- The energy dissipation rate of the
satellite due to atmospheric drag in watts/kg.visualMagnitude
- The median visual magnitude of the object scaled to the standard distance of 35786 km
(elevation of GEO at zenith). This value is used regardless of the sensor to satellite geometry.radarCrossSection
- The median radar cross section of the object.objectType
- The type of orbiting body.ArgumentNullException
- Thrown when elements
is null
.public UsafGeneralPerturbationElements(@Nonnull UsafGeneralPerturbationElements existingInstance)
existingInstance
- The existing instance to copy.ArgumentNullException
- Thrown when existingInstance
is null
.public Object clone(CopyContext context)
This method should be implemented to call a copy constructor on the class of the
object being cloned. The copy constructor should take the CopyContext
as a parameter
in addition to the existing instance to copy. The copy constructor should first call
CopyContext.addObjectMapping(T, T)
to identify the newly constructed instance
as a copy of the existing instance. It should then copy all fields, using
CopyContext.updateReference(T)
to copy any reference fields.
A typical implementation of ICloneWithContext
:
public static class MyClass implements ICloneWithContext {
public MyClass(MyClass existingInstance, CopyContext context) {
context.addObjectMapping(existingInstance, this);
someReference = context.updateReference(existingInstance.someReference);
}
@Override
public final Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
}
In general, all fields that are reference types should be copied with a call to
CopyContext.updateReference(T)
. There are a couple of exceptions:
If one of these exceptions applies, the CopyContext
should be given an opportunity
to update the reference before the reference is copied explicitly. Use
CopyContext.updateReference(T)
to update the reference. If CopyContext.updateReference(T)
returns
the original object, indicating that the context does not have a replacement registered,
then copy the object manually by invoking a Clone method, a copy constructor, or by manually
constructing a new instance and copying the values.
alwaysCopy = context.updateReference(existingInstance.alwaysCopy);
if (existingInstance.alwaysCopy != null && alwaysCopy == existingInstance.alwaysCopy) {
alwaysCopy = (AlwaysCopy) existingInstance.alwaysCopy.clone(context);
}
If you are implementing an evaluator (a class that implements IEvaluator
), the
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
method shares some responsibilities with the
copy context constructor. Code duplication can be avoided by doing the following:
CopyContext.updateReference(T)
. You should still call CopyContext.updateReference(T)
on any references to
non-evaluators.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as the last line in the constructor and pass it the
same CopyContext
passed to the constructor.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as normal. See the reference documentation for
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
for more information on implementing that method.
public MyClass(MyClass existingInstance, CopyContext context) {
super(existingInstance, context);
someReference = context.updateReference(existingInstance.someReference);
evaluatorReference = existingInstance.evaluatorReference;
updateEvaluatorReferences(context);
}
@Override
public void updateEvaluatorReferences(CopyContext context) {
evaluatorReference = context.updateReference(evaluatorReference);
}
@Override
public Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
private IEvaluator evaluatorReference;
clone
in interface ICloneWithContext
clone
in class Sgp4Elements
context
- The context to use to perform the copy.@Nonnull public JulianDate getEpoch()
getEpoch
in class Sgp4Elements
public void setEpoch(@Nonnull JulianDate value)
setEpoch
in class Sgp4Elements
public double getRawEpoch()
YYYYDDD.DDDD
.getRawEpoch
in class Sgp4Elements
public void setRawEpoch(double value)
YYYYDDD.DDDD
.setRawEpoch
in class Sgp4Elements
public final String getName()
public final void setName(String value)
public final double getMeanMotionDot()
public final void setMeanMotionDot(double value)
public final double getMeanMotionDotDot()
public final void setMeanMotionDotDot(double value)
public final int getRevolutionNumber()
public final void setRevolutionNumber(int value)
public final String getSatelliteNumber()
public final void setSatelliteNumber(String value)
public final int getEphemerisType()
Sgp4Propagator
.
Ephemeris type 4 is not supported by Sgp4Propagator
, and it will throw an argument exception
if a UsafGeneralPerturbationElements
has ephemeris type 4.public final void setEphemerisType(int value)
Sgp4Propagator
.
Ephemeris type 4 is not supported by Sgp4Propagator
, and it will throw an argument exception
if a UsafGeneralPerturbationElements
has ephemeris type 4.public final String getClassification()
public final void setClassification(String value)
public final String getInternationalDesignator()
public final void setInternationalDesignator(String value)
public final int getElementNumber()
public final void setElementNumber(int value)
public final String getOriginalSatelliteNumber()
public final void setOriginalSatelliteNumber(String value)
public final double getSolarRadiationParameter()
public final void setSolarRadiationParameter(double value)
public final double getBallisticCoefficient()
public final void setBallisticCoefficient(double value)
public final double getLastObservationTime()
public final void setLastObservationTime(double value)
public final double getErrorGrowthRate()
public final void setErrorGrowthRate(double value)
public final double getEnergyDissipationRate()
public final void setEnergyDissipationRate(double value)
public final double getVisualMagnitude()
public final void setVisualMagnitude(double value)
public final double getRadarCrossSection()
public final void setRadarCrossSection(double value)
@Nonnull public final GeneralPerturbationObjectType getObjectType()
public final void setObjectType(@Nonnull GeneralPerturbationObjectType value)
@Nonnull public static ArrayList<UsafGeneralPerturbationElements> readFromCsvFile(@Nonnull String filename)
The USAF General Perturbation Elements CSV format does not include a header row.
Classification
(get
/ set
).SatelliteNumber
(get
/ set
).InternationalDesignator
(get
/ set
).RawEpoch
(get
/ set
).RawEpoch
(get
/ set
).MeanMotionDot
(get
/ set
).MeanMotionDotDot
(get
/ set
).BStar
(get
/ set
).EphemerisType
(get
/ set
).ElementNumber
(get
/ set
).Inclination
(get
/ set
).RightAscensionOfAscendingNode
(get
/ set
).Eccentricity
(get
/ set
).ArgumentOfPerigee
(get
/ set
).MeanAnomaly
(get
/ set
).MeanMotion
(get
/ set
).RevolutionNumber
(get
/ set
).OriginalSatelliteNumber
(get
/ set
).SolarRadiationParameter
(get
/ set
).BallisticCoefficient
(get
/ set
).LastObservationTime
(get
/ set
).ErrorGrowthRate
(get
/ set
).EnergyDissipationRate
(get
/ set
).VisualMagnitude
(get
/ set
).RadarCrossSection
(get
/ set
).ObjectType
(get
/ set
).filename
- Name of the CSV file from which to read.UsafGeneralPerturbationElements
.ArgumentNullException
- Thrown when filename
is null
.@Nonnull public static ArrayList<UsafGeneralPerturbationElements> readFromCsvFile(@Nonnull BufferedReader reader)
The USAF General Perturbation Elements CSV format does not include a header row.
Classification
(get
/ set
).SatelliteNumber
(get
/ set
).InternationalDesignator
(get
/ set
).RawEpoch
(get
/ set
).RawEpoch
(get
/ set
).MeanMotionDot
(get
/ set
).MeanMotionDotDot
(get
/ set
).BStar
(get
/ set
).EphemerisType
(get
/ set
).ElementNumber
(get
/ set
).Inclination
(get
/ set
).RightAscensionOfAscendingNode
(get
/ set
).Eccentricity
(get
/ set
).ArgumentOfPerigee
(get
/ set
).MeanAnomaly
(get
/ set
).MeanMotion
(get
/ set
).RevolutionNumber
(get
/ set
).OriginalSatelliteNumber
(get
/ set
).SolarRadiationParameter
(get
/ set
).BallisticCoefficient
(get
/ set
).LastObservationTime
(get
/ set
).ErrorGrowthRate
(get
/ set
).EnergyDissipationRate
(get
/ set
).VisualMagnitude
(get
/ set
).RadarCrossSection
(get
/ set
).ObjectType
(get
/ set
).reader
- BufferedReader
for the .csv file to read.UsafGeneralPerturbationElements
.ArgumentNullException
- Thrown when reader
is null
.