diff --git a/orekit-conda-recipe/hipparchus-core-1.0.jar b/orekit-conda-recipe/hipparchus-core-1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..d7c8e8b87a95bd3447bea1078454dab7d7413fa7 Binary files /dev/null and b/orekit-conda-recipe/hipparchus-core-1.0.jar differ diff --git a/orekit-conda-recipe/hipparchus-fitting-1.0.jar b/orekit-conda-recipe/hipparchus-fitting-1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..f9aa7928a29f072f058b88434f045505bd39d297 Binary files /dev/null and b/orekit-conda-recipe/hipparchus-fitting-1.0.jar differ diff --git a/orekit-conda-recipe/hipparchus-geometry-1.0.jar b/orekit-conda-recipe/hipparchus-geometry-1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..9c4610b28a0e21dd6e766c09e12f7e5faa906a95 Binary files /dev/null and b/orekit-conda-recipe/hipparchus-geometry-1.0.jar differ diff --git a/orekit-conda-recipe/hipparchus-ode-1.0.jar b/orekit-conda-recipe/hipparchus-ode-1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..7c0654ed8319b910ad1edfe50467c41edf49ac5d Binary files /dev/null and b/orekit-conda-recipe/hipparchus-ode-1.0.jar differ diff --git a/orekit-conda-recipe/hipparchus-optim-1.0.jar b/orekit-conda-recipe/hipparchus-optim-1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..25699b825bc224d9d19e56db133f10d1286009c9 Binary files /dev/null and b/orekit-conda-recipe/hipparchus-optim-1.0.jar differ diff --git a/orekit-conda-recipe/hipparchus-stat-1.0.jar b/orekit-conda-recipe/hipparchus-stat-1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..d37347731b12136af316fe1f7596c35eded82568 Binary files /dev/null and b/orekit-conda-recipe/hipparchus-stat-1.0.jar differ diff --git a/orekit-conda-recipe/orekit-8.1-SNAPSHOT.jar b/orekit-conda-recipe/orekit-8.1-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..ef119ebd57c49d60bbac76651ccd22d07b18d2a5 Binary files /dev/null and b/orekit-conda-recipe/orekit-8.1-SNAPSHOT.jar differ diff --git a/orekit-java-wrappers/src/main/java/org/orekit/python/PythonAbstractDetector.java b/orekit-java-wrappers/src/main/java/org/orekit/python/PythonAbstractDetector.java new file mode 100644 index 0000000000000000000000000000000000000000..be8624a6784cdfd74c29fc0d94f5360a7c0a7d19 --- /dev/null +++ b/orekit-java-wrappers/src/main/java/org/orekit/python/PythonAbstractDetector.java @@ -0,0 +1,95 @@ +/** Copyright 2014 SSC and 2002-2014 CS Systèmes d'Information + * Licensed to CS Systèmes d'Information (CS) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * CS licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// this file was created by SCC and is largely a derived work from the +// original file AbstractDetector.java created by CS Systèmes d'Information + +package org.orekit.python; + +import org.orekit.errors.OrekitException; +import org.orekit.propagation.SpacecraftState; +import org.orekit.propagation.events.AbstractDetector; +import org.orekit.propagation.events.EventDetector; +import org.orekit.propagation.events.handlers.EventHandler; +import org.orekit.time.AbsoluteDate; + +/** Common parts shared by several orbital events finders. + * @see org.orekit.propagation.Propagator#addEventDetector(EventDetector) + * @author Luc Maisonobe + */ +public class PythonAbstractDetector<T extends EventDetector> extends AbstractDetector<T> { + + /** Serializable UID. */ + private static final long serialVersionUID = -334171965326514174L; + + private long pythonObject; + + /** Part of JCC Python interface to object */ + public void pythonExtension(long pythonObject) + { + this.pythonObject = pythonObject; + } + + /** Part of JCC Python interface to object */ + public long pythonExtension() + { + return this.pythonObject; + } + + /** Part of JCC Python interface to object */ + public void finalize() + throws Throwable + { + pythonDecRef(); + } + + /** Part of JCC Python interface to object */ + public native void pythonDecRef(); + + public PythonAbstractDetector(double maxCheck, double threshold, + int maxIter, EventHandler<T> handler) { + super(maxCheck, threshold, maxIter, handler); + } + + + /** {@inheritDoc} */ + @Override + public native void init(final SpacecraftState s0, final AbsoluteDate t); + + /** {@inheritDoc} */ + @Override + public native double g(SpacecraftState s) throws OrekitException; + + /** {@inheritDoc} */ + @Override + public native double getMaxCheckInterval(); + + /** {@inheritDoc} */ + @Override + public native int getMaxIterationCount(); + + /** {@inheritDoc} */ + @Override + public native double getThreshold(); + + /** {@inheritDoc} */ + @Override + public native T create(double newMaxCheck, double newThreshold, int newMaxIter, + EventHandler<? super T> newHandler); + + +} diff --git a/orekit-java-wrappers/src/main/java/org/orekit/python/PythonEventDetector.java b/orekit-java-wrappers/src/main/java/org/orekit/python/PythonEventDetector.java new file mode 100644 index 0000000000000000000000000000000000000000..da1e3b7266924e0015a0204c0408c291af06edfa --- /dev/null +++ b/orekit-java-wrappers/src/main/java/org/orekit/python/PythonEventDetector.java @@ -0,0 +1,152 @@ +/** Copyright 2014 SSC and 2002-2014 CS Systèmes d'Information + * Licensed to CS Systèmes d'Information (CS) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * CS licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// this file was created by SCC and is largely a derived work from the +// original file EventDetector.java created by CS Systèmes d'Information + +package org.orekit.python; + +import org.orekit.errors.OrekitException; +import org.orekit.propagation.SpacecraftState; +import org.orekit.propagation.events.EventDetector; +import org.orekit.propagation.events.handlers.EventHandler.Action; +import org.orekit.time.AbsoluteDate; + +/** This interface represents space-dynamics aware events detectors. +* +* <p>It mirrors the {@link org.apache.commons.math3.ode.events.EventHandler +* EventHandler} interface from <a href="http://commons.apache.org/math/"> +* Apache Commons Math</a> but provides a space-dynamics interface to the +* methods.</p> +* +* <p>Events detectors are a useful solution to meet the requirements +* of propagators concerning discrete conditions. The state of each +* event detector is queried by the integrator at each step. When the +* sign of the underlying g switching function changes, the step is rejected +* and reduced, in order to make sure the sign changes occur only at steps +* boundaries.</p> +* +* <p>When step ends exactly at a switching function sign change, the corresponding +* event is triggered, by calling the {@link #eventOccurred(SpacecraftState, boolean)} +* method. The method can do whatever it needs with the event (logging it, performing +* some processing, ignore it ...). The return value of the method will be used by +* the propagator to stop or resume propagation, possibly changing the state vector.<p> +* +* @author Luc Maisonobe +* @author Véronique Pommier-Maurussane +*/ +public class PythonEventDetector implements EventDetector +{ + + static final long serialVersionUID = 1L; + + /** Part of JCC Python interface to object */ + private long pythonObject; + + /** Part of JCC Python interface to object */ + public void pythonExtension(long pythonObject) + { + this.pythonObject = pythonObject; + } + + /** Part of JCC Python interface to object */ + public long pythonExtension() + { + return this.pythonObject; + } + + /** Part of JCC Python interface to object */ + public void finalize() + throws Throwable + { + pythonDecRef(); + } + + /** Part of JCC Python interface to object */ + public native void pythonDecRef(); + + /** Initialize event handler at the start of a propagation. + * <p> + * This method is called once at the start of the propagation. It + * may be used by the event handler to initialize some internal data + * if needed. + * </p> + * @param s0 initial state + * @param t target time for the integration + */ + @Override + public native void init(SpacecraftState s0, AbsoluteDate t); + + + /** Compute the value of the switching function. + * This function must be continuous (at least in its roots neighborhood), + * as the integrator will need to find its roots to locate the events. + * @param s the current state information: date, kinematics, attitude + * @return value of the switching function + * @exception OrekitException if some specific error occurs + */ + @Override + public native double g(SpacecraftState s) throws OrekitException; + + /** Get the convergence threshold in the event time search. + * @return convergence threshold (s) + */ + @Override + public native double getThreshold(); + + /** Get maximal time interval between switching function checks. + * @return maximal time interval (s) between switching function checks + */ + @Override + public native double getMaxCheckInterval(); + + /** Get maximal number of iterations in the event time search. + * @return maximal number of iterations in the event time search + */ + @Override + public native int getMaxIterationCount(); + + + /** Handle the event. + * @param s SpaceCraft state to be used in the evaluation + * @param increasing with the event occured in an "increasing" or "decreasing" slope direction + * @return the Action that the calling detector should pass back to the evaluation system + * @exception OrekitException if some specific error occurs + * @since 7.0 + */ + @Override + public native Action eventOccurred(SpacecraftState s, boolean increasing) + throws OrekitException; + + /** Reset the state prior to continue propagation. + * <p>This method is called after the step handler has returned and + * before the next step is started, but only when {@link + * #eventOccurred} has itself returned the {@link Action#RESET_STATE} + * indicator. It allows the user to reset the state for the next step, + * without perturbing the step handler of the finishing step. If the + * {@link #eventOccurred} never returns the {@link Action#RESET_STATE} + * indicator, this function will never be called, and it is safe to simply return null.</p> + * @param oldState old state + * @return new state + * @exception OrekitException if the state cannot be reseted + * @since 7.0 + */ + @Override + public native SpacecraftState resetState(SpacecraftState oldState) throws OrekitException; + +} + diff --git a/orekit-java-wrappers/src/main/java/org/orekit/python/PythonEventHandler.java b/orekit-java-wrappers/src/main/java/org/orekit/python/PythonEventHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..2e1c7e238f45a71647fbe52ecf9e7f39fa57b74a --- /dev/null +++ b/orekit-java-wrappers/src/main/java/org/orekit/python/PythonEventHandler.java @@ -0,0 +1,118 @@ +/** Copyright 2014 SSC and 2002-2014 CS Systèmes d'Information + * Licensed to CS Systèmes d'Information (CS) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * CS licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// this file was created by SCC and is largely a derived work from the +// original file EventHandler.java created by CS Systèmes d'Information + +package org.orekit.python; + +import org.orekit.errors.OrekitException; +import org.orekit.propagation.SpacecraftState; +import org.orekit.propagation.events.EventDetector; +import org.orekit.propagation.events.handlers.EventHandler; +import static org.orekit.propagation.events.handlers.EventHandler.Action; + +/** This interface represents space-dynamics aware events detectors. +* +* <p>It mirrors the {@link org.apache.commons.math3.ode.events.EventHandler +* EventHandler} interface from <a href="http://commons.apache.org/math/"> +* Apache Commons Math</a> but provides a space-dynamics interface to the +* methods.</p> +* +* <p>Events detectors are a useful solution to meet the requirements +* of propagators concerning discrete conditions. The state of each +* event detector is queried by the integrator at each step. When the +* sign of the underlying g switching function changes, the step is rejected +* and reduced, in order to make sure the sign changes occur only at steps +* boundaries.</p> +* +* <p>When step ends exactly at a switching function sign change, the corresponding +* event is triggered, by calling the {@link #eventOccurred(SpacecraftState, boolean)} +* method. The method can do whatever it needs with the event (logging it, performing +* some processing, ignore it ...). The return value of the method will be used by +* the propagator to stop or resume propagation, possibly changing the state vector.<p> +* +* @author Luc Maisonobe +* @author Véronique Pommier-Maurussane +*/ +public class PythonEventHandler<T extends EventDetector> implements EventHandler<T> +{ + + static final long serialVersionUID = 1L; + + /** Part of JCC Python interface to object */ + private long pythonObject; + + /** Part of JCC Python interface to object */ + public void pythonExtension(long pythonObject) + { + this.pythonObject = pythonObject; + } + + /** Part of JCC Python interface to object */ + public long pythonExtension() + { + return this.pythonObject; + } + + /** Part of JCC Python interface to object */ + public void finalize() + throws Throwable + { + pythonDecRef(); + } + + /** Part of JCC Python interface to object */ + public native void pythonDecRef(); + + + + + /** + * eventOccurred method mirrors the same interface method as in {@link EventDetector} + * and its subclasses, but with an additional parameter that allows the calling + * method to pass in an object from the detector which would have potential + * additional data to allow the implementing class to determine the correct + * return state. + * + * @param s SpaceCraft state to be used in the evaluation + * @param detector object with appropriate type that can be used in determining correct return state + * @param increasing with the event occured in an "increasing" or "decreasing" slope direction + * @return the Action that the calling detector should pass back to the evaluation system + * + * @exception OrekitException if some specific error occurs + */ + public native Action eventOccurred(SpacecraftState s, T detector, boolean increasing) throws OrekitException; + + /** Reset the state prior to continue propagation. + * <p>This method is called after the step handler has returned and + * before the next step is started, but only when {@link + * #eventOccurred} has itself returned the {@link Action#RESET_STATE} + * indicator. It allows the user to reset the state for the next step, + * without perturbing the step handler of the finishing step. If the + * {@link #eventOccurred} never returns the {@link Action#RESET_STATE} + * indicator, this function will never be called, and it is safe to simply return null.</p> + * @param detector object with appropriate type that can be used in determining correct return state + * @param oldState old state + * @return new state + * @exception OrekitException if the state cannot be reseted + */ + public native SpacecraftState resetState(T detector, SpacecraftState oldState) throws OrekitException; + + +} + diff --git a/orekit-java-wrappers/src/main/java/org/orekit/python/PythonOrekitFixedStepHandler.java b/orekit-java-wrappers/src/main/java/org/orekit/python/PythonOrekitFixedStepHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..9c11265c3a7d2b7efc8e41c0cd71ae945f92ed61 --- /dev/null +++ b/orekit-java-wrappers/src/main/java/org/orekit/python/PythonOrekitFixedStepHandler.java @@ -0,0 +1,85 @@ +/** Copyright 2014 SSC and 2002-2014 CS Systèmes d'Information + * Licensed to CS Systèmes d'Information (CS) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * CS licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// this file was created by SCC and is largely a derived work from the +// original file OrekitFixedStepHandler.java created by CS Systèmes d'Information + +package org.orekit.python; +import org.orekit.propagation.sampling.OrekitFixedStepHandler; + +import org.orekit.errors.OrekitException; +import org.orekit.propagation.SpacecraftState; +import org.orekit.time.AbsoluteDate; + +/** This interface is a space-dynamics aware fixed size step handler. + * + * <p>It mirrors the <code>FixedStepHandler</code> interface from <a + * href="http://commons.apache.org/math/">commons-math</a> but provides + * a space-dynamics interface to the methods.</p> + * @author Luc Maisonobe + */ + +public class PythonOrekitFixedStepHandler implements OrekitFixedStepHandler { + + private static final long serialVersionUID = 1L; + + /** Part of JCC Python interface to object */ + private long pythonObject; + + /** Part of JCC Python interface to object */ + public void pythonExtension(long pythonObject) + { + this.pythonObject = pythonObject; + } + + /** Part of JCC Python interface to object */ + public long pythonExtension() + { + return this.pythonObject; + } + + /** Part of JCC Python interface to object */ + public void finalize() + throws Throwable + { + pythonDecRef(); + } + + /** Part of JCC Python interface to object */ + public native void pythonDecRef(); + + /** Initialize step handler at the start of a propagation. + * <p> + * This method is called once at the start of the propagation. It + * may be used by the step handler to initialize some internal data + * if needed. + * </p> + * @param s0 initial state + * @param t target time for the integration + */ + public native void init(SpacecraftState s0, AbsoluteDate t) throws OrekitException; + + /** Handle the current step. + * @param currentState current state at step time + * @param isLast if true, this is the last integration step + * @exception PropagationException if step cannot be handled + */ + + public native void handleStep(final SpacecraftState currentState, final boolean isLast) + throws OrekitException; + +} diff --git a/orekit-java-wrappers/src/main/java/org/orekit/python/PythonUnivariateFunction.java b/orekit-java-wrappers/src/main/java/org/orekit/python/PythonUnivariateFunction.java new file mode 100644 index 0000000000000000000000000000000000000000..b4a0c8dc2e68b2a986c4fd821f3d961926b2991f --- /dev/null +++ b/orekit-java-wrappers/src/main/java/org/orekit/python/PythonUnivariateFunction.java @@ -0,0 +1,72 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// this file was created by SCC and is largely a derived work from the +// original file UnivariateFunction.java + +package org.orekit.python; + +/** import org.hipparchus.analysis.UnivariateFunction; **/ + + +public class PythonUnivariateFunction implements org.hipparchus.analysis.UnivariateFunction { + + static final long serialVersionUID = 1L; + + /** Part of JCC Python interface to object */ + private long pythonObject; + + /** Part of JCC Python interface to object */ + public void pythonExtension(long pythonObject) + { + this.pythonObject = pythonObject; + } + + /** Part of JCC Python interface to object */ + public long pythonExtension() + { + return this.pythonObject; + } + + /** Part of JCC Python interface to object */ + public void finalize() + throws Throwable + { + pythonDecRef(); + } + + /** Part of JCC Python interface to object */ + public native void pythonDecRef(); + + + /** + * Compute the value of the function. + * + * @param x Point at which the function value should be computed. + * @return the value of the function. + * @throws IllegalArgumentException when the activated method itself can + * ascertain that a precondition, specified in the API expressed at the + * level of the activated method, has been violated. + * When Commons Math throws an {@code IllegalArgumentException}, it is + * usually the consequence of checking the actual parameters passed to + * the method. + */ + @Override + public native double value(double x); + +} + diff --git a/orekit-java-wrappers/src/main/java/org/orekit/python/package-info.java b/orekit-java-wrappers/src/main/java/org/orekit/python/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..a6cf9bf3d94fa9ff3c6cad90622084d19e773503 --- /dev/null +++ b/orekit-java-wrappers/src/main/java/org/orekit/python/package-info.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * + * This package provides an interface to python based on JCC as an interface. + * <p> + * Description + * </p> + * @author Petrus Hyvonen + * @since 6.1 + */ +package org.orekit.python;