I am retrieving the EstimatedMeasurement objects from a batch least square estimator, coming from a mixed pool of observations. Is there a proper way to understand which object is what? Right now I’m inferring the type from the size of GetObservedValue, but this is not enough to discriminate between AngularRaDec and AngularAzEl for example. I would appreciate being able to retrieve the class of the original measurement given to the estimator. Should I try casting until I get lucky?
Maybe you could try using isInstance(…) method of Python inside if statements in order to have something close to have something close to what we do in the tutorials to compute residual statistics.
Well done guessing this was about the Python wrapper
I just edited the category accordingly, sorry for the wrong original tag
Actually I already tried the Python’s isinstance method, but it does not work, as we know the Python wrapper has difficulties coping with multiple inheritances from Java.
In the end, what works is as I expected try casting the ObservedMeasurement (not the EstimatedMeasurement) into the different candidates, until not catching a TypeError!
If someone has something more elegant, please drop it here.
However, for a future version, it could be possible to add a method getMeasurementType that would return the type of the measurement as a String.
It would then be much easier to understand which object an EstimatedMeasurement represents.
I would say, it depends on the situation. In that case, it is to retrieve the name of the class. For me, it’s not a bad practice for this specific case. Moreover, if it helps our python users, it confirms that in this case it is not a bad practice.
getClass() is used in orekit to access the name of the Earth’s potential loaders.