1. CovarianceMatrix#

class CovarianceMatrix(row_list: list[list], epoch: int, frame: str = 'J2000', from_list: bool = False, corr_factors=None, sequence_added_sigmas=None, definition=None)#

Bases: object

Represents a covariance matrix.

Provides methods to manipulate and perform operations on covariance matrices.

Parameters:
  • row_list (list[list]) – A list of lists representing the covariance matrix.

  • epoch (int) – The epoch of the covariance matrix.

  • frame (str, optional) – The reference frame of the covariance matrix. Defaults to 'J2000'.

  • from_list (bool, optional) – Indicates whether the covariance matrix should be constructed from a list. Defaults to False.

  • corr_factors (list, optional) – A list of correlation factors for the off-diagonal elements. Defaults to None.

  • added_sigmas (list, optional) – A list of additional standard deviations for the sequence scenario. Defaults to None.

  • definition (DEPRECATED, optional) – The sequence or state definition. Defaults to None.

Attributes

definition

The sequence or state definition.

epoch

The epoch of the covariance matrix.

frame

The reference frame of the covariance matrix.

matrix

The covariance matrix represented as a list of lists.

Methods

covariance_matrix_from_list(sigmas, corr_matrix)

Constructs a covariance matrix from a list of ArrayWUnits objects.

matrix_without_units()

Iterates over each element in the covariance matrix and extracts the values without units.

reinitialize_with_matrix(new_matrix[, ...])

Re-initializes the class with a new covariance matrix.

vector_to_correlation_matrix(diag_cov, ...)

Converts a vector of correlation factors and a vector of diagonal covariance values into a correlation matrix.

covariance_matrix_from_list(sigmas: list[ArrayWUnits], corr_matrix: float) None#

Constructs a covariance matrix from a list of ArrayWUnits objects.

Parameters:
  • sigmas (list[ArrayWUnits]) – A list of ArrayWUnits objects representing the standard deviations.

  • corr_factor (float) – The correlation factor for the off-diagonal elements.

  • Raises – Exception: If any element in the sigmas input list is not an ArrayWUnits object.

Return type:

None

matrix_without_units()#

Iterates over each element in the covariance matrix and extracts the values without units. The resulting matrix is then converted into a numpy array.

Returns:

no_units – The covariance matrix without units.

Return type:

numpy.ndarray

reinitialize_with_matrix(new_matrix: ndarray, new_epoch: float = None, new_frame: str = None) Self#

Re-initializes the class with a new covariance matrix.

Parameters:
  • new_matrix (numpy.ndarray) – The new covariance matrix.

  • new_epoch (float, optional) – The new epoch value. Defaults to None.

  • new_frame (str, optional) – The new frame value. Defaults to None.

Returns:

re_init – The re-initialized covariance matrix object.

Return type:

CovarianceMatrix

vector_to_correlation_matrix(diag_cov: list, upper_tri_vec: list) ndarray#

Converts a vector of correlation factors and a vector of diagonal covariance values into a correlation matrix.

Parameters:
  • diag_cov (list) – A list of diagonal covariance values.

  • upper_tri_vec (list) – A list of correlation factors for the upper triangular part of the matrix.

  • Returns

  • corr_mat (numpy.ndarray) – The correlation matrix.

property definition#

The sequence or state definition.

property epoch: int#

The epoch of the covariance matrix.

property frame: str#

The reference frame of the covariance matrix.

property matrix: list[list[ArrayWUnits]]#

The covariance matrix represented as a list of lists.