Commit 160e7428 authored by Jesse Mapel's avatar Jesse Mapel
Browse files

Updated SpicePosition unit test to test multi-segment polynomials and better...

Updated SpicePosition unit test to test multi-segment polynomials and better test polynomial over hermite.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/PiecewisePolynomials@8269 41f8697f-d340-4b68-9986-7bafba869bb8
parent 7551f1d3
Loading
Loading
Loading
Loading
+416 −112
Original line number Diff line number Diff line
Unit test for SpicePosition
Testing without cache ... 
Position information is cached? No
Time           = -69382819
Spacecraft (J) = -1730.4646 -1562.2157 2691.2806
Velocity   (J) = -4.1416836 1.1953724 -1.958384
@@ -32,6 +33,7 @@ Spacecraft (J) = -2908.5545 -1132.3409 1981.0142
Velocity   (J) = -3.4897306 1.5779899 -2.6234689

Testing with cache ... 
Position information is cached? Yes
Time           = -69382819
Spacecraft (J) = -1730.4646 -1562.2157 2691.2806
Velocity   (J) = -4.1416836 1.1953724 -1.958384
@@ -97,73 +99,73 @@ Velocity (J) = -3.4897306 1.5779899 -2.6234689

Testing with polynomial functions...
Time           = -69382819
Spacecraft (J) = -1730.4475 -1562.1986 2691.2512
Velocity (J) = -4.1218191 1.2118396 -1.9868448
Spacecraft (J) = -1730.3809 -1562.1515 2691.1696
Velocity   (J) = -4.1345489 1.2039902 -1.9732146
Time           = -69382785
Spacecraft (J) = -1870.5609 -1520.4151 2622.7076
Velocity (J) = -4.0850785 1.2438672 -2.0421458
Spacecraft (J) = -1870.576 -1520.4279 2622.7297
Velocity   (J) = -4.0833024 1.2447814 -2.0437395
Time           = -69382751
Spacecraft (J) = -2008.8516 -1477.1563 2551.614
Velocity (J) = -4.0215117 1.2930795 -2.1272575
Spacecraft (J) = -2008.8356 -1477.148 2551.5996
Velocity   (J) = -4.0217855 1.2931158 -2.1273138
Time           = -69382717
Spacecraft (J) = -2144.8786 -1432.2194 2477.6165
Velocity (J) = -3.9538877 1.3409582 -2.2101721
Spacecraft (J) = -2144.8845 -1432.2194 2477.6167
Velocity   (J) = -3.9543539 1.3407026 -2.2097271
Time           = -69382683
Spacecraft (J) = -2278.5785 -1385.7165 2400.9046
Velocity (J) = -3.8847094 1.3851462 -2.2868448
Spacecraft (J) = -2278.5781 -1385.7159 2400.9036
Velocity   (J) = -3.8839909 1.385416 -2.2873192
Time           = -69382648
Spacecraft (J) = -2409.8535 -1337.7387 2321.6307
Velocity (J) = -3.8113714 1.4277528 -2.3609357
Spacecraft (J) = -2409.8327 -1337.7296 2321.6147
Velocity   (J) = -3.811245 1.4278222 -2.3610567
Time           = -69382614
Spacecraft (J) = -2538.5495 -1288.3241 2239.8556
Velocity (J) = -3.7338252 1.4692066 -2.4331681
Spacecraft (J) = -2538.5481 -1288.323 2239.8537
Velocity   (J) = -3.7348516 1.4687595 -2.4323857
Time           = -69382580
Spacecraft (J) = -2664.5674 -1237.5411 2155.6938
Velocity (J) = -3.6547493 1.5076553 -2.5003078
Spacecraft (J) = -2664.5807 -1237.5466 2155.7033
Velocity   (J) = -3.6540356 1.5079704 -2.5008586
Time           = -69382546
Spacecraft (J) = -2787.8525 -1185.4981 2069.3292
Velocity (J) = -3.5722258 1.5439137 -2.5637586
Spacecraft (J) = -2787.8226 -1185.4842 2069.3049
Velocity   (J) = -3.5724973 1.5437867 -2.5635368
Time           = -69382512
Spacecraft (J) = -2908.0063 -1132.0887 1980.5734
Velocity (J) = -3.4649233 1.5919584 -2.6477786
Spacecraft (J) = -2908.447 -1132.2916 1980.9279
Velocity   (J) = -3.5040802 1.5738681 -2.6161683

Testing line cache...
Time           = -69382819
Spacecraft (J) = -1730.4475 -1562.1986 2691.2512
Velocity (J) = -4.1218191 1.2118396 -1.9868448
Spacecraft (J) = -1730.3809 -1562.1515 2691.1696
Velocity   (J) = -4.1345489 1.2039902 -1.9732146
Time           = -69382785
Spacecraft (J) = -1870.5609 -1520.4151 2622.7076
Velocity (J) = -4.0850785 1.2438672 -2.0421458
Spacecraft (J) = -1870.576 -1520.4279 2622.7297
Velocity   (J) = -4.0833024 1.2447814 -2.0437395
Time           = -69382751
Spacecraft (J) = -2008.8516 -1477.1563 2551.614
Velocity (J) = -4.0215117 1.2930795 -2.1272575
Spacecraft (J) = -2008.8356 -1477.148 2551.5996
Velocity   (J) = -4.0217855 1.2931158 -2.1273138
Time           = -69382717
Spacecraft (J) = -2144.8786 -1432.2194 2477.6165
Velocity (J) = -3.9538877 1.3409582 -2.2101721
Spacecraft (J) = -2144.8845 -1432.2194 2477.6167
Velocity   (J) = -3.9543539 1.3407026 -2.2097271
Time           = -69382683
Spacecraft (J) = -2278.5785 -1385.7165 2400.9046
Velocity (J) = -3.8847094 1.3851462 -2.2868448
Spacecraft (J) = -2278.5781 -1385.7159 2400.9036
Velocity   (J) = -3.8839909 1.385416 -2.2873192
Time           = -69382648
Spacecraft (J) = -2409.8535 -1337.7387 2321.6307
Velocity (J) = -3.8113714 1.4277528 -2.3609357
Spacecraft (J) = -2409.8327 -1337.7296 2321.6147
Velocity   (J) = -3.811245 1.4278222 -2.3610567
Time           = -69382614
Spacecraft (J) = -2538.5495 -1288.3241 2239.8556
Velocity (J) = -3.7338252 1.4692066 -2.4331681
Spacecraft (J) = -2538.5481 -1288.323 2239.8537
Velocity   (J) = -3.7348516 1.4687595 -2.4323857
Time           = -69382580
Spacecraft (J) = -2664.5674 -1237.5411 2155.6938
Velocity (J) = -3.6547493 1.5076553 -2.5003078
Spacecraft (J) = -2664.5807 -1237.5466 2155.7033
Velocity   (J) = -3.6540356 1.5079704 -2.5008586
Time           = -69382546
Spacecraft (J) = -2787.8525 -1185.4981 2069.3292
Velocity (J) = -3.5722258 1.5439137 -2.5637586
Spacecraft (J) = -2787.8226 -1185.4842 2069.3049
Velocity   (J) = -3.5724973 1.5437867 -2.5635368
Time           = -69382512
Spacecraft (J) = -2908.0063 -1132.0887 1980.5734
Velocity (J) = -3.4649233 1.5919584 -2.6477786
Spacecraft (J) = -2908.447 -1132.2916 1980.9279
Velocity   (J) = -3.5040802 1.5738681 -2.6161683

Testing extrapolation...
Time           = -69382512
Spacecraft (J) = -2908.0063 -1132.0887 1980.5734
Spacecraft (J) = -2908.447 -1132.2916 1980.9279
Time           = -69382512
Spacecraft (J) = -2908.0066 -1132.0885 1980.5731
Spacecraft (J) = -2908.4473 -1132.2914 1980.9277

Testing Hermite function input ...
Source = 2
@@ -266,11 +268,39 @@ Velocity (J) = -3.4897304 1.5779899 -2.6234689

Test multi-segment polynomials.

Center Time Position: -2343.7355, -1362.4033, 2362.4108, 
Knots:
  -69382819
  -69382718
  -69382617
  -69382512
Scaled Knots:
  -153.6
  -52.100892
  48.819895
  153.6
Base Time: -69382665.760519
Time Scale: 1.0
Segment 1 coefficients:
  X: -2344.1589 -3.8638884 0.00092156296
  Y: -1362.1939 1.4140186 0.00070910526
  Z: 2362.0648 -2.3363875 -0.0012261861
Segment 2 coefficients:
  X: -2343.7355 -3.8476328 0.0010775644
  Y: -1362.4033 1.4059785 0.00063194561
  Z: 2362.4108 -2.3231065 -0.0010987317
Segment 3 coefficients:
  X: -2343.4527 -3.8592163 0.0011961997
  Y: -1362.6283 1.4151967 0.00053753502
  Z: 2362.788 -2.3385626 -0.00094043458
Coordinate Partials:
  X: 1 -50.906148 2591.4359
  Y: 1 -50.906148 2591.4359
  Z: 1 -50.906148 2591.4359
Velocity Partials:
  X: 0 1 -101.8123
  Y: 0 1 -101.8123
  Z: 0 1 -101.8123
Object = Table
  Name                 = TestPoly
  StartByte            = 0
@@ -310,36 +340,310 @@ Object = Table
  End_Group
End_Object
Time           = -69382819
Segment Index  = 0
Spacecraft (J) = -1730.4182 -1562.2259 2691.2979
Velocity   (J) = -4.1463281 1.1966928 -1.9605873
Time           = -69382785
Segment Index  = 0
Spacecraft (J) = -1870.7818 -1520.5803 2622.9933
Velocity   (J) = -4.083457 1.2450695 -2.0442404
Time           = -69382751
Segment Index  = 0
Spacecraft (J) = -2009.0007 -1477.2845 2551.8353
Velocity   (J) = -4.0205859 1.2934463 -2.1278936
Time           = -69382717
Segment Index  = 1
Spacecraft (J) = -2145.0749 -1432.3386 2477.8239
Velocity   (J) = -3.9573421 1.3416386 -2.2112421
Time           = -69382683
Segment Index  = 1
Spacecraft (J) = -2278.8104 -1385.8385 2401.1175
Velocity   (J) = -3.8838282 1.3847514 -2.2862001
Time           = -69382648
Segment Index  = 1
Spacecraft (J) = -2410.0383 -1337.8678 2321.8542
Velocity   (J) = -3.8103144 1.4278641 -2.361158
Time           = -69382614
Segment Index  = 2
Spacecraft (J) = -2538.7577 -1288.4271 2240.0351
Velocity   (J) = -3.7361819 1.4704845 -2.4352904
Time           = -69382580
Segment Index  = 2
Spacecraft (J) = -2664.8111 -1237.6418 2155.8704
Velocity   (J) = -3.6545745 1.5071563 -2.499449
Time           = -69382546
Segment Index  = 2
Spacecraft (J) = -2788.0809 -1185.6056 2069.5172
Velocity   (J) = -3.5729671 1.5438282 -2.5636075
Time           = -69382512
Segment Index  = 2
Spacecraft (J) = -2908.5669 -1132.3184 1980.9754
Velocity   (J) = -3.4913597 1.5805 -2.627766

Test loading a polynomial table.

Knots:
  -69382819
  -69382718
  -69382617
  -69382512
Base Time: -69382665.760519
Time Scale: 1.0
Time           = -69382819
Segment Index  = 0
Spacecraft (J) = -1730.4182 -1562.2259 2691.2979
Velocity   (J) = -4.1463281 1.1966928 -1.9605873
Time           = -69382785
Segment Index  = 0
Spacecraft (J) = -1870.7818 -1520.5803 2622.9933
Velocity   (J) = -4.083457 1.2450695 -2.0442404
Time           = -69382751
Segment Index  = 0
Spacecraft (J) = -2009.0007 -1477.2845 2551.8353
Velocity   (J) = -4.0205859 1.2934463 -2.1278936
Time           = -69382717
Segment Index  = 1
Spacecraft (J) = 0 0 0
Velocity   (J) = 0 0 0
Time           = -69382683
Segment Index  = 1
Spacecraft (J) = 0 0 0
Velocity   (J) = 0 0 0
Time           = -69382648
Segment Index  = 1
Spacecraft (J) = 0 0 0
Velocity   (J) = 0 0 0
Time           = -69382614
Segment Index  = 2
Spacecraft (J) = -2538.7577 -1288.4271 2240.0351
Velocity   (J) = -3.7361819 1.4704845 -2.4352904
Time           = -69382580
Segment Index  = 2
Spacecraft (J) = -2664.8111 -1237.6418 2155.8704
Velocity   (J) = -3.6545745 1.5071563 -2.499449
Time           = -69382546
Segment Index  = 2
Spacecraft (J) = -2788.0809 -1185.6056 2069.5172
Velocity   (J) = -3.5729671 1.5438282 -2.5636075
Time           = -69382512
Segment Index  = 2
Spacecraft (J) = -2908.5669 -1132.3184 1980.9754
Velocity   (J) = -3.4913597 1.5805 -2.627766

Test loading a hermite cache from a polynomial.

Object = Table
  Name                 = HermiteTable
  StartByte            = 0
  Bytes                = 0
  Records              = Null
  ByteOrder            = NULL
  CacheType            = HermiteSpline
  SpkTableStartTime    = -69382819.360519
  SpkTableEndTime      = -69382512.160519
  SpkTableOriginalSize = 769.0

  Group = Field
    Name = J2000X
    Type = Double
    Size = 1
  End_Group

  Group = Field
    Name = J2000Y
    Type = Double
    Size = 1
  End_Group

  Group = Field
    Name = J2000Z
    Type = Double
    Size = 1
  End_Group

  Group = Field
    Name = J2000XV
    Type = Double
    Size = 1
  End_Group

  Group = Field
    Name = J2000YV
    Type = Double
    Size = 1
  End_Group

  Group = Field
    Name = J2000ZV
    Type = Double
    Size = 1
  End_Group

  Group = Field
    Name = ET
    Type = Double
    Size = 1
  End_Group
End_Object
Time           = -69382819
Spacecraft (J) = 57691.803 25140.313 -44025.639
Velocity   (J) = 163654.91 73544.614 -128668.5
Time           = -69382785
Spacecraft (J) = 2444340.6 1097772.4 -1920622.2
Velocity   (J) = -7349.7772 -3297.5591 5769.4632
Time           = -69382751
Spacecraft (J) = 673162.12 302055.27 -528479.04
Velocity   (J) = -80126.491 -36000.293 62983.994
Time           = -69382717
Spacecraft (J) = -1905178.3 -856365.81 1498226.8
Velocity   (J) = -54675.231 -24563.588 42975.095
Time           = -69382683
Spacecraft (J) = -1940015.2 -871845.53 1525318.4
Velocity   (J) = 69004.004 31012.556 -54257.234
Time           = -69382648
Spacecraft (J) = 1975118.5 887600.56 -1552883.7
Velocity   (J) = 66357.838 29821.093 -52172.893
Time           = -69382614
Spacecraft (J) = 1875175.9 842726.94 -1474376
Velocity   (J) = -55843.321 -25093.798 43902.35
Time           = -69382580
Spacecraft (J) = -717542.87 -322353.18 563966.48
Velocity   (J) = -79798.422 -35858.768 62735.986
Time           = -69382546
Spacecraft (J) = -2451755.7 -1101636.9 1927346.7
Velocity   (J) = -5507.4641 -2473.816 4328.0145
Time           = -69382512
Spacecraft (J) = 23819.752 10878.559 -19032.436
Velocity   (J) = 167029.55 75061.057 -131321.56
Original Time Cache:
  -69382819
  -69382779
  -69382739
  -69382700
  -69382660
  -69382620
  -69382580
  -69382540
  -69382513

Test converting from a hermite cache to a polynomial over hermite.

Knots:
  -69382819
  -69382666
  -69382512
Base Time: -69382665.760519
Time Scale: 1.0
Segment 1 coefficients:
  X: 0 0 0
  Y: 0 0 0
  Z: 0 0 0
Segment 2 coefficients:
  X: 0 0 0
  Y: 0 0 0
  Z: 0 0 0
Time           = -69382819
Segment Index  = 0
Spacecraft (J) = 57691.803 25140.313 -44025.639
Velocity   (J) = 163654.91 73544.614 -128668.5
Time           = -69382785
Segment Index  = 0
Spacecraft (J) = 2444340.6 1097772.4 -1920622.2
Velocity   (J) = -7349.7772 -3297.5591 5769.4632
Time           = -69382751
Segment Index  = 0
Spacecraft (J) = 673162.12 302055.27 -528479.04
Velocity   (J) = -80126.491 -36000.293 62983.994
Time           = -69382717
Segment Index  = 0
Spacecraft (J) = -1905178.3 -856365.81 1498226.8
Velocity   (J) = -54675.231 -24563.588 42975.095
Time           = -69382683
Segment Index  = 0
Spacecraft (J) = -1940015.2 -871845.53 1525318.4
Velocity   (J) = 69004.004 31012.556 -54257.234
Time           = -69382648
Segment Index  = 1
Spacecraft (J) = 1975118.5 887600.56 -1552883.7
Velocity   (J) = 66357.838 29821.093 -52172.893
Time           = -69382614
Segment Index  = 1
Spacecraft (J) = 1875175.9 842726.94 -1474376
Velocity   (J) = -55843.321 -25093.798 43902.35
Time           = -69382580
Segment Index  = 1
Spacecraft (J) = -717542.87 -322353.18 563966.48
Velocity   (J) = -79798.422 -35858.768 62735.986
Time           = -69382546
Segment Index  = 1
Spacecraft (J) = -2451755.7 -1101636.9 1927346.7
Velocity   (J) = -5507.4641 -2473.816 4328.0145
Time           = -69382512
Segment Index  = 1
Spacecraft (J) = 23819.752 10878.559 -19032.436
Velocity   (J) = 167029.55 75061.057 -131321.56

Test a polynomial over hermite with non-zero coefficients.

Segment 1 coefficients:
  X: 1 0.1 0.01
  Y: -2 -0.2 -0.02
  Z: 1.3 0.13 0.013
Segment 2 coefficients:
  X: -1 -0.1 -0.01
  Y: 2 0.2 0.02
  Z: -1.3 -0.13 -0.013
Time           = -69382819
Segment Index  = 0
Spacecraft (J) = 57912.302 24699.314 -43738.99
Bias       (J) = 220.49944 -440.99887 286.64927
Velocity   (J) = 163654.91 73544.614 -128668.5
Time           = -69382785
Segment Index  = 0
Spacecraft (J) = 2444471.6 1097510.4 -1920451.9
Bias       (J) = 131.00285 -262.0057 170.3037
Velocity   (J) = -7349.7772 -3297.5591 5769.4632
Time           = -69382751
Segment Index  = 0
Spacecraft (J) = 673226.9 301925.72 -528394.83
Bias       (J) = 64.777617 -129.55523 84.210902
Velocity   (J) = -80126.491 -36000.293 62983.994
Time           = -69382717
Segment Index  = 0
Spacecraft (J) = -1905156.4 -856409.46 1498255.2
Bias       (J) = 21.823744 -43.647488 28.370867
Velocity   (J) = -54675.231 -24563.588 42975.095
Time           = -69382683
Segment Index  = 0
Spacecraft (J) = -1940013 -871849.82 1525321.2
Bias       (J) = 2.1412289 -4.2824577 2.7835975
Velocity   (J) = 69004.004 31012.556 -54257.234
Time           = -69382648
Segment Index  = 1
Spacecraft (J) = 1975112.8 887612.02 -1552891.2
Bias       (J) = -5.7300718 11.460144 -7.4490934
Velocity   (J) = 66357.838 29821.093 -52172.893
Time           = -69382614
Segment Index  = 1
Spacecraft (J) = 1875143.3 842792.13 -1474418.4
Bias       (J) = -32.590273 65.180546 -42.367355
Velocity   (J) = -55843.321 -25093.798 43902.35
Time           = -69382580
Segment Index  = 1
Spacecraft (J) = -717625.6 -322187.73 563858.94
Bias       (J) = -82.721832 165.44366 -107.53838
Velocity   (J) = -79798.422 -35858.768 62735.986
Time           = -69382546
Segment Index  = 1
Spacecraft (J) = -2451911.8 -1101324.7 1927143.7
Bias       (J) = -156.12475 312.2495 -202.96217
Velocity   (J) = -5507.4641 -2473.816 4328.0145
Time           = -69382512
Segment Index  = 1
Spacecraft (J) = 23566.953 11384.157 -19361.075
Bias       (J) = -252.79902 505.59805 -328.63873
Velocity   (J) = 167029.55 75061.057 -131321.56

Test calculation of first coefficient for spacecraft velocity
  Velocity vector for center time = (0,0,0)
+257 −14

File changed.

Preview size limit exceeded, changes collapsed.