'Extract uncertainties from covariance matrices in dictionary Python

So I am propagating an initial covariance matrix to see the degradation of a measurement. What I end up having is a dictionary with covariance matrices computed at each time step of the shape nd.array(6,6). My question is if there is a python package to automatically extract the uncertainties from each matrix. This is what I have up to now:

covariance_to_propagate = pod_output.covariance

propagated_covariance_dict = dict()
for epoch in list(variational_equations_solver.state_history):
    STM = variational_equations_solver.state_transition_matrix_history[epoch]
    full_STM = STM
    # return propagated covariance at epoch
propagated_covariance_dict[epoch] = np.sqrt(np.diag(lalg.multi_dot([full_STM, covariance_to_propagate, full_STM.transpose()])))

Thank you for the help!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source