Commit ec15cd20 authored by Petrus Hyvönen's avatar Petrus Hyvönen
Browse files

Updates for orekit-7.0

parent 12bcf28c
......@@ -5,7 +5,7 @@ The python orekit wrapper requires:
- The JCC tool version 2.19 or later http://lucene.apache.org/pylucene/jcc/
- a java JDK
The easiest way to install the orekit wrapper is to use pre-build packages.
The easiest way to install the orekit wrapper is to use pre-build packages. A recipe for a conda package for orekit is included in the repository.
To build the wrapper from scratch:
......
This diff is collapsed.
{
"metadata": {
"name": "",
"signature": "sha256:a70389cde274629d23839213febb16c646daa34e884926d5228d53a84f75939a"
"signature": "sha256:aacb18b7dc0a16b68f6bb2c8b830331f6433a8d1cf81eef28b99cb7162290d07"
},
"nbformat": 3,
"nbformat_minor": 0,
......@@ -118,7 +118,7 @@
"output_type": "stream",
"stream": "stdout",
"text": [
"Java version: 1.6.0_35\n"
"Java version: 1.7.0_45\n"
]
}
],
......
This diff is collapsed.
No preview for this file type
/** 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.time.AbsoluteDate;
/** Common parts shared by several orbital events finders.
* @see org.orekit.propagation.Propagator#addEventDetector(EventDetector)
* @author Luc Maisonobe
*/
public abstract class PythonAbstractDetector extends AbstractDetector {
/** 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();
/** Build a new instance.
* @param maxCheck maximum checking interval (s)
* @param threshold convergence threshold (s)
* @param maxIter maximum number of iterations in the event time search
*/
public PythonAbstractDetector(final double maxCheck, final double threshold, final int maxIter) {
super(maxCheck, threshold, maxIter);
}
/** Build a new instance.
* @param maxCheck maximum checking interval (s)
* @param threshold convergence threshold (s)
*/
public PythonAbstractDetector(final double maxCheck, final double threshold) {
super(maxCheck, threshold);
}
/** {@inheritDoc} */
public native void init(final SpacecraftState s0, final AbsoluteDate t);
/** {@inheritDoc} */
public native double g(SpacecraftState s) throws OrekitException;
/** {@inheritDoc} */
public native double getMaxCheckInterval();
/** {@inheritDoc} */
public native int getMaxIterationCount();
/** {@inheritDoc} */
public native double getThreshold();
}
/** 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.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();
@Override
public native void init(SpacecraftState s0, AbsoluteDate t);
@Override
public native double g(SpacecraftState s) throws OrekitException;
@Override
public native double getThreshold();
@Override
public native double getMaxCheckInterval();
@Override
public native int getMaxIterationCount();
@Override
public native SpacecraftState resetState(SpacecraftState oldState) throws OrekitException;
@Override
public native Action eventOccurred(SpacecraftState s, boolean increasing)
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 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 package provides classes that are made to be interfaced to the JCC tool
* that provides an interface between Java and C++/Python. Creating specific
* objects like in this package enables subclassing with the possibility to call
* Python methods from java, which is useful for some classes in orekit.
*
* All methods that are to be overridden shall be declared native.
* See http://lucene.apache.org/pylucene/jcc/features.html for details.
*
* @author Petrus Hyvonen
*/
package org.orekit.python;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment