-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a83b258
commit d508e23
Showing
4 changed files
with
377 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
"""GRSS orbit propagation subpackage""" | ||
from .prop_simulation import * | ||
from .prop_unscented import * | ||
from .prop_utils import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""Unscented transformations for the GRSS orbit propagation code""" | ||
import numpy as np | ||
|
||
def generate_sigma_points(sol, cov): | ||
""" | ||
Generate sigma points for propagating uncertainties using the unscented | ||
transformation. | ||
Parameters | ||
---------- | ||
sol : dict | ||
solution dictionary from the SBDB API | ||
cov : numpy.ndarray | ||
covariance matrix of the solution | ||
Returns | ||
------- | ||
sigma_points : list | ||
list of dictionaries containing each of the sigma points | ||
""" | ||
assert len(sol)-1 == cov.shape[0] | ||
assert cov.shape[0] == cov.shape[1] | ||
dim = cov.shape[0] | ||
sqrt_cov = np.linalg.cholesky(cov) | ||
sol_array = np.array([sol[key] for key in sol if key != 't']) | ||
sigma_points = [list(sol_array)] | ||
fac = dim**0.5 | ||
for i in range(dim): | ||
plus = sol_array + fac*sqrt_cov.T[i] | ||
minus = sol_array - fac*sqrt_cov.T[i] | ||
sigma_points.append(list(plus)) | ||
sigma_points.append(list(minus)) | ||
# convert sigma points to dict | ||
for i in range(2*dim+1): | ||
sigma_points[i] = {key: sigma_points[i][j-1] for j, key in enumerate(sol) if key != 't'} | ||
return sigma_points |
Oops, something went wrong.