Hello All,
I am writing an Orbit Determination code based on the great laser orbit determination tutorial: Jupyter Notebook Viewer
In the tutorial the Range performance is extracted from the following piece of code:
for estMeas in estimatedMeasurements:
estMeas = EstimatedMeasurement.cast_(estMeas)
observedValue = estMeas.getObservedValue()
estimatedValue = estMeas.getEstimatedValue()
pyDateTime = absolutedate_to_datetime(estMeas.date)
observedRangeSeries[pyDateTime] = observedValue[0]
estimatedRangeSeries[pyDateTime] = estimatedValue[0]
However, my code also includes RangeRate and AzEl besides Range, and I have tried extracting the respective values via, for example:
for estMeas in estimatedMeasurements:
estMeas = EstimatedMeasurement.cast_(estMeas)
observedValue = estMeas.getObservedValue()
estimatedValue = estMeas.getEstimatedValue()
pyDateTime = absolutedate_to_datetime(estMeas.date)
observedRangeRateSeries[pyDateTime] = observedValue[1]
estimatedRangeRateSeries[pyDateTime] = estimatedValue[1]
i.e., trying to vary the positional factors of observedValue and estimatedValue, but without success.
My question is, how can I extract the respective lists of RRate and EzEl from the estimated orbit in order to evaluate residuals, in a similar way that is done for Range in the tutorial?
Many thanks in advance.
/Leonardo.
Hi @lghizoni
Is there a way in Python to know if an object is an instance of a class type?
If think you can try using the Python method isinstance()
.
I ask this question because in the Java tutorials of Orekit we look at this condition (i.e. instance of
) to extract the statistics for the different measurement types. Indeed, the estimator only returns a list of estimated measurements without differences on the type. Please find the following example used in the Orekit tutorials:
// Compute some statistics
for (final Map.Entry<ObservedMeasurement<?>, EstimatedMeasurement<?>> entry : estimator.getLastEstimations().entrySet()) {
if (entry.getKey() instanceof Range) {
final EstimatedMeasurement<Range> evaluation = (EstimatedMeasurement<Range>) entry.getValue();
// Fill range statistics
} else if (entry.getKey() instanceof RangeRate) {
final EstimatedMeasurement<RangeRate> evaluation = (EstimatedMeasurement<RangeRate>) entry.getValue();
// Fill range rate statistics
} else if (entry.getKey() instanceof AngularAzEl) {
final EstimatedMeasurement<AngularAzEl> evaluation = (EstimatedMeasurement<AngularAzEl>) entry.getValue();
// Fill az-el statistics
}
}
The isinstance()
method could help you to translate this code in Python.
Best regards,
Bryan
1 Like
Hi @lghizoni,
Just a quick remark on:
Beware that RangeRate is a one dimensional measurement, so you should still use index 0 for this one (instead of 1 in your example).
AzEl is two dimensional, with index 0 you’ll get the azimuth and with index 1 the elevation (both in radians).
1 Like
Dear @bcazabonne,
Many thanks for the input! I will try to implement it in my code, and let you know the outcomes 
Best regards,
/Leonardo.