Skip to content
Snippets Groups Projects
Commit 44be6740 authored by Petrus Hyvönen's avatar Petrus Hyvönen
Browse files

Update for orekit 8.0

parent c0d76b84
No related branches found
No related tags found
No related merge requests found
Showing
with 548 additions and 0 deletions
File added
File added
File added
File added
File added
File added
File added
/** 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);
}
/** 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&eacute;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;
}
/** 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&eacute;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;
}
/** 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;
}
/**
* 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);
}
/*
* 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;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment