File size: 3,095 Bytes
5ab75a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
function [r1_J2K, v1_J2K, C1_J2K, r2_J2K, v2_J2K, C2_J2K] = Pc_TestSetup(FileName)
% Pc2D_Foster_UnitTest_TestSetup - returns the necessary parameters 
%                                  (position, velocity, and covariance) for
%                                  both the primary and secondary objects
%                                  for Pc_2D_Foster from a CDM ( used only
%                                  for unit testing)
%
% Syntax: [r1_J2K, v1_J2K, C1_J2K, r2_J2K, v2_J2K, C2_J2K] = ...
%                                                 Pc2D_TestSetup(FileName);
%
% =========================================================================
%
% Copyright (c) 2023 United States Government as represented by the
% Administrator of the National Aeronautics and Space Administration.
% All Rights Reserved.
%
% =========================================================================
%
% Input:
%
%   FileName    -   Location of CDM input file
%
% =========================================================================
%
% Output:
%
%   r1_J2K  -   Position of the primary in J2000 coordinates (km)     [1x3]
%   v1_J2K  -   Velocity of the primary in J2000 coordinates (km/s)   [1x3]
%   C1_J2K  -   Covariance of the primary in    [3x3],[6x6], or [nxn] (n>6)
%               J2000 coordinates
%   r2_J2K  -   Position of the secondary in J2000 coordinates (km)   [1x3]
%   v2_J2K  -   Velocity of the secondary in J2000 coordinates (km/s) [1x3]
%   C2_J2K  -   Covariance of the secondary in  [3x3],[6x6], or [nxn] (n>6)
%               J2000 coordinates
%
% =========================================================================
% 
% Dependencies:
%
%   Pc_ObjectSetup.m
%
% =========================================================================
%
% Initial version: Aug 2023;  Latest update: Aug 2023
%
% ----------------- BEGIN CODE -----------------

    % Get test case file
    [~, cdmobj] = read_cdm(FileName);
    
    % Set up Primary Object State and Covariance
    [r1_J2K, v1_J2K, C1_J2K] = Pc_ObjectSetup(cdmobj, 1);

    % Set up Secondary Object State and Covariance
    [r2_J2K, v2_J2K, C2_J2K] = Pc_ObjectSetup(cdmobj, 2);
end

% ----------------- END OF CODE -----------------
%
% Please record any changes to the software in the change history 
% shown below:
%
% ----------------- CHANGE HISTORY ------------------
% Developer      |    Date    |     Description
% ---------------------------------------------------
% E. White       | 08-07-2023 | Initial development (adapted from T.
%                               Lechtenberg's original
%                               Pc_Foster_2D_UnitTest code)
% E. White       | 08-11-2023 | Fixed typo in function name

% =========================================================================
%
% Copyright (c) 2023 United States Government as represented by the
% Administrator of the National Aeronautics and Space Administration.
% All Rights Reserved.
%
% =========================================================================