Greetings,
From the repository of Clément Jonglez (a.k.a GorgiAstro), I have managed to determine orbits by using BLS estimator with ILRS data.
As a next step towards understanding orbit determination and propagation, I’ve dived into OD with Kalman Estimator and retraced the following Java codes and Orekit forum posts:
- KalmanOrbitDeterminationObserver.java
- Use of Kalman Filters in the OD post
- Getting Access to KalmanEstimation from Kalman Filter Results post
So basically, I have tried to implement KalmanEstimator instead of BLS estimator in the code of GorgiAstro as following:
from org.orekit.estimation.sequential import PythonKalmanObserver
class MyObserver(PythonKalmanObserver):
def __init__(self):
super(MyObserver, self).__init__()
def evaluationPerformed(self, estimation):
print(estimation.getCorrectedMeasurement().getObservedValue())
# The propagator builder to use in the Kalman filter. initial covariance matrix
initP = MatrixUtils.createRealDiagonalMatrix([.1e4, 4.e3, 1., 5.e-3, 6.e-5, 1.e-4])
# The process noise matrices provider to use, consistent with the builder. process noise matrix
initQ = MatrixUtils.createRealDiagonalMatrix([1.e-4, 1.e-4, 1.e-4, 1.e-10, 1.e-10, 1.e-10])
# Setting up the estimator
kalman_estimator_builder = KalmanEstimatorBuilder()
kalman_estimator_builder.addPropagationConfiguration(propagatorBuilder,ConstantProcessNoise(initP, initQ))
kalman_estimator = kalman_estimator_builder.build()
#Adding the observer
kalman_observer = MyObserver()
kalman_estimator.setObserver(kalman_observer)
In the above piece of code I am confused with the output of the line:
print(estimation.getCorrectedMeasurement().getObservedValue())
It gives me bunch of range values but I am somewhat lost here. If I understand the implementation correctly, estimationStep method updates the observation data at each iteration but where are these printed range values coming from and how should associate them?
Another issue I am facing is in the following code. Aforementioned estimationStep method is utilized here to feed the observation range data to the KalmanEstimator for each observation. However, I am not sure if I should do it this way.
observableSatellite = ObservableSatellite(0) # Propagator index = 0
for receiveTime, slrData in slrDataFrame.iterrows():
if slrData['station-id'] in stationData.index: # Checking if station exists in the SLRF2014_POS+VEL, because it might not be up-to-date
if not np.isnan(slrData['range']): # If this data point contains a valid range measurement
orekitRange = Range(stationData.loc[slrData['station-id'], 'OrekitGroundStation'],
True, # Two-way measurement
datetime_to_absolutedate(receiveTime),
slrData['range'],
range_sigma,
range_weight,
observableSatellite)
newPropagator = kalman_estimator.estimationStep(orekitRange) # Range data is now processed
In the above Java codes and posts, processMeasurements method is often used, so I thought maybe I should also utilize this method instead of estimationStep. Can processMeasurements method be used in the loop instead of estimationStep method? I also tried it, however, it does not accept orekitRange as input argument, in fact it does not even accept any kind of list argument for my case.
I am somewhat new to Python and I have no knowledge in Java so these might be a bit messy, sorry for that in advance. I can further try to clarify any vague part, if there is.
Thank you for the discussions!
Baris