Commit b1403f5a authored by Bryan Cazabonne's avatar Bryan Cazabonne
Browse files

Minor fixes (JavaDoc and code Coverage).

parent 4343ea3e
......@@ -123,7 +123,7 @@ public class AEMParser extends ADMParser implements AttitudeEphemerisFileParser
* parsing by calling {@link #withInternationalDesignator(int, int, String)}
* </p>
* <p>
* The default interpolation degree is not set here. It is set to zero by default. If another value
* The default interpolation degree is not set here. It is set to one by default. If another value
* is needed it must be initialized before parsing by calling {@link #withInterpolationDegree(int)}
* </p>
*
......
......@@ -130,7 +130,7 @@ public class OEMParser extends ODMParser implements EphemerisFileParser {
* parsing by calling {@link #withInternationalDesignator(int, int, String)}
* </p>
* <p>
* The default interpolation degree is not set here. It is set to zero by default. If another value
* The default interpolation degree is not set here. It is set to one by default. If another value
* is needed it must be initialized before parsing by calling {@link #withInterpolationDegree(int)}
* </p>
*
......
......@@ -53,8 +53,7 @@ public interface AttitudeEphemerisFile {
* Contains the information about a single satellite from an {@link AttitudeEphemerisFile}.
*
* <p> A satellite ephemeris consists of one or more {@link AttitudeEphemerisSegment}.
* Segments are typically used to split up an ephemeris at discontinuous events, such
* as a maneuver.
* Segments are typically used to split up an ephemeris at discontinuous events.
*
* @author Raphaël Fermé
* @see AttitudeEphemerisFile
......@@ -75,7 +74,7 @@ public interface AttitudeEphemerisFile {
* Get the segments of the attitude ephemeris.
*
* <p> Attitude ephemeris segments are typically used to split an ephemeris around
* discontinuous events, such as maneuvers.
* discontinuous events.
*
* @return the segments contained in the attitude ephemeris file for this satellite.
*/
......
......@@ -79,11 +79,12 @@ public class OrekitEphemerisFile implements EphemerisFile {
* {@link OrekitSatelliteEphemeris} corresponding object for this ephemeris type.
*/
public static class OrekitSatelliteEphemeris implements SatelliteEphemeris {
/**
* Defines the default interpolation sample size if it is not specified
* on a segment.
**/
public static final int DEFAULT_INTERPOLATION_SIZE = 7; // TODO change default interpolation size to 2 in 11.0
public static final int DEFAULT_INTERPOLATION_SIZE = 7; // TODO change default interpolation size to 2 in 11.0 to be consistent with default interpolation degree in OEMParser
/** ID of the space object encapsulated here. **/
private final String id;
......@@ -270,16 +271,17 @@ public class OrekitEphemerisFile implements EphemerisFile {
}
public static class OrekitEphemerisSegment implements EphemerisSegment {
/** coordinates for this ephemeris segment. **/
/** Coordinates for this ephemeris segment. **/
private final List<TimeStampedPVCoordinates> coordinates;
/** the reference frame for this ephemeris segment. **/
/** The reference frame for this ephemeris segment. **/
private final Frame frame;
/** The name of the frame center. **/
private final String frameCenterString;
/** standard gravitational parameter for the satellite. **/
/** Standard gravitational parameter for the satellite. **/
private final double mu;
/** The time scale identifier, as specified in the ephemeris file. **/
......
......@@ -61,6 +61,7 @@ public class AEMParserTest {
Assert.assertEquals(0.0, start.durationFrom(file.getSatellites().get("1996-062A").getStart()), Double.MIN_VALUE);
final AbsoluteDate end = new AbsoluteDate("1996-12-28T21:23:00.5555", TimeScalesFactory.getUTC());
Assert.assertEquals(0.0, end.durationFrom(file.getSatellites().get("1996-062A").getStop()), Double.MIN_VALUE);
Assert.assertEquals("1996-062A", file.getSatellites().get("1996-062A").getId());
Assert.assertEquals(1.0, file.getFormatVersion(), Double.MIN_VALUE);
Assert.assertEquals(CelestialBodyFactory.getEarth().getGM(), file.getMu(), 1.0e-5);
Assert.assertEquals(new AbsoluteDate(2002, 11, 4, 17, 22, 31.0, TimeScalesFactory.getUTC()),
......
......@@ -28,6 +28,7 @@ import java.util.ArrayList;
import java.util.List;
import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.orekit.Utils;
......@@ -36,6 +37,8 @@ import org.orekit.attitudes.InertialProvider;
import org.orekit.bodies.CelestialBody;
import org.orekit.bodies.CelestialBodyFactory;
import org.orekit.data.DataContext;
import org.orekit.errors.OrekitIllegalArgumentException;
import org.orekit.errors.OrekitMessages;
import org.orekit.files.ccsds.AEMParser;
import org.orekit.files.ccsds.AEMWriter;
import org.orekit.files.general.AttitudeEphemerisFile.AttitudeEphemerisSegment;
......@@ -145,5 +148,63 @@ public class OrekitAttitudeEphemerisFileTest {
}
@Test
public void testNoStates() {
// Satellite ID
final String satId = "SATELLITE1";
// Create an empty list of states
List<SpacecraftState> states = new ArrayList<SpacecraftState>();
// Create a new satellite attitude ephemeris
OrekitAttitudeEphemerisFile ephemerisFile = new OrekitAttitudeEphemerisFile();
OrekitSatelliteAttitudeEphemeris satellite = ephemerisFile.addSatellite(satId);
// Try to add a new segment
try {
satellite.addNewSegment(states);
} catch (OrekitIllegalArgumentException oiae) {
Assert.assertEquals(OrekitMessages.NULL_ARGUMENT, oiae.getSpecifier());
}
}
@Test
public void testNoEnoughDataForInterpolation() {
// Create a spacecraft state
final String satId = "SATELLITE1";
final double sma = 10000000;
final double inc = Math.toRadians(45.0);
final double ecc = 0.1;
final double raan = 0.0;
final double pa = 0.0;
final double ta = 0.0;
final AbsoluteDate date = new AbsoluteDate();
final Frame frame = FramesFactory.getEME2000();
final CelestialBody body = CelestialBodyFactory.getEarth();
final double mu = body.getGM();
KeplerianOrbit initialOrbit = new KeplerianOrbit(sma, ecc, inc, pa, raan, ta, PositionAngle.TRUE,
frame, date, mu);
SpacecraftState state = new SpacecraftState(initialOrbit);
// Add the state to the list of spacecraft states
List<SpacecraftState> states = new ArrayList<SpacecraftState>();
states.add(state);
// Create a new satellite attitude ephemeris
OrekitAttitudeEphemerisFile ephemerisFile = new OrekitAttitudeEphemerisFile();
OrekitSatelliteAttitudeEphemeris satellite = ephemerisFile.addSatellite(satId);
// Try to add a new segment
try {
satellite.addNewSegment(states, "LINEAR", 1);
} catch (OrekitIllegalArgumentException oiae) {
Assert.assertEquals(OrekitMessages.NOT_ENOUGH_DATA_FOR_INTERPOLATION, oiae.getSpecifier());
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment