[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orekit Users] Matlab



Hello,

I am currently testing if I could use Orekit from Matlab. All the tests I made seem to work well, except that I did not succeed in implementing a step handler in Matlab. Could somebody provide me a simple example ?
For example, how to translate the following code ?

Main code in Matlab :

date = AbsoluteDate(2003, 9, 16, TimeScalesFactory.getUTC());
eme2000 = FramesFactory.getEME2000();
orbit = KeplerianOrbit(a, e, i, pa, raan, anomaly, ...
    PositionAngle.TRUE, eme2000, date, Constants.EIGEN5C_EARTH_MU);
propagator = KeplerianPropagator(orbit);
propagator.setMasterMode(60.0, GroundTrackPrinter());
propagator.propagate(date.shiftedBy(10000.0));

Handler GroundTrackPrinter() in Java :

public class GroundTrackPrinter implements OrekitFixedStepHandler {
   private BodyShape earth;
   public GroundTrackPrinter() throws OrekitException {
      earth = new OneAxisEllipsoid(
         Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
         Constants.WGS84_EARTH_FLATTENING,
         FramesFactory.getITRF(IERSConventions.IERS_2010,true) );
   }
   public void handleStep(SpacecraftState currentState, boolean isLast)
      throws OrekitException {
      AbsoluteDate date = currentState.getDate();
      Frame frame = earth.getBodyFrame();
      Vector3D position =
         currentState.getPVCoordinates(frame).getPosition();
      GeodeticPoint gp = earth.transform(position, frame, date);
      System.out.format( Locale.US, "%s %6.2f %6.2f %9.1f%n",
         date, gp.getLatitude(), gp.getLongitude(), getAltitude() );
      if (isLast) {
         System.out.println("end of propagation");
      }
   }

Thanks in advance for your help.

Best regards,

Philippe Demoulin
-----------------------------------------------
Institut royal d'Aéronomie Spatiale de Belgique
Avenue circulaire 3, 1180 Uccle
+32 2 373 0421
-----------------------------------------------