StateCovariance:init method forces an orbit type change to vocariance

I defined a keplerian propagator with a StateCovarianceMatrixProvider, using a MatricesHarvester. The initial covariance state is define in QSW. Everything is in cartesian orbit type.

When I try to propagate the covariance, the StateCovariance.init method forces an orbit type change, even if the STM and the covariance already have the same type. The issue here is that if the definition frame is non inertial (QSW), the orbit type change is impossible, and an exception is thrown in StateCovariance.changeCovarianceType().

So, why is the orbit type change mandatory ? Is there something I’m missing here ?
Thanks !

Hi @bruno,

I’ve looked at the code and this is indeed a problem to fix.

Initially, the changeCovarianceType() was designed to return an error because it would necessarily be expressed in Cartesian (for non-inertial frame) but it turns out that this may be a bit too punishing for the user in addition to causing this issue. I’m going to add a check so that it can work if the type is changed from Cartesian to Cartesian (useless indeed but not impossible nor false).

I’m opening an issue about this and I’m going to work on it ASAP.


Thanks for the quick reply and the fix ! Indeed an orbit type equality check seems the good answer here.
Cheers !

You’re welcome, fix is already under testing. I still have a minor issue to solve but it should be done by tomorrow for sure.

Hi @bruno,

Thanks again for pointing out this issue, a merge request has been opened :+1:.