Skip to content

Commit 33bfd8f

Browse files
committed
Updates for Python wrappers for 12.0
1 parent 8dd3f0a commit 33bfd8f

File tree

115 files changed

+1425
-3184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+1425
-3184
lines changed

src/main/java/org/hipparchus/analysis/PythonFieldUnivariateFunction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.hipparchus.analysis.FieldUnivariateFunction;
2525

2626
public class PythonFieldUnivariateFunction implements org.hipparchus.analysis.FieldUnivariateFunction {
27-
static final long serialVersionUID = 1L;
2827

2928
/** Part of JCC Python interface to object */
3029
private long pythonObject;

src/main/java/org/hipparchus/analysis/PythonUnivariateFunction.java

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,23 @@
2020

2121
package org.hipparchus.analysis;
2222

23+
import org.orekit.python.JCCBase;
24+
2325
/** import org.hipparchus.analysis.UnivariateFunction; **/
2426

2527

2628
public class PythonUnivariateFunction implements UnivariateFunction {
2729

28-
static final long serialVersionUID = 1L;
29-
30-
/** Part of JCC Python interface to object */
31-
private long pythonObject;
32-
33-
/** Part of JCC Python interface to object */
34-
public void pythonExtension(long pythonObject)
35-
{
36-
this.pythonObject = pythonObject;
37-
}
38-
39-
/** Part of JCC Python interface to object */
40-
public long pythonExtension()
41-
{
42-
return this.pythonObject;
43-
}
44-
45-
/** Part of JCC Python interface to object */
46-
public void finalize()
47-
throws Throwable
48-
{
49-
pythonDecRef();
50-
}
51-
52-
/** Part of JCC Python interface to object */
53-
public native void pythonDecRef();
54-
30+
/** Part of JCC Python interface to object */
31+
protected long pythonObject;
32+
public void pythonExtension(long pythonObject) {
33+
this.pythonObject = pythonObject;
34+
}
35+
public long pythonExtension() {
36+
return this.pythonObject;
37+
}
38+
public void finalize() throws Throwable { pythonDecRef(); }
39+
public native void pythonDecRef();
5540

5641
/** {@inheritDoc} */
5742
@Override

src/main/java/org/orekit/attitudes/PythonAttitudeProviderModifier.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929

3030
public class PythonAttitudeProviderModifier implements AttitudeProviderModifier {
3131

32-
private static final long serialVersionUID = 4242537148465131675L;
33-
3432
/** Part of JCC Python interface to object */
3533
private long pythonObject;
3634

src/main/java/org/orekit/estimation/leastsquares/PythonAbstractBatchLSModel.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
import org.orekit.orbits.Orbit;
1010
import org.orekit.propagation.MatricesHarvester;
1111
import org.orekit.propagation.Propagator;
12-
import org.orekit.propagation.conversion.OrbitDeterminationPropagatorBuilder;
12+
import org.orekit.propagation.conversion.PropagatorBuilder;
1313
import org.orekit.propagation.integration.AbstractIntegratedPropagator;
14-
import org.orekit.propagation.integration.AbstractJacobiansMapper;
1514
import org.orekit.utils.ParameterDriversList;
1615

1716
import java.util.List;
@@ -21,17 +20,8 @@ public class PythonAbstractBatchLSModel extends AbstractBatchLSModel {
2120
/** Part of JCC Python interface to object */
2221
private long pythonObject;
2322

24-
/**
25-
* Constructor.
26-
*
27-
* @param propagatorBuilders builders to use for propagation
28-
* @param measurements measurements
29-
* @param estimatedMeasurementsParameters estimated measurements parameters
30-
* @param mappers jacobian mappers
31-
* @param observer observer to be notified at model calls
32-
*/
33-
public PythonAbstractBatchLSModel(OrbitDeterminationPropagatorBuilder[] propagatorBuilders, List<ObservedMeasurement<?>> measurements, ParameterDriversList estimatedMeasurementsParameters, AbstractJacobiansMapper[] mappers, ModelObserver observer) {
34-
super(propagatorBuilders, measurements, estimatedMeasurementsParameters, mappers, observer);
23+
public PythonAbstractBatchLSModel(PropagatorBuilder[] propagatorBuilders, List<ObservedMeasurement<?>> measurements, ParameterDriversList estimatedMeasurementsParameters, ModelObserver observer) {
24+
super(propagatorBuilders, measurements, estimatedMeasurementsParameters, observer);
3525
}
3626

3727
/** Part of JCC Python interface to object */
@@ -90,7 +80,7 @@ public void finalize()
9080

9181
/** {@inheritDoc} */
9282
@Override
93-
public native AbstractJacobiansMapper configureDerivatives(Propagator propagators);
83+
public native MatricesHarvester configureHarvester(Propagator propagator);
9484

9585
/** {@inheritDoc} */
9686
@Override

src/main/java/org/orekit/estimation/measurements/PythonAbstractMeasurement.java

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,17 @@ public void finalize()
5151
/** Part of JCC Python interface to object */
5252
public native void pythonDecRef();
5353

54-
/**
55-
* Estimate the theoretical value.
56-
* Extension point for Python.
57-
* <p>
58-
* The theoretical value does not have <em>any</em> modifiers applied.
59-
* </p>
60-
*
61-
* @param iteration iteration number
62-
* @param evaluation evaluation number
63-
* @param states orbital states at measurement date
64-
* @return theoretical value
65-
* @see #estimate(int, int, SpacecraftState[])
66-
*/
54+
/** {@inheritDoc} */
6755
@Override
6856
public native EstimatedMeasurement<T> theoreticalEvaluation(int iteration, int evaluation, SpacecraftState[] states);
6957

70-
/**
71-
* Add a parameter driver.
72-
*
73-
* @param driver parameter driver to add
74-
* @since 9.3
75-
*/
58+
/** {@inheritDoc} */
7659
@Override
7760
public void addParameterDriver(ParameterDriver driver) {
7861
super.addParameterDriver(driver);
7962
}
63+
64+
/** {@inheritDoc} */
65+
@Override
66+
public native EstimatedMeasurementBase<T> theoreticalEvaluationWithoutDerivatives(int iteration, int evaluation, SpacecraftState[] states);
8067
}

src/main/java/org/orekit/estimation/measurements/PythonEstimationModifier.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,13 @@ public void finalize()
5050
/** Part of JCC Python interface to object */
5151
public native void pythonDecRef();
5252

53-
/**
54-
* Get the drivers for this modifier parameters.
55-
*
56-
* @return drivers for this modifier parameters
57-
*/
58-
@Override
53+
/** {@inheritDoc} */ @Override
5954
public native List<ParameterDriver> getParametersDrivers();
6055

61-
/**
62-
* Apply a modifier to an estimated measurement.
63-
*
64-
* @param estimated estimated measurement to modify
65-
*/
56+
/** {@inheritDoc} */
6657
@Override
58+
public native void modifyWithoutDerivatives(EstimatedMeasurementBase<T> estimated);
59+
60+
/** {@inheritDoc} */ @Override
6761
public native void modify(EstimatedMeasurement<T> estimated);
6862
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package org.orekit.estimation.measurements;
2+
3+
import org.orekit.propagation.SpacecraftState;
4+
import org.orekit.time.AbsoluteDate;
5+
6+
public class PythonGroundReceiverMeasurement<T extends GroundReceiverMeasurement<T>> extends GroundReceiverMeasurement<T> {
7+
public PythonGroundReceiverMeasurement(GroundStation station, boolean twoWay, AbsoluteDate date, double observed, double sigma, double baseWeight, ObservableSatellite satellite) {
8+
super(station, twoWay, date, observed, sigma, baseWeight, satellite);
9+
}
10+
11+
/** Part of JCC Python interface to object */
12+
protected long pythonObject;
13+
14+
/** Part of JCC Python interface to object */
15+
public void pythonExtension(long pythonObject) {
16+
this.pythonObject = pythonObject;
17+
}
18+
19+
/** Part of JCC Python interface to object */
20+
public long pythonExtension() {
21+
return this.pythonObject;
22+
}
23+
24+
/** Part of JCC Python interface to object */
25+
public void finalize() throws Throwable {
26+
pythonDecRef();
27+
}
28+
29+
/** Part of JCC Python interface to object */
30+
public native void pythonDecRef();
31+
32+
@Override
33+
public native EstimatedMeasurementBase<T> theoreticalEvaluationWithoutDerivatives(int iteration, int evaluation, SpacecraftState[] states);
34+
35+
@Override
36+
public native EstimatedMeasurement<T> theoreticalEvaluation(int iteration, int evaluation, SpacecraftState[] states);
37+
}

src/main/java/org/orekit/estimation/measurements/PythonObservedMeasurement.java

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,23 @@
2121
import org.orekit.propagation.SpacecraftState;
2222
import org.orekit.time.AbsoluteDate;
2323
import org.orekit.utils.ParameterDriver;
24-
24+
import org.orekit.python.JCCBase;
2525
import java.util.List;
2626
import java.util.SortedSet;
2727

28-
public class PythonObservedMeasurement<T extends ObservedMeasurement<T>> implements ObservedMeasurement<T> {
29-
30-
/** Part of JCC Python interface to object */
31-
private long pythonObject;
28+
public class PythonObservedMeasurement<T extends ObservedMeasurement<T>> implements ObservedMeasurement<T> {
3229

3330
/** Part of JCC Python interface to object */
34-
public void pythonExtension(long pythonObject)
35-
{
31+
protected long pythonObject;
32+
public void pythonExtension(long pythonObject) {
3633
this.pythonObject = pythonObject;
3734
}
38-
39-
/** Part of JCC Python interface to object */
40-
public long pythonExtension()
41-
{
35+
public long pythonExtension() {
4236
return this.pythonObject;
4337
}
44-
45-
/** Part of JCC Python interface to object */
46-
public void finalize()
47-
throws Throwable
48-
{
49-
pythonDecRef();
50-
}
51-
52-
/** Part of JCC Python interface to object */
38+
public void finalize() throws Throwable { pythonDecRef(); }
5339
public native void pythonDecRef();
54-
40+
5541
/**
5642
* Enable or disable a measurement.
5743
* <p>
@@ -162,7 +148,10 @@ public void finalize()
162148
@Override
163149
public native List<ObservableSatellite> getSatellites();
164150

165-
/**
151+
@Override
152+
public native EstimatedMeasurementBase<T> estimateWithoutDerivatives(int iteration, int evaluation, SpacecraftState[] states);
153+
154+
/**
166155
* Estimate the theoretical value of the measurement.
167156
* <p>
168157
* The estimated value is the <em>combination</em> of the raw estimated

src/main/java/org/orekit/estimation/measurements/generation/PythonAbstractMeasurementBuilder.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
import org.orekit.estimation.measurements.ObservedMeasurement;
66
import org.orekit.estimation.measurements.generation.AbstractMeasurementBuilder;
77
import org.orekit.propagation.SpacecraftState;
8+
import org.orekit.propagation.sampling.OrekitStepInterpolator;
89
import org.orekit.time.AbsoluteDate;
910

11+
import java.util.Map;
12+
1013
public class PythonAbstractMeasurementBuilder<T extends ObservedMeasurement<T>> extends AbstractMeasurementBuilder<T> {
1114
/** Part of JCC Python interface to object */
1215
private long pythonObject;
@@ -135,14 +138,7 @@ public ObservableSatellite[] getSatellites() {
135138
return super.getSatellites();
136139
}
137140

138-
139-
/**
140-
* Generate a single measurement.
141-
* Extension point for Python.
142-
*
143-
* @param states spacecraft states
144-
* @return generated measurement
145-
*/
146141
@Override
147-
public native T build(SpacecraftState[] states);
142+
public native T build(AbsoluteDate date, Map<ObservableSatellite, OrekitStepInterpolator> interpolators);
143+
148144
}

src/main/java/org/orekit/estimation/measurements/generation/PythonAbstractScheduler.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.orekit.estimation.measurements.generation.AbstractScheduler;
55
import org.orekit.estimation.measurements.generation.MeasurementBuilder;
66
import org.orekit.propagation.sampling.OrekitStepInterpolator;
7+
import org.orekit.time.AbsoluteDate;
78
import org.orekit.time.DatesSelector;
89

910
import java.util.List;
@@ -23,6 +24,7 @@ public PythonAbstractScheduler(MeasurementBuilder<T> builder, DatesSelector sele
2324
super(builder, selector);
2425
}
2526

27+
2628
/** Part of JCC Python interface to object */
2729
public void pythonExtension(long pythonObject)
2830
{
@@ -45,13 +47,7 @@ public void finalize()
4547
/** Part of JCC Python interface to object */
4648
public native void pythonDecRef();
4749

48-
/**
49-
* Generate a sequence of measurements.
50-
* Extension point for Python.
51-
*
52-
* @param interpolators interpolators for spacecraft states
53-
* @return generated measurements
54-
*/
5550
@Override
56-
public native SortedSet<T> generate(List<OrekitStepInterpolator> interpolators);
51+
public native boolean measurementIsFeasible(AbsoluteDate date);
52+
5753
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package org.orekit.estimation.measurements.generation;
2+
3+
import org.orekit.estimation.measurements.ObservedMeasurement;
4+
import org.orekit.python.JCCBase;
5+
import org.orekit.time.AbsoluteDate;
6+
7+
public class PythonGeneratedMeasurementSubscriber implements GeneratedMeasurementSubscriber {
8+
/** Part of JCC Python interface to object */
9+
protected long pythonObject;
10+
public void pythonExtension(long pythonObject) {
11+
this.pythonObject = pythonObject;
12+
}
13+
public long pythonExtension() {
14+
return this.pythonObject;
15+
}
16+
public void finalize() throws Throwable { pythonDecRef(); }
17+
public native void pythonDecRef();
18+
19+
@Override
20+
public native void init(AbsoluteDate start, AbsoluteDate end);
21+
22+
@Override
23+
public native void handleGeneratedMeasurement(ObservedMeasurement<?> measurement);
24+
}

src/main/java/org/orekit/estimation/measurements/generation/PythonMeasurementBuilder.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@
2222
package org.orekit.estimation.measurements.generation;
2323

2424
import org.orekit.estimation.measurements.EstimationModifier;
25+
import org.orekit.estimation.measurements.ObservableSatellite;
2526
import org.orekit.estimation.measurements.ObservedMeasurement;
2627
import org.orekit.propagation.SpacecraftState;
2728

29+
import org.orekit.propagation.sampling.OrekitStepInterpolator;
2830
import org.orekit.time.AbsoluteDate;
2931

3032
import java.util.List;
33+
import java.util.Map;
3134

3235
public class PythonMeasurementBuilder<T extends ObservedMeasurement<T>> implements MeasurementBuilder<T> {
3336
/** Part of JCC Python interface to object */
@@ -86,12 +89,10 @@ public void finalize()
8689
@Override
8790
public native List<EstimationModifier<T>> getModifiers();
8891

89-
/**
90-
* Generate a single measurement.
91-
*
92-
* @param states all spacecraft states (i.e. including ones that may not be relevant for the current builder)
93-
* @return generated measurement
94-
*/
9592
@Override
96-
public native T build(SpacecraftState[] states);
93+
public native ObservableSatellite[] getSatellites();
94+
95+
@Override
96+
public native T build(AbsoluteDate date, Map<ObservableSatellite, OrekitStepInterpolator> interpolators);
97+
9798
}

0 commit comments

Comments
 (0)