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

Merge branch 'revert-0b8680ca' into 'develop'

Revert "Added AEMFile implementation of EphemerisFile, EphemerisSegment and"

See merge request orekit/orekit!112
parents c76d1633 5f3cbe6d
......@@ -174,7 +174,6 @@ public enum OrekitMessages implements Localizable {
CCSDS_TDM_KEYWORD_NOT_FOUND("No CCSDS TDM keyword was found at line {0} of file {1}:\n{2}"),
CCSDS_TIME_SYSTEM_NOT_READ_YET("Parameter {0} needs a time system to be interpreted"),
CCSDS_TDM_UNKNOWN_FORMAT("TDM file {0} format is unknown. Please specify a file format: KEYVALUE or XML"),
CCSDS_AEM_INAPPLICABLE_METHOD("this method is not applicable to AEM files"),
CCSDS_AEM_INCONSISTENT_TIME_SYSTEMS("inconsistent time systems in the attitude blocks: {0} ≠ {1}"),
CCSDS_AEM_NULL_ATTITUDE_TYPE("invalid attitude type {0}"),
CCSDS_AEM_ATTITUDE_TYPE_NOT_IMPLEMENTED("attitude type {0} in CCSDS AEM files is not implemented in Orekit"),
......
......@@ -26,14 +26,9 @@ import java.util.Map.Entry;
import org.hipparchus.geometry.euclidean.threed.RotationOrder;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.files.general.EphemerisFile;
import org.orekit.frames.Frame;
import org.orekit.propagation.BoundedPropagator;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.TimeScale;
import org.orekit.utils.CartesianDerivativesFilter;
import org.orekit.utils.TimeStampedAngularCoordinates;
import org.orekit.utils.TimeStampedPVCoordinates;
/**
* This class stocks all the information of the Attitude Ephemeris Message (AEM) File parsed
......@@ -42,7 +37,7 @@ import org.orekit.utils.TimeStampedPVCoordinates;
* @author Bryan Cazabonne
* @since 10.2
*/
public class AEMFile extends ADMFile implements EphemerisFile {
public class AEMFile extends ADMFile {
/** List of ephemeris blocks. */
private List<AttitudeEphemeridesBlock> attitudeBlocks;
......@@ -82,12 +77,12 @@ public class AEMFile extends ADMFile implements EphemerisFile {
}
}
/**
* Get the attitude loaded ephemeris for each satellite in the file.
* @return a map from the satellite's ID to the information about that satellite
* contained in the file.
*/
@Override
public Map<String, AemSatelliteEphemeris> getSatellites() {
final Map<String, List<AttitudeEphemeridesBlock>> satellites = new HashMap<>();
for (final AttitudeEphemeridesBlock ephemeridesBlock : attitudeBlocks) {
......@@ -98,7 +93,7 @@ public class AEMFile extends ADMFile implements EphemerisFile {
final Map<String, AemSatelliteEphemeris> ret = new HashMap<>();
for (final Entry<String, List<AttitudeEphemeridesBlock>> entry : satellites.entrySet()) {
final String id = entry.getKey();
ret.put(id, new AemSatelliteEphemeris(id, entry.getValue()));
ret.put(id, new AemSatelliteEphemeris(entry.getValue()));
}
return ret;
}
......@@ -107,7 +102,7 @@ public class AEMFile extends ADMFile implements EphemerisFile {
* The Attitude Ephemerides Blocks class contain metadata
* and the list of attitude data lines.
*/
public class AttitudeEphemeridesBlock implements EphemerisSegment {
public class AttitudeEphemeridesBlock {
/** Meta-data for the block. */
private ADMMetaData metaData;
......@@ -195,72 +190,6 @@ public class AEMFile extends ADMFile implements EphemerisFile {
return metaData;
}
/**
* This method is not applicable to AEM files and will throw an exception.
*/
@Override
public double getMu() {
throw new OrekitException(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD);
}
/**
* This method is not applicable to AEM files and will throw an exception.
*/
@Override
public String getFrameString() {
throw new OrekitException(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD);
}
/**
* This method is not applicable to AEM files and will throw an exception.
*/
@Override
public Frame getFrame() {
throw new OrekitException(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD);
}
/**
* This method is not applicable to AEM files and will throw an exception.
*/
@Override
public int getInterpolationSamples() {
throw new OrekitException(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD);
}
/**
* This method is not applicable to AEM files and will throw an exception.
*/
@Override
public CartesianDerivativesFilter getAvailableDerivatives() {
throw new OrekitException(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD);
}
/**
* This method is not applicable to AEM files and will throw an exception.
*/
@Override
public List<? extends TimeStampedPVCoordinates> getCoordinates() {
throw new OrekitException(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD);
}
/**
* This method is not applicable to AEM files and will throw an exception.
*/
@Override
public Frame getInertialFrame() {
throw new OrekitException(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD);
}
/**
* This method is not applicable to AEM files and will throw an exception.
*/
@Override
public BoundedPropagator getPropagator() {
throw new OrekitException(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD);
}
/**
* Get the name of the center of the coordinate system the ephemeris is provided in.
* This may be a natural origin, such as the center of the Earth, another satellite, etc.
......@@ -554,60 +483,21 @@ public class AEMFile extends ADMFile implements EphemerisFile {
this.rotationOrder = order;
}
}
/** AEM ephemeris blocks for a single satellite. */
public static class AemSatelliteEphemeris implements SatelliteEphemeris {
public static class AemSatelliteEphemeris {
/** ID of the satellite. */
private final String id;
/** The attitude ephemeris data for the satellite. */
private final List<AttitudeEphemeridesBlock> blocks;
/**
* @deprecated Use {@link #AemSatelliteEphemeris(String, List)} instead.
*
* Create a container for the set of ephemeris blocks in the file that pertain to
* a single satellite. The ID of the satellite is set to ""
* @param blocks containing ephemeris data for the satellite.
*/
public AemSatelliteEphemeris(final List<AttitudeEphemeridesBlock> blocks) {
this("", blocks);
}
/**
* Create a container for the set of ephemeris blocks in the file that pertain to
* a single satellite.
* @param id of the satellite.
* @param blocks containing ephemeris data for the satellite.
* @since 10.3
*/
public AemSatelliteEphemeris(final String id, final List<AttitudeEphemeridesBlock> blocks) {
this.id = id;
public AemSatelliteEphemeris(final List<AttitudeEphemeridesBlock> blocks) {
this.blocks = blocks;
}
@Override
public String getId() {
return this.id;
}
/**
* This method is not applicable to AEM files and will throw an exception.
*/
@Override
public BoundedPropagator getPropagator() {
throw new OrekitException(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD);
}
/**
* This method is not applicable to AEM files and will throw an exception.
*/
@Override
public double getMu() {
throw new OrekitException(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD);
}
/**
......@@ -616,7 +506,6 @@ public class AEMFile extends ADMFile implements EphemerisFile {
* discontinuous events, such as maneuvers.
* @return the segments contained in the attitude ephemeris file for this satellite.
*/
@Override
public List<AttitudeEphemeridesBlock> getSegments() {
return Collections.unmodifiableList(blocks);
}
......@@ -625,7 +514,6 @@ public class AEMFile extends ADMFile implements EphemerisFile {
* Get the start date of the attitude ephemeris.
* @return attitude ephemeris start date.
*/
@Override
public AbsoluteDate getStart() {
return blocks.get(0).getStart();
}
......@@ -634,7 +522,6 @@ public class AEMFile extends ADMFile implements EphemerisFile {
* Get the end date of the attitude ephemeris.
* @return attitude ephemeris end date.
*/
@Override
public AbsoluteDate getStop() {
return blocks.get(blocks.size() - 1).getStop();
}
......
......@@ -594,9 +594,6 @@ NON_CHRONOLOGICAL_DATES_FOR_OBSERVATIONS = <MISSING TRANSLATION>
# Use of the ExceptionalDataContext detected. This is typically used to detect developer errors.
EXCEPTIONAL_DATA_CONTEXT = <MISSING TRANSLATION>
# this method is not applicable to AEM files
CCSDS_AEM_INAPPLICABLE_METHOD = <MISSING TRANSLATION>
# inconsistent time systems in the attitude blocks: {0} ≠ {1}
CCSDS_AEM_INCONSISTENT_TIME_SYSTEMS = <MISSING TRANSLATION>
......
......@@ -594,9 +594,6 @@ NON_CHRONOLOGICAL_DATES_FOR_OBSERVATIONS = Die Beobachtungen {0} und {1} besitze
# Use of the ExceptionalDataContext detected. This is typically used to detect developer errors.
EXCEPTIONAL_DATA_CONTEXT = Momentan wird noch die ExceptionalDataContext Klasse benutzt. Diese wird typischerweise ausschließlich für das Erkennen von Entwicklerfehler benutzt.
# this method is not applicable to AEM files
CCSDS_AEM_INAPPLICABLE_METHOD = diese Methode ist nicht auf AEM-Dateien anwendbar
# inconsistent time systems in the attitude blocks: {0} ≠ {1}
CCSDS_AEM_INCONSISTENT_TIME_SYSTEMS = <MISSING TRANSLATION>
......
......@@ -594,9 +594,6 @@ NON_CHRONOLOGICAL_DATES_FOR_OBSERVATIONS = <MISSING TRANSLATION>
# Use of the ExceptionalDataContext detected. This is typically used to detect developer errors.
EXCEPTIONAL_DATA_CONTEXT = <MISSING TRANSLATION>
# this method is not applicable to AEM files
CCSDS_AEM_INAPPLICABLE_METHOD = <MISSING TRANSLATION>
# inconsistent time systems in the attitude blocks: {0} ≠ {1}
CCSDS_AEM_INCONSISTENT_TIME_SYSTEMS = <MISSING TRANSLATION>
......
......@@ -594,9 +594,6 @@ NON_CHRONOLOGICAL_DATES_FOR_OBSERVATIONS = observations {0} and {1} are not in c
# Use of the ExceptionalDataContext detected. This is typically used to detect developer errors.
EXCEPTIONAL_DATA_CONTEXT = Use of the ExceptionalDataContext detected. This is typically used to detect developer errors.
# this method is not applicable to AEM files
CCSDS_AEM_INAPPLICABLE_METHOD = this method is not applicable to AEM files
# inconsistent time systems in the attitude blocks: {0} ≠ {1}
CCSDS_AEM_INCONSISTENT_TIME_SYSTEMS = inconsistent time systems in the attitude blocks: {0} ≠ {1}
......
......@@ -594,9 +594,6 @@ NON_CHRONOLOGICAL_DATES_FOR_OBSERVATIONS = <MISSING TRANSLATION>
# Use of the ExceptionalDataContext detected. This is typically used to detect developer errors.
EXCEPTIONAL_DATA_CONTEXT = <MISSING TRANSLATION>
# this method is not applicable to AEM files
CCSDS_AEM_INAPPLICABLE_METHOD = este método no es aplicable a los archivos AEM
# inconsistent time systems in the attitude blocks: {0} ≠ {1}
CCSDS_AEM_INCONSISTENT_TIME_SYSTEMS = <MISSING TRANSLATION>
......
......@@ -311,7 +311,7 @@ CCSDS_DATE_MISSING_AGENCY_EPOCH = époque de référence spécifique agence manq
CCSDS_UNEXPECTED_KEYWORD = mot-clef inattendu à la ligne {0} du fichier CCSDS {1} :\n{2}
# the central body gravitational coefficient cannot be retrieved from the ODM
CCSDS_UNKNOWN_GM = le coefficient d''attraction gravifique ne peut être récupéré dans l''ODM
CCSDS_UNKNOWN_GM = le coefficient d''atraction gravifique ne peut être récupéré dans l''ODM
# there is no spacecraft mass associated with this ODM file
CCSDS_UNKNOWN_SPACECRAFT_MASS = il n''y a pas de masse pour le véhicule spatial dans ce fichier ODM
......@@ -594,9 +594,6 @@ NON_CHRONOLOGICAL_DATES_FOR_OBSERVATIONS = les observations aux dates {0} et {1}
# Use of the ExceptionalDataContext detected. This is typically used to detect developer errors.
EXCEPTIONAL_DATA_CONTEXT = une utilisation de ExceptionalDataContext a été détectée. Ce mécanisme est généralement activé explicitement pour détecter des erreur de développement
# this method is not applicable to AEM files
CCSDS_AEM_INAPPLICABLE_METHOD = cette méthode n'est pas applicable aux fichiers AEM
# inconsistent time systems in the attitude blocks: {0} ≠ {1}
CCSDS_AEM_INCONSISTENT_TIME_SYSTEMS = systèmes temporels incohérents dans des blocs d''attitude : {0} ≠ {1}
......
......@@ -594,9 +594,6 @@ NON_CHRONOLOGICAL_DATES_FOR_OBSERVATIONS = <MISSING TRANSLATION>
# Use of the ExceptionalDataContext detected. This is typically used to detect developer errors.
EXCEPTIONAL_DATA_CONTEXT = <MISSING TRANSLATION>
# this method is not applicable to AEM files
CCSDS_AEM_INAPPLICABLE_METHOD = <MISSING TRANSLATION>
# inconsistent time systems in the attitude blocks: {0} ≠ {1}
CCSDS_AEM_INCONSISTENT_TIME_SYSTEMS = <MISSING TRANSLATION>
......
......@@ -595,9 +595,6 @@ NON_CHRONOLOGICAL_DATES_FOR_OBSERVATIONS = <MISSING TRANSLATION>
# Use of the ExceptionalDataContext detected. This is typically used to detect developer errors.
EXCEPTIONAL_DATA_CONTEXT = <MISSING TRANSLATION>
# this method is not applicable to AEM files
CCSDS_AEM_INAPPLICABLE_METHOD = <MISSING TRANSLATION>
# inconsistent time systems in the attitude blocks: {0} ≠ {1}
CCSDS_AEM_INCONSISTENT_TIME_SYSTEMS = <MISSING TRANSLATION>
......
......@@ -594,9 +594,6 @@ NON_CHRONOLOGICAL_DATES_FOR_OBSERVATIONS = observasjonene {0} og {1} er ikke kro
# Use of the ExceptionalDataContext detected. This is typically used to detect developer errors.
EXCEPTIONAL_DATA_CONTEXT = Bruk av ExceptionalDataContext funnet. Denne brukes typisk til å oppdage utviklingsproblemer.
# this method is not applicable to AEM files
CCSDS_AEM_INAPPLICABLE_METHOD = <MISSING TRANSLATION>
# inconsistent time systems in the attitude blocks: {0} ≠ {1}
CCSDS_AEM_INCONSISTENT_TIME_SYSTEMS = <MISSING TRANSLATION>
......
......@@ -594,9 +594,6 @@ NON_CHRONOLOGICAL_DATES_FOR_OBSERVATIONS = observațiile de la datele {0} și {1
# Use of the ExceptionalDataContext detected. This is typically used to detect developer errors.
EXCEPTIONAL_DATA_CONTEXT = a fost detectată o utilizare a ExceptionalDataContext. Acest mecanism este utilizat în general pentru detectarea unei erori de dezvoltare
# this method is not applicable to AEM files
CCSDS_AEM_INAPPLICABLE_METHOD = <MISSING TRANSLATION>
# inconsistent time systems in the attitude blocks: {0} ≠ {1}
CCSDS_AEM_INCONSISTENT_TIME_SYSTEMS = <MISSING TRANSLATION>
......
......@@ -34,7 +34,6 @@ import org.orekit.bodies.CelestialBodyFactory;
import org.orekit.data.DataContext;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.files.ccsds.AEMFile.AemSatelliteEphemeris;
import org.orekit.files.ccsds.AEMFile.AttitudeEphemeridesBlock;
import org.orekit.files.ccsds.AEMParser.AEMRotationOrder;
import org.orekit.time.AbsoluteDate;
......@@ -418,71 +417,6 @@ public class AEMParserTest {
}
}
/**
* Checks implementation of interfaces and that new methods not applicable to
* AEM files throw an exception
*/
@Test
public void testIssue705() {
final String ex = "/ccsds/AEMExample.txt";
final InputStream inEntry = getClass().getResourceAsStream(ex);
final AEMParser parser = new AEMParser();
final AEMFile file = parser.parse(inEntry, "AEMExample.txt");
AemSatelliteEphemeris aemEph = file.getSatellites().get("1996-062A");
Assert.assertEquals("1996-062A", aemEph.getId());
try {
aemEph.getPropagator();
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD, oe.getSpecifier());
}
try {
aemEph.getMu();
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD, oe.getSpecifier());
}
AttitudeEphemeridesBlock aemBlock = aemEph.getSegments().get(0);
try {
aemBlock.getCoordinates();
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD, oe.getSpecifier());
}
try {
aemBlock.getAvailableDerivatives();
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD, oe.getSpecifier());
}
try {
aemBlock.getFrame();
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD, oe.getSpecifier());
}
try {
aemBlock.getFrameString();
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD, oe.getSpecifier());
}
try {
aemBlock.getMu();
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD, oe.getSpecifier());
}
try {
aemBlock.getInterpolationSamples();
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD, oe.getSpecifier());
}
try {
aemBlock.getPropagator();
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD, oe.getSpecifier());
}
try {
aemBlock.getInertialFrame();
} catch (OrekitException oe) {
Assert.assertEquals(OrekitMessages.CCSDS_AEM_INAPPLICABLE_METHOD, oe.getSpecifier());
}
}
private void verifyAngularCoordinates(final TimeStampedAngularCoordinates expected,
final TimeStampedAngularCoordinates actual,
final double threshold) {
......
......@@ -172,7 +172,6 @@ public class AEMWriterTest {
generatedAemFile.getAttitudeBlocks().get(0).getMetaData().getObjectID());
}
@Deprecated
@Test
public void testMultisatelliteFile() throws IOException {
final String id1 = "ID1";
......@@ -197,30 +196,6 @@ public class AEMWriterTest {
writer2.write(tempAEMFilePath, file);
}
@Test
public void testMultisatelliteFileNew() throws IOException {
final String id1 = "ID1";
final String id2 = "ID2";
AEMFile file = new StandInEphemerisFile();
file.getSatellites().put(id1, new StandInSatelliteEphemeris(id1, new ArrayList<>()));
file.getSatellites().put(id2, new StandInSatelliteEphemeris(id2, new ArrayList<>()));
String tempAEMFilePath = tempFolder.newFile("TestAEMMultisatellite-1.aem").toString();
AEMWriter writer1 = new AEMWriter();
try {
writer1.write(tempAEMFilePath, file);
fail("Should have thrown OrekitIllegalArgumentException due to multiple satellites");
} catch (OrekitIllegalArgumentException e) {
assertEquals(OrekitMessages.EPHEMERIS_FILE_NO_MULTI_SUPPORT, e.getSpecifier());
}
tempAEMFilePath = tempFolder.newFile("TestAEMMultisatellite-2.aem").toString();
AEMWriter writer2 = new AEMWriter(null, id1, null);
writer2.write(tempAEMFilePath, file);
}
@Test
public void testIssue723() throws IOException {
final String ex = "/ccsds/AEMExample2.txt";
......@@ -279,17 +254,11 @@ public class AEMWriterTest {
private class StandInSatelliteEphemeris extends AemSatelliteEphemeris {
final List<AttitudeEphemeridesBlock> blocks;
@Deprecated
public StandInSatelliteEphemeris(List<AttitudeEphemeridesBlock> blocks) {
super(blocks);
this.blocks = blocks;
}
public StandInSatelliteEphemeris(String id, List<AttitudeEphemeridesBlock> blocks) {
super(id, blocks);
this.blocks = blocks;
}
@Override
public List<AttitudeEphemeridesBlock> getSegments() {
return blocks;
......
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