| // ***************************************************************************** |
| // Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency |
| // All rights reserved. This program and the accompanying materials |
| // are made available under the terms of the Eclipse Public License v1.0 |
| // which accompanies this distribution, and is available at |
| // http://www.eclipse.org/legal/epl-v10.html |
| // |
| // Contributors: |
| // Pierre Allard - initial API and implementation |
| // Regent L'Archeveque |
| // |
| // SPDX-License-Identifier: EPL-1.0 |
| // ***************************************************************************** |
| @GenModel(prefix="ApogyCoreEnvironmentOrbitEarth", |
| childCreationExtenders="true", |
| extensibleProviderFactory="true", |
| multipleEditorPages="false", |
| copyrightText="******************************************************************************* |
| Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency |
| All rights reserved. This program and the accompanying materials |
| are made available under the terms of the Eclipse Public License v1.0 |
| which accompanies this distribution, and is available at |
| http://www.eclipse.org/legal/epl-v10.html |
| |
| Contributors: |
| Pierre Allard - initial API and implementation |
| Regent L'Archeveque |
| |
| SPDX-License-Identifier: EPL-1.0 |
| *******************************************************************************", |
| modelName="ApogyCoreEnvironmentOrbitEarth", |
| complianceLevel="8.0", |
| suppressGenModelAnnotations="false", |
| dynamicTemplates="true", |
| templateDirectory="platform:/plugin/org.eclipse.apogy.common.emf.codegen/templates") |
| @GenModel(modelDirectory="/org.eclipse.apogy.core.environment.orbit.earth/src-gen") |
| @GenModel(editDirectory= "/org.eclipse.apogy.core.environment.orbit.earth.edit/src-gen") |
| // @GenModel(testsDirectory="/org.eclipse.apogy.core.environment.orbit.earth.tests/src-gen") |
| |
| package org.eclipse.apogy.core.environment.orbit.earth |
| |
| import org.eclipse.apogy.common.emf.Described |
| import org.eclipse.apogy.common.emf.Named |
| import org.eclipse.apogy.common.emf.Timed |
| import org.eclipse.apogy.common.math.Matrix3x3 |
| import org.eclipse.apogy.core.Updatable |
| import org.eclipse.apogy.core.environment.Earth |
| import org.eclipse.apogy.core.environment.earth.GeographicCoordinates |
| import org.eclipse.apogy.core.environment.earth.EarthSurfaceLocation |
| import org.eclipse.apogy.core.environment.Moon |
| import org.eclipse.apogy.core.environment.Sky |
| import org.eclipse.apogy.core.environment.orbit.AbstractFrame |
| import org.eclipse.apogy.core.environment.orbit.AttitudeProvider |
| import org.eclipse.apogy.core.environment.orbit.Orbit |
| import org.eclipse.apogy.core.environment.orbit.OrbitModel |
| import org.eclipse.apogy.core.environment.orbit.OrbitWorksite |
| import org.eclipse.apogy.core.environment.orbit.SpacecraftState |
| import org.eclipse.apogy.core.environment.orbit.TimedStampedAngularCoordinates |
| import org.eclipse.apogy.core.environment.orbit.TimedStampedPVACoordinates |
| import org.eclipse.emf.ecore.EDate |
| import org.eclipse.apogy.core.environment.orbit.ValidityRangeProvider |
| import org.eclipse.apogy.common.Apogy |
| |
| |
| // Basics Types |
| type List < T > wraps java.util.List |
| type Map<K,V> wraps java.util.Map |
| type Exception wraps java.lang.Exception |
| type SortedSet<T> wraps java.util.SortedSet |
| |
| // Eclipse Types |
| type IProgressMonitor wraps org.eclipse.core.runtime.IProgressMonitor |
| |
| // Appache Types |
| type Rotation wraps org.apache.commons.math3.geometry.euclidean.threed.Rotation |
| |
| // OreKit Types |
| type OreKitFrame wraps org.orekit.frames.Frame |
| type OreKitTimeStampedAngularCoordinates wraps org.orekit.utils.TimeStampedAngularCoordinates |
| type OreKitTimeStampedPVCoordinates wraps org.orekit.utils.TimeStampedPVCoordinates |
| |
| |
| type OreKitSpacecraftState wraps org.orekit.propagation.SpacecraftState |
| type AbsoluteDate wraps org.orekit.time.AbsoluteDate |
| type OreKitOrbit wraps org.orekit.orbits.Orbit |
| type OreKitKeplerianOrbit wraps org.orekit.orbits.KeplerianOrbit |
| type OreKitCartesianOrbit wraps org.orekit.orbits.CartesianOrbit |
| type OreKitElevationMask wraps org.orekit.utils.ElevationMask |
| |
| type OreKitAttitudeProvider wraps org.orekit.attitudes.AttitudeProvider |
| type OreKitPropagator wraps org.orekit.propagation.Propagator |
| type OreKitDSSTPropagator wraps org.orekit.propagation.semianalytical.dsst.DSSTPropagator |
| type OreKitEcksteinHechlerPropagator wraps org.orekit.propagation.analytical.EcksteinHechlerPropagator |
| type OreKitEphemerisProgator wraps org.orekit.propagation.analytical.Ephemeris |
| type OreKitKeplerianPropagator wraps org.orekit.propagation.analytical.KeplerianPropagator |
| type OreKitNumericalPropagator wraps org.orekit.propagation.numerical.NumericalPropagator |
| type OreKitTLEPropagator wraps org.orekit.propagation.analytical.tle.TLEPropagator |
| type OreKitTLE wraps org.orekit.propagation.analytical.tle.TLE |
| |
| // Enums |
| |
| enum EphemerisType |
| { |
| DEFAULT as "DEFAULT" = 0, |
| SGP as "SGP" = 1, |
| SGP4 as "SGP4" = 2, |
| SDP4 as "SDP4" = 3, |
| SGP8 as "SGP8" = 4, |
| SDP8 as "SDP8" = 5 |
| } |
| |
| // Classes |
| |
| /* |
| * A SpacecraftState that is backed by an OreKit SpacecraftState. |
| */ |
| class OreKitBackedSpacecraftState extends SpacecraftState |
| { |
| transient OreKitSpacecraftState oreKitSpacecraftState |
| } |
| |
| class OreKitBackedFrame extends AbstractFrame |
| { |
| op OreKitFrame getOreKitFrame() |
| } |
| |
| /* |
| * A specialization of AttitudeProvider that uses an OreKit org.orekit.attitudes.AttitudeProvider. |
| */ |
| abstract class OreKitBackedAttitudeProvider extends AttitudeProvider |
| { |
| op OreKitAttitudeProvider getOreKitAttitudeProvider() |
| } |
| |
| /* |
| * This class represents the attitude provider where the satellite z axis is pointing to the vertical of the ground point under satellite. |
| * It is backed by a org.orekit.attitudes.NadirPointing AttitudeProvider. |
| */ |
| class NadirPointingAttitudeProvider extends OreKitBackedAttitudeProvider |
| { |
| } |
| |
| /* |
| * Defines a worksite in orbit. The reference frame used is inertial (J2000), with its origin at the current orbital position. |
| */ |
| class EarthOrbitWorksite extends OrbitWorksite |
| { |
| /* |
| * The EarthOrbitSky associated with the worksite, |
| */ |
| refers derived transient volatile EarthOrbitSky[1] earthOrbitSky |
| } |
| |
| /* |
| * Defines the Sky as seen from an EarthOrbitWorksite. |
| */ |
| class EarthOrbitSky extends Sky |
| { |
| /* |
| * The worksite to which the sky is associated. |
| */ |
| refers transient EarthOrbitWorksite earthOrbitWorksite |
| |
| /* |
| * The Moon in the sky. |
| */ |
| refers derived transient readonly Moon moon |
| |
| /* |
| * Returns the Moon angular diameter, in radians. |
| */ |
| @Apogy(units="rad") |
| op double getMoonAngularDiameter() |
| |
| /* |
| * The Earth in the sky. |
| */ |
| refers derived transient readonly Earth earth |
| |
| /* |
| * Returns the Earth angular diameter, in radians. |
| */ |
| @Apogy(units="rad") |
| op double getEarthAngularDiameter() |
| } |
| |
| @Apogy(hasCustomClass="true") |
| abstract class EarthOrbitModel extends OrbitModel |
| { |
| /** |
| * Return the OreKit propagator associated with the EarthOrbitModel. |
| */ |
| op OreKitPropagator getOreKitPropagator() |
| |
| /** |
| * Returns the list of passes for a given target. |
| */ |
| op List<VisibilityPass> getTargetPasses(EarthSurfaceLocation earthSurfaceLocation, EDate startDate, EDate endDate, ElevationMask elevationMask) throws Exception |
| |
| /** |
| * Returns the list of passes for a given Ground Station (and its Field Of View) during a specified interval. |
| */ |
| op List<VisibilityPass> getGroundStationPasses(GroundStation groundStation, EDate startDate, EDate endDate) throws Exception |
| |
| /** |
| * Returns the list of {@link Eclipse}. |
| */ |
| op List<Eclipse> getEclipses(EDate startDate, EDate endDate) throws Exception |
| } |
| |
| @Apogy(hasCustomClass="true") |
| class InitialOrbitBasedEarthOrbitModel extends EarthOrbitModel |
| { |
| contains EarthOrbit initalOrbit opposite initialOrbitBasedEarthOrbitModel |
| contains EarthOrbitPropagator propagator opposite initialOrbitBasedEarthOrbitModel |
| } |
| |
| /* |
| * Defines an Orbit around the Earth. |
| */ |
| abstract class EarthOrbit extends Orbit |
| { |
| /* |
| * Returns the underlying OreKit Orbit. |
| */ |
| op OreKitOrbit getOreKitOrbit() |
| |
| container InitialOrbitBasedEarthOrbitModel initialOrbitBasedEarthOrbitModel opposite initalOrbit |
| } |
| |
| /* |
| * An Earth orbit represented by Keplerian Elements. |
| * @see http://en.wikipedia.org/wiki/Orbital_elements |
| */ |
| |
| @Apogy(hasCustomClass="true") |
| class KeplerianEarthOrbit extends EarthOrbit |
| { |
| /* |
| * Semi-major axis, in meters |
| */ |
| @Apogy(units="m") |
| double semiMajorAxis |
| |
| /* |
| * Eccentricity |
| */ |
| double eccentricity |
| |
| /* |
| * Inclination, in radians. |
| */ |
| @GenModel(propertyCategory="KEPLER_ORBITAL_PARAMETERS") |
| @Apogy(units="rad") |
| double inclination |
| |
| /* |
| * Argument of perigee, in radians. |
| */ |
| @GenModel(propertyCategory="KEPLER_ORBITAL_PARAMETERS") |
| @Apogy(units="rad") |
| double perigeeArgument |
| |
| /* |
| * Right ascension of ascending node, in radians. |
| */ |
| @GenModel(propertyCategory="KEPLER_ORBITAL_PARAMETERS") |
| @Apogy(units="rad") |
| double rightAscentionOfAscendingNode |
| |
| /* |
| * Mean anomaly. |
| */ |
| @GenModel(propertyCategory="KEPLER_ORBITAL_PARAMETERS") |
| double meanAnomaly |
| |
| /* |
| * True anomaly. |
| */ |
| @GenModel(propertyCategory="KEPLER_ORBITAL_PARAMETERS") |
| double trueAnomaly |
| |
| /* |
| * Returns the underlying OreKit KeplerianOrbit. |
| */ |
| op OreKitKeplerianOrbit getOreKitKeplerianOrbit() |
| } |
| |
| class CartesianEarthOrbit extends EarthOrbit |
| { |
| contains TimedStampedPVACoordinates[1] pvaCoordinates |
| |
| op OreKitCartesianOrbit getOreKitCartesianOrbit() |
| } |
| |
| abstract class ElevationMask |
| { |
| op double getElevation(double azimuth) |
| |
| op OreKitElevationMask getOreKitElevationMask() |
| } |
| |
| @Apogy(hasCustomClass="true") |
| class ConstantElevationMask extends ElevationMask |
| { |
| /* |
| * The elevation, in radians. |
| */ |
| @GenModel(property="Editable") |
| @Apogy(units="rad") |
| double constantElevation = "0" |
| } |
| |
| /* |
| * Defines an Orbit propagator for Earth orbits. |
| */ |
| @Apogy(hasCustomClass="true") |
| abstract class EarthOrbitPropagator extends ValidityRangeProvider |
| { |
| EDate[1] validFromDate |
| |
| EDate[1] validToDate |
| |
| op OreKitPropagator getOreKitPropagator() |
| |
| op SpacecraftState propagate(Date targetDate) throws Exception |
| |
| |
| op List<SpacecraftState> getSpacecraftStates(Date startDate, Date endDate, double timeInterval) throws Exception |
| |
| /** |
| * Returns the list of passes for a given target. |
| */ |
| op List<VisibilityPass> getTargetPasses(EarthSurfaceLocation earthSurfaceLocation, EDate startDate, EDate endDate, ElevationMask elevationMask) throws Exception |
| |
| /** |
| * Returns the list of passes for a given Ground Station (and its Field Of View) during a specified interval. |
| */ |
| op List<VisibilityPass> getGroundStationPasses(GroundStation groundStation, EDate startDate, EDate endDate) throws Exception |
| |
| /** |
| * Returns the list of {@link Eclipse}. |
| */ |
| op List<Eclipse> getEclipses(EDate startDate, EDate endDate) throws Exception |
| |
| /** |
| * Return the init |
| */ |
| op Orbit getInitialOrbit() |
| |
| container InitialOrbitBasedEarthOrbitModel initialOrbitBasedEarthOrbitModel opposite propagator |
| } |
| |
| |
| /* |
| * Simple keplerian orbit propagator for Earth orbits. |
| */ |
| @Apogy(hasCustomClass="true") |
| class KeplerianEarthOrbitPropagator extends EarthOrbitPropagator |
| { |
| /* |
| * Gets the underlying OreKit KeplerianPropagator used to do computations. |
| */ |
| op OreKitKeplerianPropagator getOreKitKeplerianPropagator() |
| } |
| |
| // EarthOrbitModel |
| @Apogy(hasCustomClass="true") |
| class TLEEarthOrbitModel extends EarthOrbitModel, ValidityRangeProvider |
| { |
| /* |
| * The Two-Line Elements used by this propagator. |
| */ |
| contains TLE[1] tle |
| |
| /* |
| * TLE Validity Period in ms. |
| */ |
| long tleValidityPeriod = "86400000" |
| } |
| |
| @Apogy(hasCustomClass="true") |
| class URLBasedTLEEarthOrbitPropagator extends TLEEarthOrbitModel |
| { |
| /* |
| * The URl pointing to the source of the TLE. |
| */ |
| @GenModel(property="Editable", propertyCategory="TLE_RAW_DATA", notify="true") |
| String tleURL |
| } |
| |
| @Apogy(hasCustomClass="true") |
| abstract class AbstractTLE |
| { |
| /* |
| * The ballistic coefficient. |
| */ |
| @GenModel(property="Readonly", notify="true", propertyCategory="TLE_ORBITAL_PARAMETERS") |
| double bStar |
| |
| /* |
| * The epoch. |
| */ |
| @GenModel(property="Readonly", notify="true") |
| EDate epoch |
| |
| /* |
| * The eccentricity. |
| */ |
| @GenModel(property="Readonly", notify="true", propertyCategory="TLE_ORBITAL_PARAMETERS") |
| double eccentricity |
| |
| /* |
| * The element number. |
| */ |
| @GenModel(property="Readonly", notify="true") |
| int elementNumber |
| |
| /* |
| * The Ephemeris type. |
| */ |
| @GenModel(property="Readonly", notify="true") |
| EphemerisType ephemerisType |
| |
| /* |
| * The inclination. |
| */ |
| @GenModel(property="Readonly", notify="true", propertyCategory="TLE_ORBITAL_PARAMETERS") |
| @Apogy(units="rad") |
| double inclination |
| |
| /* |
| * The mean anomaly. |
| */ |
| @GenModel(property="Readonly", notify="true", propertyCategory="TLE_ORBITAL_PARAMETERS") |
| @Apogy(units="rad") |
| double meanAnomaly |
| |
| /* |
| * The mean motion. |
| */ |
| @GenModel(property="Readonly", notify="true", propertyCategory="TLE_ORBITAL_PARAMETERS") |
| @Apogy(units="rad/s") |
| double meanMotion |
| |
| /* |
| * The mean motion, expressed as revolution per day. |
| */ |
| @GenModel(property="Readonly", notify="true", propertyCategory="TLE_ORBITAL_PARAMETERS") |
| @Apogy(units="rev/day") |
| double revolutionPerDay |
| |
| /* |
| * The mean motion first derivative. |
| */ |
| @GenModel(property="Readonly", notify="true", propertyCategory="TLE_ORBITAL_PARAMETERS") |
| @Apogy(units="rad/s²") |
| double meanMotionFirstDerivative |
| |
| /* |
| * The mean motion second derivative. |
| */ |
| @GenModel(property="Readonly", notify="true", propertyCategory="TLE_ORBITAL_PARAMETERS") |
| @Apogy(units="rad/s³") |
| double meanMotionSecondDerivative |
| |
| /* |
| * The argument of perigee. |
| */ |
| @GenModel(property="Readonly", notify="true", propertyCategory="TLE_ORBITAL_PARAMETERS") |
| @Apogy(units="rad/s³") |
| double argumentOfPerigee |
| |
| /* |
| * Right ascension of ascending node, in radians. |
| */ |
| @GenModel(property="Readonly", propertyCategory="TLE_ORBITAL_PARAMETERS") |
| @Apogy(units="rad") |
| double rightAscentionOfAscendingNode |
| |
| /* |
| * The revolution number at epoch. |
| */ |
| @GenModel(property="Readonly", propertyCategory="TLE_ORBITAL_PARAMETERS") |
| int revolutionNumberAtEpoch |
| |
| /* |
| * The satellite id number. |
| */ |
| @GenModel(property="Readonly") |
| int satelliteNumber |
| |
| /* |
| * Return the OreKit implementation backing this TLE. |
| */ |
| op OreKitTLE getOreKitTLE() throws Exception |
| |
| /** |
| * Returns the first line of the TLE. |
| * @return The first line of the TLE. |
| */ |
| op String getLine1() |
| |
| /** |
| * Returns the second line of the TLE. |
| * @return The first line of the TLE. |
| */ |
| op String getLine2() |
| } |
| |
| /* |
| * Defines a Two-Line Elements orbit and propagation definition. |
| * @see http://en.wikipedia.org/wiki/Two-line_element_set |
| */ |
| @Apogy(hasCustomClass="true") |
| class TLE extends AbstractTLE |
| { |
| /* |
| * The first line of the TLE in text form. |
| */ |
| @GenModel(property="Editable", propertyCategory="TLE_RAW_DATA", notify="true") |
| String[1] firstLine |
| |
| /* |
| * The second line of the TLE in text form. |
| */ |
| @GenModel(property="Editable", propertyCategory="TLE_RAW_DATA", notify="true") |
| String[1] secondLine |
| } |
| |
| /* |
| * List that refers {@link GroundStation}. |
| */ |
| class GroundStationReferencesList{ |
| /* |
| * {@link GroundStation} container. |
| */ |
| refers GroundStation[0..*] groundStations |
| } |
| |
| /* |
| * Defines a ground station and its associated Field Of View. |
| */ |
| class GroundStation extends EarthSurfaceLocation |
| { |
| /* |
| * The orientation of the field of view relative |
| * to the Ground Station frame. |
| */ |
| @GenModel(notify="true") |
| contains Matrix3x3 fieldOfViewOrientation |
| |
| /* |
| * The elevation mask of the Ground Station. |
| */ |
| @GenModel(notify="true", children="true") |
| contains ElevationMask elevationMask |
| } |
| |
| class GroundStationList extends Named, Described |
| { |
| contains GroundStation[0..*] groundStations |
| } |
| |
| /** |
| * Class that defines a visibility pass. |
| */ |
| @Apogy(hasCustomClass="true") |
| class VisibilityPass |
| { |
| /* |
| * The Earth Orbit Model that was used to compute the visibility. |
| */ |
| @GenModel(notify="true", property="Readonly") |
| refers EarthOrbitModel orbitModel |
| |
| /* |
| * The surface locations. |
| */ |
| @GenModel(notify="true", property="Readonly") |
| refers EarthSurfaceLocation surfaceLocation |
| |
| /* |
| * The start time of the pass. |
| */ |
| @GenModel(notify="true", property="Readonly") |
| EDate startTime |
| |
| /* |
| * The end time of the pass. |
| */ |
| @GenModel(notify="true", property="Readonly") |
| EDate endTime |
| |
| /* |
| * The end time of the pass. |
| */ |
| @GenModel(notify="true", property="Readonly", children= "true") |
| contains VisibilityPassSpacecraftPositionHistory positionHistory opposite visibilityPass |
| |
| /* |
| * Pass duration, in seconds. |
| */ |
| @Apogy(units = "s") |
| transient double duration |
| } |
| |
| @Apogy(hasCustomClass="true") |
| class VisibilityPassSpacecraftPositionHistory |
| { |
| /* |
| * The time interval separating positions. |
| */ |
| @GenModel(notify="true", property="Editable") |
| @Apogy(units = "s") |
| double timeInterval = "30.0" |
| |
| /* |
| * The visibility pass containing the position history. |
| */ |
| @GenModel(notify="true", property="None", children= "false") |
| container VisibilityPass visibilityPass opposite positionHistory |
| |
| /* |
| * The position history. |
| */ |
| @GenModel(notify="true", property="Readonly", children= "true") |
| contains VisibilityPassSpacecraftPosition[0..*] positions |
| |
| /* |
| * Returns the VisibilityPassSpacecraftPosition with the smallest range in the position history. |
| * @return The VisibilityPassSpacecraftPosition with the smallest range, null if the history position is empty. |
| */ |
| op VisibilityPassSpacecraftPosition getClosestRangePosition() |
| |
| /* |
| * Returns the VisibilityPassSpacecraftPosition with the highest elevation in the position history. |
| * @return The VisibilityPassSpacecraftPosition with the highest elevation, null if the history position is empty. |
| */ |
| op VisibilityPassSpacecraftPosition getHighestElevationPosition() |
| |
| /* |
| * Returns the VisibilityPassSpacecraftPosition with the smallest spacecraft cross-track angle in the position history. |
| * @return The VisibilityPassSpacecraftPosition with the smallest spacecraft cross-track angle, null if the history position is empty. |
| */ |
| op VisibilityPassSpacecraftPosition getSmallestSpacecraftCrossTrackAnglePosition() |
| |
| /* |
| * Force the update of VisibilityPassSpacecraftPositionHistory. |
| */ |
| op void updateHistory() |
| } |
| |
| class VisibilityPassSpacecraftPosition extends Timed |
| { |
| /* |
| * The azimuth of the spacecraft relative to the North. |
| */ |
| @GenModel(notify="true", property="Readonly") |
| @Apogy(units="rad") |
| double azimuth = "0" |
| |
| /* |
| * The elevation of the spacecraft relative to the local horizontal plane. |
| */ |
| @GenModel(notify="true", property="Readonly") |
| @Apogy(units="rad") |
| double elevation = "0" |
| |
| /* |
| * The range to the spacecraft. |
| */ |
| @GenModel(notify="true", property="Readonly") |
| @Apogy(units="m") |
| double range = "0" |
| |
| /* |
| * The relative speed of the spacecraft. |
| */ |
| @GenModel(notify="true", property="Readonly") |
| @Apogy(units="m/s") |
| double rangeRate = "0" |
| |
| /* |
| * The cross track angle of the surface location relative to the spacecraft nadir. |
| */ |
| @GenModel(notify="true", property="Readonly") |
| @Apogy(units="rad") |
| double spacecraftCrossTrackAngle="0" |
| |
| /* |
| * The along track angle of the surface location relative to the spacecraft nadir. |
| */ |
| @GenModel(notify="true", property="Readonly") |
| @Apogy(units="rad") |
| double spacecraftAlongTrackAngle="0" |
| |
| /* |
| * Spacecraft Geographical Coordinates. |
| */ |
| @GenModel(notify="true", property="None") |
| contains GeographicCoordinates spacecraftCoordinates |
| } |
| |
| @Apogy(hasCustomClass="true") |
| class SpacecraftsVisibilitySet extends Named, Described, Updatable |
| { |
| /* |
| * The start time of prediction period. |
| */ |
| @GenModel(notify="true", property="Editable", propertyCategory="TIME_PERIOD") |
| EDate startTime |
| |
| /* |
| * The end time of the prediction period. |
| */ |
| @GenModel(notify="true", property="Editable", propertyCategory="TIME_PERIOD") |
| EDate endTime |
| |
| /* |
| * The OrbitModel of the Spacecraft(s) to use for visibility calculation. |
| */ |
| @GenModel(children= "true", notify="true", property="Editable") |
| refers OrbitModel[0..*] orbitModels |
| |
| /* |
| * The ground station (s) for which to display Spacecraft visibility status. |
| */ |
| @GenModel(children= "true", notify="true", property="Editable") |
| refers GroundStation[0..*] groundStations |
| |
| @GenModel(children= "true", notify="true", property="Readonly") |
| contains VisibilityPass[0..*] passes |
| |
| /* |
| * A map that contains the GroundStation to VisibilityPass relationships. |
| */ |
| @GenModel(children= "false", notify="true", property="None") |
| transient Map<GroundStation, List<VisibilityPass>> groundStationToVisibilityMap |
| } |
| |
| class CorridorPoint extends Timed |
| { |
| contains GeographicCoordinates left |
| contains GeographicCoordinates center |
| contains GeographicCoordinates right |
| } |
| |
| class Corridor extends Named, Described |
| { |
| @GenModel(children= "true", notify="true", property="Readonly") |
| contains CorridorPoint[0..*] points |
| } |
| @Apogy(hasCustomClass="true") |
| class SpacecraftSwathCorridor extends Named, Described, Updatable |
| { |
| /* |
| * The start time of the prediction period. |
| */ |
| @GenModel(notify="true", property="Editable", propertyCategory="TIME_PERIOD") |
| EDate startTime |
| |
| /* |
| * The end time of the prediction period. |
| */ |
| @GenModel(notify="true", property="Editable", propertyCategory="TIME_PERIOD") |
| EDate endTime |
| |
| @GenModel(notify="true", property="Editable", propertyCategory="TIME_PERIOD") |
| @Apogy(units = "s") |
| double timeInterval = "1.0" |
| |
| /* |
| * The OrbitModel to use to predict the corridor. |
| */ |
| @GenModel(propertyCategory="ORBIT_MODEL") |
| refers OrbitModel orbitModel |
| |
| @GenModel(notify="true", property="Editable", propertyCategory="SWATH") |
| @Apogy(units="rad") |
| double leftSwathAngle = "0" |
| |
| @GenModel(notify="true", property="Editable", propertyCategory="SWATH") |
| @Apogy(units="rad") |
| double rightSwathAngle = "0" |
| |
| /** |
| * The corridor. |
| */ |
| contains Corridor corridor |
| } |
| |
| @Apogy(isSingleton="true", hasCustomClass="true") |
| class ApogyCoreEnvironmentOrbitEarthFacade |
| { |
| /* |
| * Returns the Earth gravitational constant from GRIM5C1 model: 3.986004415e14 m³/s². |
| */ |
| @Apogy(units = "m³/s²") |
| op double getMu() |
| |
| /* |
| * Creates an AbsoluteDate from a Date. |
| * @param date A date. |
| * @return The AbsoluteDate (OreKit type) for the specified date. |
| */ |
| op AbsoluteDate createAbsoluteDate(EDate date) |
| |
| /* |
| * Creates an Date from a AbsoluteDate. |
| */ |
| op EDate createDate(AbsoluteDate absoluteDate) |
| |
| /* |
| * Returns the geographic sub-point for a given spacecraft state. |
| */ |
| op GeographicCoordinates getSpacecraftEarthSubPoint(OreKitBackedSpacecraftState oreKitBackedSpacecraftState) throws Exception |
| |
| /* |
| * Returns the elevation angle of a spacecraft relative |
| * to a Earth surface location. |
| */ |
| @Apogy(units = "rad") |
| op double getSpacecraftElevationAngle(SpacecraftState spacecraftState, EarthSurfaceLocation earthSurfaceLocation) throws Exception |
| |
| /* |
| * Returns the azimuth angle (relative to North) of a |
| * spacecraft at a Earth surface location. |
| */ |
| @Apogy(units = "rad") |
| op double getSpacecraftAzimuthAngle(SpacecraftState spacecraftState, EarthSurfaceLocation earthSurfaceLocation) throws Exception |
| |
| /* |
| * Returns the distance between spacecraft and a specified target. |
| */ |
| @Apogy(units = "m") |
| op double getRange(SpacecraftState spacecraftState, EarthSurfaceLocation earthSurfaceLocation) throws Exception |
| |
| op SpacecraftState createSpacecraftState(Orbit orbit, OreKitSpacecraftState oreKitSpacecraftState) |
| |
| op OreKitBackedSpacecraftState createOreKitBackedSpacecraftState(Orbit orbit, OreKitSpacecraftState oreKitSpacecraftState) |
| |
| op TimedStampedPVACoordinates createTimedStampedPVACoordinates(OreKitTimeStampedPVCoordinates oreKitTimeStampedPVCoordinates) |
| |
| op TimedStampedAngularCoordinates createTimedStampedAngularCoordinates(OreKitTimeStampedAngularCoordinates oreKitTimeStampedAngularCoordinates) |
| |
| op Matrix3x3 createMatrix3x3(Rotation rotation) |
| |
| op Rotation createRotation(Matrix3x3 matrix3x3) |
| |
| /* |
| * Creates a Keplerian Orbit based on a EarthOrbitPropagator. |
| * @param earthOrbitPropagator The EarthOrbitPropagator. |
| * @return A KeplerianEarthOrbit representing the initial orbit of the propagator. |
| */ |
| op KeplerianEarthOrbit createKeplerianOrbit(EarthOrbitPropagator earthOrbitPropagator) throws Exception |
| |
| /* |
| * Creates a CartesianEarthOrbit Orbit based on a EarthOrbitPropagator. |
| * @param earthOrbitPropagator The EarthOrbitPropagator. |
| * @return A CartesianEarthOrbit representing the initial orbit of the propagator. |
| */ |
| op CartesianEarthOrbit createCartesianEarthOrbit(EarthOrbitPropagator earthOrbitPropagator) throws Exception |
| |
| /* |
| * Creates a KeplerianEarthOrbit from an OreKit KeplerianOrbit. |
| * @param oreKitKeplerianOrbit The OreKit Keplerian Orbit. |
| * @return the associated KeplerianEarthOrbit. |
| */ |
| op KeplerianEarthOrbit createKeplerianOrbit(OreKitKeplerianOrbit oreKitKeplerianOrbit) throws Exception |
| |
| /* |
| * Creates a CartesianEarthOrbit from an OreKit CartesianOrbit. |
| * @param oreKitKeplerianOrbit The OreKit Cartesian Orbit. |
| * @return the associated CartesianEarthOrbit. |
| */ |
| op CartesianEarthOrbit createCartesianEarthOrbit(OreKitCartesianOrbit oreKitCartesianOrbit) throws Exception |
| |
| /* |
| * Converts an OreKit SpacecraftState to GeographicCoordinates. The conversion uses the IERS_2010 frame with a WGS84 equatorial radius and earth flatenning. |
| * @param oreKitBackedSpacecraftState The OreKit SpacecraftState. |
| * @return the associated GeographicCoordinates. |
| */ |
| op GeographicCoordinates convertToGeographicCoordinates(OreKitBackedSpacecraftState oreKitBackedSpacecraftState) throws Exception |
| |
| /** |
| * Return the list of spacecraft state a at given time interval. |
| * @param earthOrbitModel The EarthOrbitModel used. |
| * @param propagator The OreKit propagator to use. |
| * @param startDate The start time of the propagation. |
| * @param endDate The end time of the propagation. |
| * @param timeInterval The time interval between spacecraft state evaluation, in seconds. |
| * The list of SpacecraftState. Never null, but can be empty. |
| */ |
| op List<SpacecraftState> getSpacecraftStates(OreKitPropagator propagator, Date startDate, Date endDate, double timeInterval) throws Exception |
| |
| /** |
| * Returns the list of passes for a given target. |
| * @param earthOrbitModel The EarthOrbitModel used. |
| * @param propagator The OreKit propagator to use. |
| * @param earthSurfaceLocation The location of the target. |
| * @param startDate The start time of the propagation. |
| * @param endDate The end time of the propagation. |
| * @param elevationMaks The elevation mask used to determine the visibility of the spacecraft at the target location. |
| * @param The list of VisibilityPass. Never null, but can be empty. |
| */ |
| op List<VisibilityPass> getTargetPasses(EarthOrbitModel earthOrbitModel, EarthSurfaceLocation earthSurfaceLocation, EDate startDate, EDate endDate, ElevationMask elevationMask) throws Exception |
| |
| /** |
| * Returns the list of passes for a list of targets. |
| * @param earthOrbitModel The EarthOrbitModel used. |
| * @param propagator The OreKit propagator to use. |
| * @param earthSurfaceLocations The list of the targets. |
| * @param startDate The start time of the propagation. |
| * @param endDate The end time of the propagation. |
| * @param elevationMaks The elevation mask used to determine the visibility of the spacecraft at the target locations. |
| * @param monitor A progress monitor, can be null. |
| * @return The list of VisibilityPass. Never null, but can be empty. |
| */ |
| op List<VisibilityPass> getTargetPasses(EarthOrbitModel earthOrbitModel, List<EarthSurfaceLocation> earthSurfaceLocations, EDate startDate, EDate endDate, ElevationMask elevationMask, IProgressMonitor monitor) throws Exception |
| |
| /** |
| * Returns the list of passes for a given Ground Station (and its Field Of View) during a specified interval. |
| * @param propagator The OreKit propagator to use. |
| * @param groundStation The location of the target. |
| * @param startDate The start time of the propagation. |
| * @param endDate The end time of the propagation. |
| * @return The list of VisibilityPass. Never null, but can be empty. |
| */ |
| op List<VisibilityPass> getGroundStationPasses(EarthOrbitModel earthOrbitModel, GroundStation groundStation, EDate startDate, EDate endDate) throws Exception |
| |
| /** |
| * Returns the list of passes for a list of Ground Station (and its Field Of View) during a specified interval. |
| * @param propagator The OreKit propagator to use. |
| * @param groundStation The list of targets. |
| * @param startDate The start time of the propagation. |
| * @param endDate The end time of the propagation. |
| * @return The list of VisibilityPass. Never null, but can be empty. |
| */ |
| op List<VisibilityPass> getGroundStationPasses(EarthOrbitModel earthOrbitModel, List<GroundStation> groundStations, EDate startDate, EDate endDate, IProgressMonitor monitor) throws Exception |
| |
| /** |
| * Returns the list of {@link Eclipse} that will be experienced by the spacecraft within a specified time period. |
| * @param propagator The OreKit propagator to use. |
| * @param startDate The start time of the propagation. |
| * @param endDate The end time of the propagation. |
| * @return The list of Eclipse. Never null, but can be empty. |
| */ |
| op List<Eclipse> getEclipses(EarthOrbitModel earthOrbitModel, EDate startDate, EDate endDate) throws Exception |
| |
| /* |
| * Sorts a list of VisibilityPass by increasing date order (form earlier to later). If two or more VisibilityPass |
| * have the same start date, they are ordered by duration. |
| * @param passes The list of VisibilityPass. |
| * @return the SortedSet of VisibilityPass. |
| */ |
| op SortedSet<VisibilityPass> getVisibilityPassSortedByStartDate(List<VisibilityPass> passes) |
| |
| /* |
| * Sorts a list of VisibilityPass by increasing duration. If two or more VisibilityPass |
| * have the same duration, they are ordered by start date. |
| * @param passes The list of VisibilityPass. |
| * @return the SortedSet of VisibilityPass. |
| */ |
| op SortedSet<VisibilityPass> getVisibilityPassSortedByDuration(List<VisibilityPass> passes) |
| |
| /* |
| * Sorts a list of VisibilityPassSpacecraftPosition by increasing elevation. |
| * @param passes The list of VisibilityPassSpacecraftPosition. |
| * @return the SortedSet of VisibilityPassSpacecraftPosition. |
| */ |
| op SortedSet<VisibilityPassSpacecraftPosition> getVisibilityPassSpacecraftPositionSortedByElevation(List<VisibilityPassSpacecraftPosition> positions) |
| |
| /* |
| * Sorts a list of VisibilityPassSpacecraftPosition by increasing spacecraft cross-track angle. |
| * @param passes The list of VisibilityPassSpacecraftPosition. |
| * @return the SortedSet of VisibilityPassSpacecraftPosition. |
| */ |
| op SortedSet<VisibilityPassSpacecraftPosition> getVisibilityPassSpacecraftPositionSortedBySpacecraftCrossTrackAngle(List<VisibilityPassSpacecraftPosition> positions) |
| |
| /* |
| * Loads a TLE from a URL. |
| * @param url The URL as a String. |
| * @return The loaded TLE |
| */ |
| op TLE loadTLE(String url) throws Exception |
| |
| /* |
| * Exports a TLE to a URL. |
| * @param tle The TLE to export |
| * @param url The URL as a String. |
| * @throws An exception if the export fails. |
| */ |
| op void exportTLE(TLE tle, String url) throws Exception |
| |
| /* |
| * Create a TLEEarthOrbitModel using a TLE. |
| * @param tle The Two-Line Element defining the propagator. |
| * @return The TLEEarthOrbitModel. |
| */ |
| op TLEEarthOrbitModel createTLEEarthOrbitModel(TLE tle) throws Exception |
| |
| |
| /** |
| * Exports a VisibilityPassSpacecraftPositionHistory as a comma separated file (.csv). |
| * @param visibilityPassSpacecraftPositionHistory The VisibilityPassSpacecraftPositionHistory to export. |
| * @param includeHeader Whether or not to include a header line in the format. |
| */ |
| op String exportAsCSV(VisibilityPassSpacecraftPositionHistory visibilityPassSpacecraftPositionHistory, boolean includeHeader) |
| } |
| |
| /* |
| * Defines an Eclipse for spacecrafts. |
| */ |
| class Eclipse{ |
| /* |
| * Entry in Penumbra. |
| */ |
| @GenModel(notify="true", property="None") |
| contains EclipseEvent penumbraEntry |
| |
| /* |
| * Entry in Umbra, can be null. |
| */ |
| @GenModel(notify="true", property="None") |
| contains EclipseEvent umbraEntry |
| |
| /* |
| * Exit from Umbra, can be null. |
| */ |
| @GenModel(notify="true", property="None") |
| contains EclipseEvent umbraExit |
| |
| /* |
| * Exit from Penumbra, can be null. |
| */ |
| @GenModel(notify="true", property="None") |
| contains EclipseEvent penumbraExit |
| } |
| |
| /* |
| * Eclipse Event. |
| */ |
| class EclipseEvent extends GeographicCoordinates, Timed{ |
| EclipseEventType ^type |
| } |
| |
| /* |
| * Eclipse Event Type. |
| */ |
| enum EclipseEventType{ |
| PENUMBRA_ENTRY as "Penumbra Entry" = 0, |
| PENUMBRA_EXIT as "Penumbra Exit" = 1, |
| UMBRA_ENTRY as "Umbra Entry" = 2, |
| UMBRA_EXIT as "Umbra Exit" = 3 |
| } |