[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orekit Users] Matlab
Le 10/01/2018 à 11:45, Philippe Demoulin a écrit :
> Hello,
Hi Philippe,
>
> 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 ?
I was going to suggest you to look at Rami Houdroge application ISS
tracker
<https://fr.mathworks.com/matlabcentral/fileexchange/42733-isstracker-v1-0-0>
but it seems you already found it. Perhaps Rami
will be able to answer (I think he is on this list).
There was also a contribution from Issam Boukerch who interfaced Rugged
and Orekit in Matlab (see
<https://www.orekit.org/forge/projects/rugged/wiki/MatlabExample>) but
in this contribution, there are no Matlab
implementation of a Java interface.
best regards,
Luc
>
> 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
> -----------------------------------------------