diff --git a/isis/src/base/objs/PolynomialUnivariate/PolynomialUnivariate.cpp b/isis/src/base/objs/PolynomialUnivariate/PolynomialUnivariate.cpp index 550fad5b1c..3c465f32c3 100644 --- a/isis/src/base/objs/PolynomialUnivariate/PolynomialUnivariate.cpp +++ b/isis/src/base/objs/PolynomialUnivariate/PolynomialUnivariate.cpp @@ -41,10 +41,11 @@ namespace Isis { /** - * Create a PolynomialUnivariate object - * - * @param degree The order/degree of the polynomial - * @param coeffs a list of the coefficients + * Create a PolynomialUnivariate object + * + * @param degree The order/degree of the polynomial + * @param coeffs a list of the coefficients in increasing degree. So the first + * element is the constant coefficient. */ PolynomialUnivariate::PolynomialUnivariate(int degree, std::vector coeffs) : Isis::Basis1VariableFunction("PolynomialUnivariate", (degree + 1)) { @@ -124,4 +125,3 @@ namespace Isis { } // end namespace isis - diff --git a/isis/src/base/objs/SpiceRotation/SpiceRotation.truth b/isis/src/base/objs/SpiceRotation/SpiceRotation.truth deleted file mode 100644 index 98ce29c88c..0000000000 --- a/isis/src/base/objs/SpiceRotation/SpiceRotation.truth +++ /dev/null @@ -1,714 +0,0 @@ -Unit test for SpiceRotation -Naif code = -94031 -Testing without cache (from SPICE)... -CJ(0) = -0.87506927 0.25477955 -0.41151081 - 0.011442263 0.86088548 0.50867009 - 0.48386242 0.44041295 -0.75624969 -av(0) = -1.3817139e-05 -0.0011493844 -0.00067443921 -CJ(1) = -0.85216522 0.27457809 -0.44544506 - 0.011408438 0.86081401 0.5087918 - 0.52314843 0.42849284 -0.73668827 -av(1) = -1.2759664e-05 -0.0011485667 -0.00067607282 -CJ(2) = -0.82753684 0.29372914 -0.47844118 - 0.011307844 0.86075918 0.50888679 - 0.56129752 0.41571243 -0.71563138 -av(2) = -1.4155561e-05 -0.001147111 -0.00067413283 -CJ(3) = -0.80133591 0.31214822 -0.51031779 - 0.011159773 0.86071999 0.50895635 - 0.59811054 0.40214997 -0.69320934 -av(3) = -1.2104446e-05 -0.0011411423 -0.00066849871 -CJ(4) = -0.77359018 0.32985508 -0.54106734 - 0.010977931 0.86068895 0.50901279 - 0.63359113 0.38782749 -0.66944164 -av(4) = -1.4107831e-05 -0.0011349124 -0.0006662493 -CJ(5) = -0.74451309 0.34675249 -0.57049362 - 0.010796958 0.86067614 0.50903832 - 0.66752055 0.3728261 -0.64452852 -av(5) = -1.1968844e-05 -0.0011267333 -0.00066073722 -CJ(6) = -0.71415 0.36283075 -0.59861809 - 0.010597655 0.86068385 0.50902947 - 0.69991247 0.35717945 -0.61850252 -av(6) = -8.9185184e-06 -0.0011163624 -0.00065670687 -CJ(7) = -0.68276816 0.37813868 -0.625171 - 0.010490873 0.86063983 0.50910611 - 0.73055977 0.34104285 -0.59158448 -av(7) = -1.3255742e-05 -0.0011054424 -0.00064995353 -CJ(8) = -0.6504334 0.39252175 -0.65027923 - 0.010371283 0.86063225 0.50912136 - 0.75949248 0.32440531 -0.56385491 -av(8) = -1.1327819e-05 -0.0010915537 -0.00063894876 -CJ(9) = -0.61729588 0.4060182 -0.67386573 - 0.010223693 0.86060645 0.50916796 - 0.78666465 0.30741789 -0.53539982 -av(9) = -1.2932496e-05 -0.0010747293 -0.00063276804 - -Testing with cache ... -Time = -69382819 -CJ(0) = -0.87506927 0.25477955 -0.41151081 - 0.011442263 0.86088548 0.50867009 - 0.48386242 0.44041295 -0.75624969 -av(0) = -1.3817139e-05 -0.0011493844 -0.00067443921 -Time = -69382785 -CJ(1) = -0.85216522 0.27457809 -0.44544506 - 0.011408438 0.86081401 0.5087918 - 0.52314843 0.42849284 -0.73668827 -av(1) = -1.2759664e-05 -0.0011485667 -0.00067607282 -Time = -69382751 -CJ(2) = -0.82753684 0.29372914 -0.47844118 - 0.011307844 0.86075918 0.50888679 - 0.56129752 0.41571243 -0.71563138 -av(2) = -1.4155561e-05 -0.001147111 -0.00067413283 -Time = -69382717 -CJ(3) = -0.80133591 0.31214822 -0.51031779 - 0.011159773 0.86071999 0.50895635 - 0.59811054 0.40214997 -0.69320934 -av(3) = -1.2104446e-05 -0.0011411423 -0.00066849871 -Time = -69382683 -CJ(4) = -0.77359018 0.32985508 -0.54106734 - 0.010977931 0.86068895 0.50901279 - 0.63359113 0.38782749 -0.66944164 -av(4) = -1.4107831e-05 -0.0011349124 -0.0006662493 -Time = -69382648 -CJ(5) = -0.74451309 0.34675249 -0.57049362 - 0.010796958 0.86067614 0.50903832 - 0.66752055 0.3728261 -0.64452852 -av(5) = -1.1968844e-05 -0.0011267333 -0.00066073722 -Time = -69382614 -CJ(6) = -0.71415 0.36283075 -0.59861809 - 0.010597655 0.86068385 0.50902947 - 0.69991247 0.35717945 -0.61850252 -av(6) = -8.9185184e-06 -0.0011163624 -0.00065670687 -Time = -69382580 -CJ(7) = -0.68276816 0.37813868 -0.625171 - 0.010490873 0.86063983 0.50910611 - 0.73055977 0.34104285 -0.59158448 -av(7) = -1.3255742e-05 -0.0011054424 -0.00064995353 -Time = -69382546 -CJ(8) = -0.6504334 0.39252175 -0.65027923 - 0.010371283 0.86063225 0.50912136 - 0.75949248 0.32440531 -0.56385491 -av(8) = -1.1327819e-05 -0.0010915537 -0.00063894876 -Time = -69382512 -CJ(9) = -0.61729588 0.4060182 -0.67386573 - 0.010223693 0.86060645 0.50916796 - 0.78666465 0.30741789 -0.53539982 -av(9) = -1.2932496e-05 -0.0010747293 -0.00063276804 -Cache Size: 10 - -Testing with functions ... -Source = 3 -Time = -69382819 -CJ(0) = -0.87506744 0.25462094 -0.41161286 - 0.011738947 0.86135321 0.5078709 - 0.48385863 0.43958939 -0.75673113 -av(0) = 3.9588092e-05 -0.0011571406 -0.00066422493 -Time = -69382785 -CJ(1) = -0.85215758 0.27464212 -0.44542021 - 0.011286673 0.86064824 0.50907487 - 0.52316352 0.42878469 -0.73650771 -av(1) = 1.2612887e-05 -0.0011528552 -0.00066929916 -Time = -69382751 -CJ(2) = -0.82753094 0.29389355 -0.47835042 - 0.011001086 0.86036145 0.50956565 - 0.56131231 0.41641897 -0.71520887 -av(2) = -7.8092276e-06 -0.001146583 -0.00067221199 -Time = -69382717 -CJ(3) = -0.80130119 0.31232593 -0.51026357 - 0.010876467 0.86037533 0.5095449 - 0.59816227 0.40274907 -0.69281678 -av(3) = -2.1501533e-05 -0.0011389681 -0.00067272227 -Time = -69382683 -CJ(4) = -0.77358897 0.32991801 -0.54103069 - 0.010878267 0.86056939 0.50921703 - 0.63359432 0.3880392 -0.66931593 -av(4) = -2.8366393e-05 -0.0011306014 -0.00067058131 -Time = -69382648 -CJ(5) = -0.7445192 0.34667611 -0.57053207 - 0.010943787 0.86082321 0.50878643 - 0.66751135 0.37255749 -0.64469335 -av(5) = -2.8375445e-05 -0.0011220116 -0.00066553371 -Time = -69382614 -CJ(6) = -0.71421902 0.36263313 -0.5986555 - 0.010983412 0.86101859 0.50845487 - 0.69983609 0.35657286 -0.6189388 -av(6) = -2.1559923e-05 -0.0011136579 -0.00065731818 -Time = -69382580 -CJ(7) = -0.68281661 0.37784723 -0.62529429 - 0.010882256 0.86104113 0.50841887 - 0.73050876 0.34035224 -0.59204502 -av(7) = -8.001423e-06 -0.0011059244 -0.00064566852 -Time = -69382546 -CJ(8) = -0.65044065 0.39240013 -0.65034537 - 0.010502127 0.86078088 0.50886735 - 0.75948448 0.324158 -0.56400791 -av(8) = 1.2176658e-05 -0.0010991161 -0.00063031469 -Time = -69382512 -CJ(9) = -0.61722064 0.40639527 -0.67370733 - 0.0096837405 0.86013226 0.50997914 - 0.78673052 0.30824564 -0.53482681 -av(9) = 3.8816777e-05 -0.0010934565 -0.00061098396 - -Testing with polynomial functions over Spice ... -Source = 4 -Time = -69382819 -CJ(0) = -0.87809698 0.25267525 -0.40632612 - 0.010857485 0.85950052 0.51101953 - 0.4783595 0.44431303 -0.75746823 -av(0) = 3.6136802e-05 -0.001148937 -0.00071783127 -Time = -69382785 -CJ(1) = -0.85534528 0.27482047 -0.43915619 - 0.01383053 0.85950782 0.51093544 - 0.5178737 0.43095246 -0.73897687 -av(1) = 2.6818529e-05 -0.0011482899 -0.00072824243 -Time = -69382751 -CJ(2) = -0.83089148 0.29534676 -0.47158206 - 0.015622983 0.85955538 0.51080376 - 0.55621513 0.41705497 -0.71881144 -av(2) = 1.5045992e-05 -0.0011468841 -0.00073507982 -Time = -69382717 -CJ(3) = -0.80487479 0.31420086 -0.50344253 - 0.0162853 0.8597142 0.5105157 - 0.59322117 0.40270251 -0.69707915 -av(3) = 6.7201932e-06 -0.00114088 -0.0007382229 -Time = -69382683 -CJ(4) = -0.77730696 0.33143284 -0.53473934 - 0.015873612 0.86003947 0.50998054 - 0.62892123 0.38792318 -0.6737757 -av(4) = -5.6601096e-06 -0.0011345655 -0.00074475059 -Time = -69382648 -CJ(5) = -0.74837985 0.34697393 -0.56527576 - 0.01447613 0.86059696 0.50908086 - 0.66311239 0.37280285 -0.64907626 -av(5) = -1.3898006e-05 -0.001126288 -0.00074801566 -Time = -69382614 -CJ(6) = -0.71811664 0.36084247 -0.59506403 - 0.012135221 0.86143483 0.50772312 - 0.69581695 0.35738319 -0.62298959 -av(6) = -2.1224594e-05 -0.0011158407 -0.00075276262 -Time = -69382580 -CJ(7) = -0.68675883 0.37311393 -0.62381752 - 0.0090314657 0.86251995 0.50594245 - 0.72682924 0.34182646 -0.59571296 -av(7) = -3.5938808e-05 -0.0011049021 -0.00075478687 -Time = -69382546 -CJ(8) = -0.65434784 0.38366056 -0.65163908 - 0.005132805 0.86396924 0.50351842 - 0.75617628 0.32613145 -0.56730566 -av(8) = -4.4387854e-05 -0.0010910882 -0.00075255999 -Time = -69382512 -CJ(9) = -0.62100725 0.39254656 -0.67842257 - 0.00050302319 0.86574982 0.50047677 - 0.78380466 0.31045844 -0.53783438 -av(9) = -5.6369117e-05 -0.0010744677 -0.00075515738 - -Test fitting polynomial function over cache to new cache -Source = 2 -Time = -69382819 -CJ(0) = -0.87809698 0.25267525 -0.40632612 - 0.010857485 0.85950052 0.51101953 - 0.4783595 0.44431303 -0.75746823 -av(0) = 3.6136802e-05 -0.001148937 -0.00071783127 -Time = -69382785 -CJ(1) = -0.85534528 0.27482047 -0.43915619 - 0.01383053 0.85950782 0.51093544 - 0.5178737 0.43095246 -0.73897687 -av(1) = 2.6818529e-05 -0.0011482899 -0.00072824243 -Time = -69382751 -CJ(2) = -0.83089148 0.29534676 -0.47158206 - 0.015622983 0.85955538 0.51080376 - 0.55621513 0.41705497 -0.71881144 -av(2) = 1.5045992e-05 -0.0011468841 -0.00073507982 -Time = -69382717 -CJ(3) = -0.80487479 0.31420086 -0.50344253 - 0.0162853 0.8597142 0.5105157 - 0.59322117 0.40270251 -0.69707915 -av(3) = 6.7201932e-06 -0.00114088 -0.0007382229 -Time = -69382683 -CJ(4) = -0.77730696 0.33143284 -0.53473934 - 0.015873612 0.86003947 0.50998054 - 0.62892123 0.38792318 -0.6737757 -av(4) = -5.6601096e-06 -0.0011345655 -0.00074475059 -Time = -69382648 -CJ(5) = -0.74837985 0.34697393 -0.56527576 - 0.01447613 0.86059696 0.50908086 - 0.66311239 0.37280285 -0.64907626 -av(5) = -1.3898006e-05 -0.001126288 -0.00074801566 -Time = -69382614 -CJ(6) = -0.71811664 0.36084247 -0.59506403 - 0.012135221 0.86143483 0.50772312 - 0.69581695 0.35738319 -0.62298959 -av(6) = -2.1224594e-05 -0.0011158407 -0.00075276262 -Time = -69382580 -CJ(7) = -0.68675883 0.37311393 -0.62381752 - 0.0090314657 0.86251995 0.50594245 - 0.72682924 0.34182646 -0.59571296 -av(7) = -3.5938808e-05 -0.0011049021 -0.00075478687 -Time = -69382546 -CJ(8) = -0.65434784 0.38366056 -0.65163908 - 0.005132805 0.86396924 0.50351842 - 0.75617628 0.32613145 -0.56730566 -av(8) = -4.4387854e-05 -0.0010910882 -0.00075255999 -Time = -69382512 -CJ(9) = -0.62100725 0.39254656 -0.67842257 - 0.00050302319 0.86574982 0.50047677 - 0.78380466 0.31045844 -0.53783438 -av(9) = -5.6369117e-05 -0.0010744677 -0.00075515738 - -Testing ToReferencePartial method -For angles (ra,dec,twist) = 1.9429654 2.1356375 -0.92665897 - For lookJ = 0.78673052 0.30824564 -0.53482681 -Right ascension partial on A applied to lookJ =: -0.50997914 -0.67370733 0 -Right ascension partial on B applied to lookJ =: -0.50997914 -0.67370733 0 -Right ascension partial on C applied to lookJ =: -0.50997914 -0.67370733 0 -Declination partial on A applied to lookJ =: -0.7977269 0.60301797 0 - -Twist partial on A applied to lookJ =: 0.0011693703 -0.00020943951 0 - -Testing with setting functions ... -Source = 3 -Time = -69382819 -CJ(0) = -0.87506744 0.25462094 -0.41161286 - 0.011738947 0.86135321 0.5078709 - 0.48385863 0.43958939 -0.75673113 -av(0) = 3.9588092e-05 -0.0011571406 -0.00066422493 -Time = -69382785 -CJ(1) = -0.85215758 0.27464212 -0.44542021 - 0.011286673 0.86064824 0.50907487 - 0.52316352 0.42878469 -0.73650771 -av(1) = 1.2612887e-05 -0.0011528552 -0.00066929916 -Time = -69382751 -CJ(2) = -0.82753094 0.29389355 -0.47835042 - 0.011001086 0.86036145 0.50956565 - 0.56131231 0.41641897 -0.71520887 -av(2) = -7.8092276e-06 -0.001146583 -0.00067221199 -Time = -69382717 -CJ(3) = -0.80130119 0.31232593 -0.51026357 - 0.010876467 0.86037533 0.5095449 - 0.59816227 0.40274907 -0.69281678 -av(3) = -2.1501533e-05 -0.0011389681 -0.00067272227 -Time = -69382683 -CJ(4) = -0.77358897 0.32991801 -0.54103069 - 0.010878267 0.86056939 0.50921703 - 0.63359432 0.3880392 -0.66931593 -av(4) = -2.8366393e-05 -0.0011306014 -0.00067058131 -Time = -69382648 -CJ(5) = -0.7445192 0.34667611 -0.57053207 - 0.010943787 0.86082321 0.50878643 - 0.66751135 0.37255749 -0.64469335 -av(5) = -2.8375445e-05 -0.0011220116 -0.00066553371 -Time = -69382614 -CJ(6) = -0.71421902 0.36263313 -0.5986555 - 0.010983412 0.86101859 0.50845487 - 0.69983609 0.35657286 -0.6189388 -av(6) = -2.1559923e-05 -0.0011136579 -0.00065731818 -Time = -69382580 -CJ(7) = -0.68281661 0.37784723 -0.62529429 - 0.010882256 0.86104113 0.50841887 - 0.73050876 0.34035224 -0.59204502 -av(7) = -8.001423e-06 -0.0011059244 -0.00064566852 -Time = -69382546 -CJ(8) = -0.65044065 0.39240013 -0.65034537 - 0.010502127 0.86078088 0.50886735 - 0.75948448 0.324158 -0.56400791 -av(8) = 1.2176658e-05 -0.0010991161 -0.00063031469 -Time = -69382512 -CJ(9) = -0.61722064 0.40639527 -0.67370733 - 0.0096837405 0.86013226 0.50997914 - 0.78673052 0.30824564 -0.53482681 -av(9) = 3.8816777e-05 -0.0010934565 -0.00061098396 - -Testing line cache... -Time = -69382819 -CJ(0) = -0.87506744 0.25462094 -0.41161286 - 0.011738947 0.86135321 0.5078709 - 0.48385863 0.43958939 -0.75673113 -av(0) = 3.9588092e-05 -0.0011571406 -0.00066422493 -Time = -69382785 -CJ(1) = -0.85215758 0.27464212 -0.44542021 - 0.011286673 0.86064824 0.50907487 - 0.52316352 0.42878469 -0.73650771 -av(1) = 1.2612887e-05 -0.0011528552 -0.00066929916 -Time = -69382751 -CJ(2) = -0.82753094 0.29389355 -0.47835042 - 0.011001086 0.86036145 0.50956565 - 0.56131231 0.41641897 -0.71520887 -av(2) = -7.8092276e-06 -0.001146583 -0.00067221199 -Time = -69382717 -CJ(3) = -0.80130119 0.31232593 -0.51026357 - 0.010876467 0.86037533 0.5095449 - 0.59816227 0.40274907 -0.69281678 -av(3) = -2.1501533e-05 -0.0011389681 -0.00067272227 -Time = -69382683 -CJ(4) = -0.77358897 0.32991801 -0.54103069 - 0.010878267 0.86056939 0.50921703 - 0.63359432 0.3880392 -0.66931593 -av(4) = -2.8366393e-05 -0.0011306014 -0.00067058131 -Time = -69382648 -CJ(5) = -0.7445192 0.34667611 -0.57053207 - 0.010943787 0.86082321 0.50878643 - 0.66751135 0.37255749 -0.64469335 -av(5) = -2.8375445e-05 -0.0011220116 -0.00066553371 -Time = -69382614 -CJ(6) = -0.71421902 0.36263313 -0.5986555 - 0.010983412 0.86101859 0.50845487 - 0.69983609 0.35657286 -0.6189388 -av(6) = -2.1559923e-05 -0.0011136579 -0.00065731818 -Time = -69382580 -CJ(7) = -0.68281661 0.37784723 -0.62529429 - 0.010882256 0.86104113 0.50841887 - 0.73050876 0.34035224 -0.59204502 -av(7) = -8.001423e-06 -0.0011059244 -0.00064566852 -Time = -69382546 -CJ(8) = -0.65044065 0.39240013 -0.65034537 - 0.010502127 0.86078088 0.50886735 - 0.75948448 0.324158 -0.56400791 -av(8) = 1.2176658e-05 -0.0010991161 -0.00063031469 -Time = -69382512 -CJ(9) = -0.61722064 0.40639527 -0.67370733 - 0.0096837405 0.86013226 0.50997914 - 0.78673052 0.30824564 -0.53482681 -av(9) = 3.8816777e-05 -0.0010934565 -0.00061098396 - -Testing tables ... -Time = -69382819 -CJ(0) = -0.87506744 0.25462094 -0.41161286 - 0.011738947 0.86135321 0.5078709 - 0.48385863 0.43958939 -0.75673113 -av(0) = 3.9588092e-05 -0.0011571406 -0.00066422493 -Time = -69382785 -CJ(1) = -0.85215758 0.27464212 -0.44542021 - 0.011286673 0.86064824 0.50907487 - 0.52316352 0.42878469 -0.73650771 -av(1) = 1.2612887e-05 -0.0011528552 -0.00066929916 -Time = -69382751 -CJ(2) = -0.82753094 0.29389355 -0.47835042 - 0.011001086 0.86036145 0.50956565 - 0.56131231 0.41641897 -0.71520887 -av(2) = -7.8092276e-06 -0.001146583 -0.00067221199 -Time = -69382717 -CJ(3) = -0.80130119 0.31232593 -0.51026357 - 0.010876467 0.86037533 0.5095449 - 0.59816227 0.40274907 -0.69281678 -av(3) = -2.1501533e-05 -0.0011389681 -0.00067272227 -Time = -69382683 -CJ(4) = -0.77358897 0.32991801 -0.54103069 - 0.010878267 0.86056939 0.50921703 - 0.63359432 0.3880392 -0.66931593 -av(4) = -2.8366393e-05 -0.0011306014 -0.00067058131 -Time = -69382648 -CJ(5) = -0.7445192 0.34667611 -0.57053207 - 0.010943787 0.86082321 0.50878643 - 0.66751135 0.37255749 -0.64469335 -av(5) = -2.8375445e-05 -0.0011220116 -0.00066553371 -Time = -69382614 -CJ(6) = -0.71421902 0.36263313 -0.5986555 - 0.010983412 0.86101859 0.50845487 - 0.69983609 0.35657286 -0.6189388 -av(6) = -2.1559923e-05 -0.0011136579 -0.00065731818 -Time = -69382580 -CJ(7) = -0.68281661 0.37784723 -0.62529429 - 0.010882256 0.86104113 0.50841887 - 0.73050876 0.34035224 -0.59204502 -av(7) = -8.001423e-06 -0.0011059244 -0.00064566852 -Time = -69382546 -CJ(8) = -0.65044065 0.39240013 -0.65034537 - 0.010502127 0.86078088 0.50886735 - 0.75948448 0.324158 -0.56400791 -av(8) = 1.2176658e-05 -0.0010991161 -0.00063031469 -Time = -69382512 -CJ(9) = -0.61722064 0.40639527 -0.67370733 - 0.0096837405 0.86013226 0.50997914 - 0.78673052 0.30824564 -0.53482681 -av(9) = 3.8816777e-05 -0.0010934565 -0.00061098396 - -Testing vector methods -v = 0 0 1 -v = 0 0 1 -Testing with linear function ... -Source = 3 -Time = -69382819 -CJ(0) = -0.87506927 0.25477955 -0.41151081 - 0.011442263 0.86088548 0.50867009 - 0.48386242 0.44041295 -0.75624969 -Time = -69382512 -CJ(1) = -0.61729588 0.4060182 -0.67386573 - 0.010223693 0.86060645 0.50916796 - 0.78666465 0.30741789 -0.53539982 - -Testing Nadir rotation ... -Time = -69382819 -CJ(0) = -0.87397636 0.25584047 -0.41317186 - 0.011529483 0.86087973 0.50867786 - 0.48583166 0.43980876 -0.75533824 -Time = -69382785 -CJ(1) = -0.8510575 0.27545415 -0.44701918 - 0.011395904 0.86083688 0.50875338 - 0.52494883 0.42788419 -0.73576073 -Time = -69382751 -CJ(2) = -0.82643964 0.29447099 -0.47987952 - 0.011259757 0.86079693 0.508824 - 0.56291272 0.415109 -0.71471238 -Time = -69382717 -CJ(3) = -0.80023437 0.31282061 -0.5116329 - 0.011120698 0.86076027 0.50888906 - 0.59958426 0.4015408 -0.69228874 -Time = -69382683 -CJ(4) = -0.77256675 0.3304389 -0.54217225 - 0.010977542 0.86072774 0.5089472 - 0.63483865 0.38724396 -0.66859704 -Time = -69382648 -CJ(5) = -0.74357294 0.34727037 -0.57140403 - 0.01082962 0.86070008 0.50899715 - 0.66856713 0.37228842 -0.64375409 -Time = -69382614 -CJ(6) = -0.71339766 0.36327069 -0.59924801 - 0.010678492 0.86067708 0.50903923 - 0.70067806 0.35674833 -0.6178842 -Time = -69382580 -CJ(7) = -0.6821915 0.37840638 -0.62563837 - 0.010527022 0.86065772 0.50907512 - 0.73109776 0.34070061 -0.59111687 -Time = -69382546 -CJ(8) = -0.65010809 0.39265255 -0.65052551 - 0.010377232 0.86064111 0.50910626 - 0.75977087 0.32422345 -0.5635844 -Time = -69382512 -CJ(9) = -0.61730133 0.40599204 -0.67387649 - 0.010229777 0.86062698 0.50913313 - 0.78666029 0.30739495 -0.53541939 - -Testing angle wrapping... - Using anchor angle of 30, 240 changes to -120 - Using anchor angle of 30, -10 changes to -10 - Using anchor angle of 30, -180 changes to 180 - Using anchor angle of 30, 90 changes to 90 - - -Begin tests for PCK data... - -Test LoadPCFromSpice and all the coefficient accessors... -Test CacheLabel for PCK data... -Test LoadPCFromTable... -Io Pole RA coefficients = 268.05,-0.009,0 -Io Pole DEC coefficients = 64.5,0.003,0 -Io PM coefficients = 200.39,203.48895,0 -Io Pole RA Nutation/Precession coefficients = 0,0,0.094,0.024,0,0,0,0,0,0,0,0,0,0,0, -Io Pole DEC Nutation/Precession coefficients = 0,0,0.04,0.011,0,0,0,0,0,0,0,0,0,0,0, -Io PM Nutation/Precession coefficients = 0,0,-0.085,-0.022,0,0,0,0,0,0,0,0,0,0,0, -Io System Nutation/Precession constants = 73.32,24.62,283.9,355.8,119.9,229.8,352.25,113.35,146.64,49.24,99.360714,175.89537,300.32316,114.0123,49.511251, -Io System Nutation/Precession coefficients = 91472.9,45137.2,4850.7,1191.3,262.1,64.3,2382.6,6070,182945.8,90274.4,4850.4046,1191.9605,262.5475,6070.2476,64.3, - -Testing with PCK polynomial ... -Io Angles = -2.0466383,25.496441,-24.093155 - - - Mars original SPICE values for target body orientation unadjusted - Source = 2 - Time = -69382819 -CJ(0) = 0.65330574 -0.46117449 -0.60042459 - 0.61166293 0.78886884 0.059619006 - 0.44616149 -0.4062069 0.79745588 - Time = -69382785 -CJ(1) = 0.65478275 -0.45926576 -0.60027869 - 0.61008153 0.78998159 0.061070579 - 0.44616149 -0.4062069 0.79745588 - Time = -69382751 -CJ(2) = 0.65625594 -0.45735435 -0.60012927 - 0.60849657 0.79108972 0.062521795 - 0.44616149 -0.4062069 0.79745588 - Time = -69382717 -CJ(3) = 0.65772528 -0.45544026 -0.59997635 - 0.60690805 0.79219323 0.063972645 - 0.44616149 -0.4062069 0.79745588 - Time = -69382683 -CJ(4) = 0.65919078 -0.45352351 -0.59981992 - 0.60531598 0.79329211 0.065423122 - 0.44616149 -0.4062069 0.79745588 - Time = -69382648 -CJ(5) = 0.66065243 -0.45160411 -0.59965998 - 0.60372038 0.79438635 0.066873216 - 0.44616149 -0.4062069 0.79745588 - Time = -69382614 -CJ(6) = 0.66211021 -0.44968207 -0.59949654 - 0.60212124 0.79547595 0.068322919 - 0.44616149 -0.4062069 0.79745588 - Time = -69382580 -CJ(7) = 0.66356413 -0.4477574 -0.59932959 - 0.60051859 0.7965609 0.069772222 - 0.44616149 -0.4062069 0.79745588 - Time = -69382546 -CJ(8) = 0.66501416 -0.44583011 -0.59915914 - 0.59891242 0.79764119 0.071221118 - 0.44616149 -0.4062069 0.79745588 - Time = -69382512 -CJ(9) = 0.66646031 -0.44390022 -0.59898518 - 0.59730276 0.79871681 0.072669597 - 0.44616149 -0.4062069 0.79745588 - - -Now PCK polynomial values for angles unadjusted ... - Io PCK polynomial output - Source = 5 - Angles = -2.0466383,25.496441,-24.093155 - - Mars PCK polynomial output - Source = 5 - Time = -69382819 -CJ(0) = 0.65330574 -0.46117449 -0.60042459 - 0.61166293 0.78886884 0.059619006 - 0.44616149 -0.4062069 0.79745588 - Time = -69382785 -CJ(1) = 0.65478275 -0.45926576 -0.60027869 - 0.61008153 0.78998159 0.061070579 - 0.44616149 -0.4062069 0.79745588 - Time = -69382751 -CJ(2) = 0.65625594 -0.45735435 -0.60012927 - 0.60849657 0.79108972 0.062521795 - 0.44616149 -0.4062069 0.79745588 - Time = -69382717 -CJ(3) = 0.65772528 -0.45544026 -0.59997635 - 0.60690805 0.79219323 0.063972645 - 0.44616149 -0.4062069 0.79745588 - Time = -69382683 -CJ(4) = 0.65919078 -0.45352351 -0.59981992 - 0.60531598 0.79329211 0.065423122 - 0.44616149 -0.4062069 0.79745588 - Time = -69382648 -CJ(5) = 0.66065243 -0.45160411 -0.59965998 - 0.60372038 0.79438635 0.066873216 - 0.44616149 -0.4062069 0.79745588 - Time = -69382614 -CJ(6) = 0.66211021 -0.44968207 -0.59949654 - 0.60212124 0.79547595 0.068322919 - 0.44616149 -0.4062069 0.79745588 - Time = -69382580 -CJ(7) = 0.66356413 -0.4477574 -0.59932959 - 0.60051859 0.7965609 0.069772222 - 0.44616149 -0.4062069 0.79745588 - Time = -69382546 -CJ(8) = 0.66501416 -0.44583011 -0.59915914 - 0.59891242 0.79764119 0.071221118 - 0.44616149 -0.4062069 0.79745588 - Time = -69382512 -CJ(9) = 0.66646031 -0.44390022 -0.59898518 - 0.59730276 0.79871681 0.072669597 - 0.44616149 -0.4062069 0.79745588 - - -Testing angular velocity with Io data ... -SpiceRotation av = -6.3193326e-07 -1.7682968e-05 3.7102704e-05 -J2000 to body-fixed Naif av = -6.3193326e-07 -1.7682968e-05 3.7102704e-05 - - - -Testing partials for target body parameters... -For angles (ra,dec,rotation) = 1.9429654 2.1356375 -0.92665897 -Beginning with J2000 vector 0.78673052 0.30824564 -0.53482681 -lookB = 0.69294371 0.69249343 -0.20070344 - - dLookB with respect to ra = 0.56419869 -0.43208476 0.4571027 - Right ascension partial on A applied to dlookB =: 0.78673052 0.30824564 0 - - dLookB with respect to dec = -0.19972128 0.019831273 -0.62112827 - Declination partial on A applied to dlookB =: 0.27671521 -0.25193486 -0.53482681 - - dLookB with respect to rotation rate = -556.10123 556.46282 0 - Rotation rate partial on A applied to dlookB =: 565090.03 146205.39 -241683.3 - - dLookB with respect to rotation = 0.69249343 -0.69294371 0 - Rotation partial on A applied to dlookB =: 0.87627666 0.22671852 -0.37477468 - - -... Testing failure of body rotation with binary PCK - Source = 0 -Frame type is binary PCK and cannot be updated -End of PCK testing - - -Testing CK based body rotation with 67P/Churyumov–Gerasimenko data ... -Time = 4.6285471e+08 -CJ = 0.93816333 -0.34618155 -0.002810256 - 0.30996014 0.84356223 -0.43855157 - 0.15418909 0.41056193 0.89870163 - - -Testing loading cache from ALE ISD with only time dependent quaternions ... -Frame type = 3 -Is cached? Yes -Has AV? No -Time dependent frame chain = { -94031, 10014, 1 } -Time dependent frame chain = { -94031 } -Time = 0 -CJ(0) = -1 0 0 - 0 -1 0 - 0 0 1 -Time = 1 -CJ(1) = 2.220446e-16 1 0 - -1 2.220446e-16 0 - 0 0 1 -Time = 2 -CJ(2) = 2.220446e-16 1 0 - 1 -2.220446e-16 0 - 0 0 -1 -Time = 3 -CJ(3) = 0 0 -1 - -1 0 0 - 0 1 0 - - -Testing loading cache from ALE ISD with time dependent quaternions and AV ... -Has AV? Yes - - -Testing loading cache from ALE ISD with time dependent quaternions and constant rotation ... -Time dependent frame chain = { -94030, 10014, 1 } -Time dependent frame chain = { -94031, -94030 } -Time = 0 -CJ(0) = -1 0 0 - 0 0 1 - 0 -1 0 -Time = 1 -CJ(1) = 2.220446e-16 1 0 - 0 0 1 - -1 2.220446e-16 0 -Time = 2 -CJ(2) = 2.220446e-16 1 0 - 0 0 -1 - 1 -2.220446e-16 0 -Time = 3 -CJ(3) = 0 0 -1 - 0 1 0 - -1 0 0 - - -Testing exceptions... - -**I/O ERROR** Cannot find [INS-99999_TRANSX] in text kernels. - -**PROGRAMMER ERROR** Argument cacheSize must not be less or equal to zero. - -**PROGRAMMER ERROR** Argument startTime must be less than or equal to endTime. - -**PROGRAMMER ERROR** Cache size must be more than 1 if startTime and endTime differ. - -**PROGRAMMER ERROR** A SpiceRotation cache has already been created. - -**PROGRAMMER ERROR** The SpiceRotation has not yet been fit to a function. - -**PROGRAMMER ERROR** Only cached rotations can be returned as a line cache of quaternions and time. - -**PROGRAMMER ERROR** To create table source of data must be either Memcache or PolyFunction. - -**USER ERROR** Target body orientation information not available. Rerun spiceinit. - -**PROGRAMMER ERROR** Unable to evaluate the derivative of the SPICE rotation fit polynomial for the given coefficient index [-1]. Index is negative or exceeds degree of polynomial [2]. - -**PROGRAMMER ERROR** Unable to evaluate the derivative of the target body rotation fit polynomial for the given coefficient index [100]. Index is negative or exceeds degree of polynomial [2]. - -**PROGRAMMER ERROR** A rotation axis is outside the valid range of 1 to 3. - -**USER ERROR** Time cache not available -- rerun spiceinit. - -**PROGRAMMER ERROR** The SpiceRotation pointing angles must be fit to polynomials in order to compute angular velocity. - -**PROGRAMMER ERROR** SpiceRotation::LoadCache(json) only supports Spice source. diff --git a/isis/src/base/objs/SpiceRotation/SpiceRotation_Darwin_x86_64_MacOSX10_13.truth b/isis/src/base/objs/SpiceRotation/SpiceRotation_Darwin_x86_64_MacOSX10_13.truth deleted file mode 100644 index a8558bd9b8..0000000000 --- a/isis/src/base/objs/SpiceRotation/SpiceRotation_Darwin_x86_64_MacOSX10_13.truth +++ /dev/null @@ -1,714 +0,0 @@ -Unit test for SpiceRotation -Naif code = -94031 -Testing without cache (from SPICE)... -CJ(0) = -0.87506927 0.25477955 -0.41151081 - 0.011442263 0.86088548 0.50867009 - 0.48386242 0.44041295 -0.75624969 -av(0) = -1.3817139e-05 -0.0011493844 -0.00067443921 -CJ(1) = -0.85216522 0.27457809 -0.44544506 - 0.011408438 0.86081401 0.5087918 - 0.52314843 0.42849284 -0.73668827 -av(1) = -1.2759664e-05 -0.0011485667 -0.00067607282 -CJ(2) = -0.82753684 0.29372914 -0.47844118 - 0.011307844 0.86075918 0.50888679 - 0.56129752 0.41571243 -0.71563138 -av(2) = -1.4155561e-05 -0.001147111 -0.00067413283 -CJ(3) = -0.80133591 0.31214822 -0.51031779 - 0.011159773 0.86071999 0.50895635 - 0.59811054 0.40214997 -0.69320934 -av(3) = -1.2104446e-05 -0.0011411423 -0.00066849871 -CJ(4) = -0.77359018 0.32985508 -0.54106734 - 0.010977931 0.86068895 0.50901279 - 0.63359113 0.38782749 -0.66944164 -av(4) = -1.4107831e-05 -0.0011349124 -0.0006662493 -CJ(5) = -0.74451309 0.34675249 -0.57049362 - 0.010796958 0.86067614 0.50903832 - 0.66752055 0.3728261 -0.64452852 -av(5) = -1.1968844e-05 -0.0011267333 -0.00066073722 -CJ(6) = -0.71415 0.36283075 -0.59861809 - 0.010597655 0.86068385 0.50902947 - 0.69991247 0.35717945 -0.61850252 -av(6) = -8.9185184e-06 -0.0011163624 -0.00065670687 -CJ(7) = -0.68276816 0.37813868 -0.625171 - 0.010490873 0.86063983 0.50910611 - 0.73055977 0.34104285 -0.59158448 -av(7) = -1.3255742e-05 -0.0011054424 -0.00064995353 -CJ(8) = -0.6504334 0.39252175 -0.65027923 - 0.010371283 0.86063225 0.50912136 - 0.75949248 0.32440531 -0.56385491 -av(8) = -1.1327819e-05 -0.0010915537 -0.00063894876 -CJ(9) = -0.61729588 0.4060182 -0.67386573 - 0.010223693 0.86060645 0.50916796 - 0.78666465 0.30741789 -0.53539982 -av(9) = -1.2932496e-05 -0.0010747293 -0.00063276804 - -Testing with cache ... -Time = -69382819 -CJ(0) = -0.87506927 0.25477955 -0.41151081 - 0.011442263 0.86088548 0.50867009 - 0.48386242 0.44041295 -0.75624969 -av(0) = -1.3817139e-05 -0.0011493844 -0.00067443921 -Time = -69382785 -CJ(1) = -0.85216522 0.27457809 -0.44544506 - 0.011408438 0.86081401 0.5087918 - 0.52314843 0.42849284 -0.73668827 -av(1) = -1.2759664e-05 -0.0011485667 -0.00067607282 -Time = -69382751 -CJ(2) = -0.82753684 0.29372914 -0.47844118 - 0.011307844 0.86075918 0.50888679 - 0.56129752 0.41571243 -0.71563138 -av(2) = -1.4155561e-05 -0.001147111 -0.00067413283 -Time = -69382717 -CJ(3) = -0.80133591 0.31214822 -0.51031779 - 0.011159773 0.86071999 0.50895635 - 0.59811054 0.40214997 -0.69320934 -av(3) = -1.2104446e-05 -0.0011411423 -0.00066849871 -Time = -69382683 -CJ(4) = -0.77359018 0.32985508 -0.54106734 - 0.010977931 0.86068895 0.50901279 - 0.63359113 0.38782749 -0.66944164 -av(4) = -1.4107831e-05 -0.0011349124 -0.0006662493 -Time = -69382648 -CJ(5) = -0.74451309 0.34675249 -0.57049362 - 0.010796958 0.86067614 0.50903832 - 0.66752055 0.3728261 -0.64452852 -av(5) = -1.1968844e-05 -0.0011267333 -0.00066073722 -Time = -69382614 -CJ(6) = -0.71415 0.36283075 -0.59861809 - 0.010597655 0.86068385 0.50902947 - 0.69991247 0.35717945 -0.61850252 -av(6) = -8.9185184e-06 -0.0011163624 -0.00065670687 -Time = -69382580 -CJ(7) = -0.68276816 0.37813868 -0.625171 - 0.010490873 0.86063983 0.50910611 - 0.73055977 0.34104285 -0.59158448 -av(7) = -1.3255742e-05 -0.0011054424 -0.00064995353 -Time = -69382546 -CJ(8) = -0.6504334 0.39252175 -0.65027923 - 0.010371283 0.86063225 0.50912136 - 0.75949248 0.32440531 -0.56385491 -av(8) = -1.1327819e-05 -0.0010915537 -0.00063894876 -Time = -69382512 -CJ(9) = -0.61729588 0.4060182 -0.67386573 - 0.010223693 0.86060645 0.50916796 - 0.78666465 0.30741789 -0.53539982 -av(9) = -1.2932496e-05 -0.0010747293 -0.00063276804 -Cache Size: 10 - -Testing with functions ... -Source = 3 -Time = -69382819 -CJ(0) = -0.87506744 0.25462094 -0.41161286 - 0.011738947 0.86135321 0.5078709 - 0.48385863 0.43958939 -0.75673113 -av(0) = 3.9588092e-05 -0.0011571406 -0.00066422493 -Time = -69382785 -CJ(1) = -0.85215758 0.27464212 -0.44542021 - 0.011286673 0.86064824 0.50907487 - 0.52316352 0.42878469 -0.73650771 -av(1) = 1.2612887e-05 -0.0011528552 -0.00066929916 -Time = -69382751 -CJ(2) = -0.82753094 0.29389355 -0.47835042 - 0.011001086 0.86036145 0.50956565 - 0.56131231 0.41641897 -0.71520887 -av(2) = -7.8092276e-06 -0.001146583 -0.00067221199 -Time = -69382717 -CJ(3) = -0.80130119 0.31232593 -0.51026357 - 0.010876467 0.86037533 0.5095449 - 0.59816227 0.40274907 -0.69281678 -av(3) = -2.1501533e-05 -0.0011389681 -0.00067272227 -Time = -69382683 -CJ(4) = -0.77358897 0.32991801 -0.54103069 - 0.010878267 0.86056939 0.50921703 - 0.63359432 0.3880392 -0.66931593 -av(4) = -2.8366393e-05 -0.0011306014 -0.00067058131 -Time = -69382648 -CJ(5) = -0.7445192 0.34667611 -0.57053207 - 0.010943787 0.86082321 0.50878643 - 0.66751135 0.37255749 -0.64469335 -av(5) = -2.8375445e-05 -0.0011220116 -0.00066553371 -Time = -69382614 -CJ(6) = -0.71421902 0.36263313 -0.5986555 - 0.010983412 0.86101859 0.50845487 - 0.69983609 0.35657286 -0.6189388 -av(6) = -2.1559923e-05 -0.0011136579 -0.00065731818 -Time = -69382580 -CJ(7) = -0.68281661 0.37784723 -0.62529429 - 0.010882256 0.86104113 0.50841887 - 0.73050876 0.34035224 -0.59204502 -av(7) = -8.001423e-06 -0.0011059244 -0.00064566852 -Time = -69382546 -CJ(8) = -0.65044065 0.39240013 -0.65034537 - 0.010502127 0.86078088 0.50886735 - 0.75948448 0.324158 -0.56400791 -av(8) = 1.2176658e-05 -0.0010991161 -0.00063031469 -Time = -69382512 -CJ(9) = -0.61722064 0.40639527 -0.67370733 - 0.0096837405 0.86013226 0.50997914 - 0.78673052 0.30824564 -0.53482681 -av(9) = 3.8816777e-05 -0.0010934565 -0.00061098396 - -Testing with polynomial functions over Spice ... -Source = 4 -Time = -69382819 -CJ(0) = -0.87809698 0.25267525 -0.40632612 - 0.010857485 0.85950052 0.51101953 - 0.4783595 0.44431303 -0.75746823 -av(0) = 3.6136802e-05 -0.001148937 -0.00071783127 -Time = -69382785 -CJ(1) = -0.85534528 0.27482047 -0.43915619 - 0.01383053 0.85950782 0.51093544 - 0.5178737 0.43095246 -0.73897687 -av(1) = 2.6818529e-05 -0.0011482899 -0.00072824243 -Time = -69382751 -CJ(2) = -0.83089148 0.29534676 -0.47158206 - 0.015622983 0.85955538 0.51080376 - 0.55621513 0.41705497 -0.71881144 -av(2) = 1.5045992e-05 -0.0011468841 -0.00073507982 -Time = -69382717 -CJ(3) = -0.80487479 0.31420086 -0.50344253 - 0.0162853 0.8597142 0.5105157 - 0.59322117 0.40270251 -0.69707915 -av(3) = 6.7201932e-06 -0.00114088 -0.0007382229 -Time = -69382683 -CJ(4) = -0.77730696 0.33143284 -0.53473934 - 0.015873612 0.86003947 0.50998054 - 0.62892123 0.38792318 -0.6737757 -av(4) = -5.6601096e-06 -0.0011345655 -0.00074475059 -Time = -69382648 -CJ(5) = -0.74837985 0.34697393 -0.56527576 - 0.01447613 0.86059696 0.50908086 - 0.66311239 0.37280285 -0.64907626 -av(5) = -1.3898006e-05 -0.001126288 -0.00074801566 -Time = -69382614 -CJ(6) = -0.71811664 0.36084247 -0.59506403 - 0.012135221 0.86143483 0.50772312 - 0.69581695 0.35738319 -0.62298959 -av(6) = -2.1224594e-05 -0.0011158407 -0.00075276262 -Time = -69382580 -CJ(7) = -0.68675883 0.37311393 -0.62381752 - 0.0090314657 0.86251995 0.50594245 - 0.72682924 0.34182646 -0.59571296 -av(7) = -3.5938808e-05 -0.0011049021 -0.00075478687 -Time = -69382546 -CJ(8) = -0.65434784 0.38366056 -0.65163908 - 0.005132805 0.86396924 0.50351842 - 0.75617628 0.32613145 -0.56730566 -av(8) = -4.4387854e-05 -0.0010910882 -0.00075255999 -Time = -69382512 -CJ(9) = -0.62100725 0.39254656 -0.67842257 - 0.00050302319 0.86574982 0.50047677 - 0.78380466 0.31045844 -0.53783438 -av(9) = -5.6369117e-05 -0.0010744677 -0.00075515738 - -Test fitting polynomial function over cache to new cache -Source = 2 -Time = -69382819 -CJ(0) = -0.87809698 0.25267525 -0.40632612 - 0.010857485 0.85950052 0.51101953 - 0.4783595 0.44431303 -0.75746823 -av(0) = 3.6136802e-05 -0.001148937 -0.00071783127 -Time = -69382785 -CJ(1) = -0.85534528 0.27482047 -0.43915619 - 0.01383053 0.85950782 0.51093544 - 0.5178737 0.43095246 -0.73897687 -av(1) = 2.6818529e-05 -0.0011482899 -0.00072824243 -Time = -69382751 -CJ(2) = -0.83089148 0.29534676 -0.47158206 - 0.015622983 0.85955538 0.51080376 - 0.55621513 0.41705497 -0.71881144 -av(2) = 1.5045992e-05 -0.0011468841 -0.00073507982 -Time = -69382717 -CJ(3) = -0.80487479 0.31420086 -0.50344253 - 0.0162853 0.8597142 0.5105157 - 0.59322117 0.40270251 -0.69707915 -av(3) = 6.7201932e-06 -0.00114088 -0.0007382229 -Time = -69382683 -CJ(4) = -0.77730696 0.33143284 -0.53473934 - 0.015873612 0.86003947 0.50998054 - 0.62892123 0.38792318 -0.6737757 -av(4) = -5.6601096e-06 -0.0011345655 -0.00074475059 -Time = -69382648 -CJ(5) = -0.74837985 0.34697393 -0.56527576 - 0.01447613 0.86059696 0.50908086 - 0.66311239 0.37280285 -0.64907626 -av(5) = -1.3898006e-05 -0.001126288 -0.00074801566 -Time = -69382614 -CJ(6) = -0.71811664 0.36084247 -0.59506403 - 0.012135221 0.86143483 0.50772312 - 0.69581695 0.35738319 -0.62298959 -av(6) = -2.1224594e-05 -0.0011158407 -0.00075276262 -Time = -69382580 -CJ(7) = -0.68675883 0.37311393 -0.62381752 - 0.0090314657 0.86251995 0.50594245 - 0.72682924 0.34182646 -0.59571296 -av(7) = -3.5938808e-05 -0.0011049021 -0.00075478687 -Time = -69382546 -CJ(8) = -0.65434784 0.38366056 -0.65163908 - 0.005132805 0.86396924 0.50351842 - 0.75617628 0.32613145 -0.56730566 -av(8) = -4.4387854e-05 -0.0010910882 -0.00075255999 -Time = -69382512 -CJ(9) = -0.62100725 0.39254656 -0.67842257 - 0.00050302319 0.86574982 0.50047677 - 0.78380466 0.31045844 -0.53783438 -av(9) = -5.6369117e-05 -0.0010744677 -0.00075515738 - -Testing ToReferencePartial method -For angles (ra,dec,twist) = 1.9429654 2.1356375 -0.92665897 - For lookJ = 0.78673052 0.30824564 -0.53482681 -Right ascension partial on A applied to lookJ =: -0.50997914 -0.67370733 0 -Right ascension partial on B applied to lookJ =: -0.50997914 -0.67370733 0 -Right ascension partial on C applied to lookJ =: -0.50997914 -0.67370733 0 -Declination partial on A applied to lookJ =: -0.7977269 0.60301797 0 - -Twist partial on A applied to lookJ =: 0.0011693703 -0.00020943951 0 - -Testing with setting functions ... -Source = 3 -Time = -69382819 -CJ(0) = -0.87506744 0.25462094 -0.41161286 - 0.011738947 0.86135321 0.5078709 - 0.48385863 0.43958939 -0.75673113 -av(0) = 3.9588092e-05 -0.0011571406 -0.00066422493 -Time = -69382785 -CJ(1) = -0.85215758 0.27464212 -0.44542021 - 0.011286673 0.86064824 0.50907487 - 0.52316352 0.42878469 -0.73650771 -av(1) = 1.2612887e-05 -0.0011528552 -0.00066929916 -Time = -69382751 -CJ(2) = -0.82753094 0.29389355 -0.47835042 - 0.011001086 0.86036145 0.50956565 - 0.56131231 0.41641897 -0.71520887 -av(2) = -7.8092276e-06 -0.001146583 -0.00067221199 -Time = -69382717 -CJ(3) = -0.80130119 0.31232593 -0.51026357 - 0.010876467 0.86037533 0.5095449 - 0.59816227 0.40274907 -0.69281678 -av(3) = -2.1501533e-05 -0.0011389681 -0.00067272227 -Time = -69382683 -CJ(4) = -0.77358897 0.32991801 -0.54103069 - 0.010878267 0.86056939 0.50921703 - 0.63359432 0.3880392 -0.66931593 -av(4) = -2.8366393e-05 -0.0011306014 -0.00067058131 -Time = -69382648 -CJ(5) = -0.7445192 0.34667611 -0.57053207 - 0.010943787 0.86082321 0.50878643 - 0.66751135 0.37255749 -0.64469335 -av(5) = -2.8375445e-05 -0.0011220116 -0.00066553371 -Time = -69382614 -CJ(6) = -0.71421902 0.36263313 -0.5986555 - 0.010983412 0.86101859 0.50845487 - 0.69983609 0.35657286 -0.6189388 -av(6) = -2.1559923e-05 -0.0011136579 -0.00065731818 -Time = -69382580 -CJ(7) = -0.68281661 0.37784723 -0.62529429 - 0.010882256 0.86104113 0.50841887 - 0.73050876 0.34035224 -0.59204502 -av(7) = -8.001423e-06 -0.0011059244 -0.00064566852 -Time = -69382546 -CJ(8) = -0.65044065 0.39240013 -0.65034537 - 0.010502127 0.86078088 0.50886735 - 0.75948448 0.324158 -0.56400791 -av(8) = 1.2176658e-05 -0.0010991161 -0.00063031469 -Time = -69382512 -CJ(9) = -0.61722064 0.40639527 -0.67370733 - 0.0096837405 0.86013226 0.50997914 - 0.78673052 0.30824564 -0.53482681 -av(9) = 3.8816777e-05 -0.0010934565 -0.00061098396 - -Testing line cache... -Time = -69382819 -CJ(0) = -0.87506744 0.25462094 -0.41161286 - 0.011738947 0.86135321 0.5078709 - 0.48385863 0.43958939 -0.75673113 -av(0) = 3.9588092e-05 -0.0011571406 -0.00066422493 -Time = -69382785 -CJ(1) = -0.85215758 0.27464212 -0.44542021 - 0.011286673 0.86064824 0.50907487 - 0.52316352 0.42878469 -0.73650771 -av(1) = 1.2612887e-05 -0.0011528552 -0.00066929916 -Time = -69382751 -CJ(2) = -0.82753094 0.29389355 -0.47835042 - 0.011001086 0.86036145 0.50956565 - 0.56131231 0.41641897 -0.71520887 -av(2) = -7.8092276e-06 -0.001146583 -0.00067221199 -Time = -69382717 -CJ(3) = -0.80130119 0.31232593 -0.51026357 - 0.010876467 0.86037533 0.5095449 - 0.59816227 0.40274907 -0.69281678 -av(3) = -2.1501533e-05 -0.0011389681 -0.00067272227 -Time = -69382683 -CJ(4) = -0.77358897 0.32991801 -0.54103069 - 0.010878267 0.86056939 0.50921703 - 0.63359432 0.3880392 -0.66931593 -av(4) = -2.8366393e-05 -0.0011306014 -0.00067058131 -Time = -69382648 -CJ(5) = -0.7445192 0.34667611 -0.57053207 - 0.010943787 0.86082321 0.50878643 - 0.66751135 0.37255749 -0.64469335 -av(5) = -2.8375445e-05 -0.0011220116 -0.00066553371 -Time = -69382614 -CJ(6) = -0.71421902 0.36263313 -0.5986555 - 0.010983412 0.86101859 0.50845487 - 0.69983609 0.35657286 -0.6189388 -av(6) = -2.1559923e-05 -0.0011136579 -0.00065731818 -Time = -69382580 -CJ(7) = -0.68281661 0.37784723 -0.62529429 - 0.010882256 0.86104113 0.50841887 - 0.73050876 0.34035224 -0.59204502 -av(7) = -8.001423e-06 -0.0011059244 -0.00064566852 -Time = -69382546 -CJ(8) = -0.65044065 0.39240013 -0.65034537 - 0.010502127 0.86078088 0.50886735 - 0.75948448 0.324158 -0.56400791 -av(8) = 1.2176658e-05 -0.0010991161 -0.00063031469 -Time = -69382512 -CJ(9) = -0.61722064 0.40639527 -0.67370733 - 0.0096837405 0.86013226 0.50997914 - 0.78673052 0.30824564 -0.53482681 -av(9) = 3.8816777e-05 -0.0010934565 -0.00061098396 - -Testing tables ... -Time = -69382819 -CJ(0) = -0.87506744 0.25462094 -0.41161286 - 0.011738947 0.86135321 0.5078709 - 0.48385863 0.43958939 -0.75673113 -av(0) = 3.9588092e-05 -0.0011571406 -0.00066422493 -Time = -69382785 -CJ(1) = -0.85215758 0.27464212 -0.44542021 - 0.011286673 0.86064824 0.50907487 - 0.52316352 0.42878469 -0.73650771 -av(1) = 1.2612887e-05 -0.0011528552 -0.00066929916 -Time = -69382751 -CJ(2) = -0.82753094 0.29389355 -0.47835042 - 0.011001086 0.86036145 0.50956565 - 0.56131231 0.41641897 -0.71520887 -av(2) = -7.8092276e-06 -0.001146583 -0.00067221199 -Time = -69382717 -CJ(3) = -0.80130119 0.31232593 -0.51026357 - 0.010876467 0.86037533 0.5095449 - 0.59816227 0.40274907 -0.69281678 -av(3) = -2.1501533e-05 -0.0011389681 -0.00067272227 -Time = -69382683 -CJ(4) = -0.77358897 0.32991801 -0.54103069 - 0.010878267 0.86056939 0.50921703 - 0.63359432 0.3880392 -0.66931593 -av(4) = -2.8366393e-05 -0.0011306014 -0.00067058131 -Time = -69382648 -CJ(5) = -0.7445192 0.34667611 -0.57053207 - 0.010943787 0.86082321 0.50878643 - 0.66751135 0.37255749 -0.64469335 -av(5) = -2.8375445e-05 -0.0011220116 -0.00066553371 -Time = -69382614 -CJ(6) = -0.71421902 0.36263313 -0.5986555 - 0.010983412 0.86101859 0.50845487 - 0.69983609 0.35657286 -0.6189388 -av(6) = -2.1559923e-05 -0.0011136579 -0.00065731818 -Time = -69382580 -CJ(7) = -0.68281661 0.37784723 -0.62529429 - 0.010882256 0.86104113 0.50841887 - 0.73050876 0.34035224 -0.59204502 -av(7) = -8.001423e-06 -0.0011059244 -0.00064566852 -Time = -69382546 -CJ(8) = -0.65044065 0.39240013 -0.65034537 - 0.010502127 0.86078088 0.50886735 - 0.75948448 0.324158 -0.56400791 -av(8) = 1.2176658e-05 -0.0010991161 -0.00063031469 -Time = -69382512 -CJ(9) = -0.61722064 0.40639527 -0.67370733 - 0.0096837405 0.86013226 0.50997914 - 0.78673052 0.30824564 -0.53482681 -av(9) = 3.8816777e-05 -0.0010934565 -0.00061098396 - -Testing vector methods -v = 0 0 1 -v = 0 1.6653345e-16 1 -Testing with linear function ... -Source = 3 -Time = -69382819 -CJ(0) = -0.87506927 0.25477955 -0.41151081 - 0.011442263 0.86088548 0.50867009 - 0.48386242 0.44041295 -0.75624969 -Time = -69382512 -CJ(1) = -0.61729588 0.4060182 -0.67386573 - 0.010223693 0.86060645 0.50916796 - 0.78666465 0.30741789 -0.53539982 - -Testing Nadir rotation ... -Time = -69382819 -CJ(0) = -0.87397636 0.25584047 -0.41317186 - 0.011529483 0.86087973 0.50867786 - 0.48583166 0.43980876 -0.75533824 -Time = -69382785 -CJ(1) = -0.8510575 0.27545415 -0.44701918 - 0.011395904 0.86083688 0.50875338 - 0.52494883 0.42788419 -0.73576073 -Time = -69382751 -CJ(2) = -0.82643964 0.29447099 -0.47987952 - 0.011259757 0.86079693 0.508824 - 0.56291272 0.415109 -0.71471238 -Time = -69382717 -CJ(3) = -0.80023437 0.31282061 -0.5116329 - 0.011120698 0.86076027 0.50888906 - 0.59958426 0.4015408 -0.69228874 -Time = -69382683 -CJ(4) = -0.77256675 0.3304389 -0.54217225 - 0.010977542 0.86072774 0.5089472 - 0.63483865 0.38724396 -0.66859704 -Time = -69382648 -CJ(5) = -0.74357294 0.34727037 -0.57140403 - 0.01082962 0.86070008 0.50899715 - 0.66856713 0.37228842 -0.64375409 -Time = -69382614 -CJ(6) = -0.71339766 0.36327069 -0.59924801 - 0.010678492 0.86067708 0.50903923 - 0.70067806 0.35674833 -0.6178842 -Time = -69382580 -CJ(7) = -0.6821915 0.37840638 -0.62563837 - 0.010527022 0.86065772 0.50907512 - 0.73109776 0.34070061 -0.59111687 -Time = -69382546 -CJ(8) = -0.65010809 0.39265255 -0.65052551 - 0.010377232 0.86064111 0.50910626 - 0.75977087 0.32422345 -0.5635844 -Time = -69382512 -CJ(9) = -0.61730133 0.40599204 -0.67387649 - 0.010229777 0.86062698 0.50913313 - 0.78666029 0.30739495 -0.53541939 - -Testing angle wrapping... - Using anchor angle of 30, 240 changes to -120 - Using anchor angle of 30, -10 changes to -10 - Using anchor angle of 30, -180 changes to 180 - Using anchor angle of 30, 90 changes to 90 - - -Begin tests for PCK data... - -Test LoadPCFromSpice and all the coefficient accessors... -Test CacheLabel for PCK data... -Test LoadPCFromTable... -Io Pole RA coefficients = 268.05,-0.009,0 -Io Pole DEC coefficients = 64.5,0.003,0 -Io PM coefficients = 200.39,203.48895,0 -Io Pole RA Nutation/Precession coefficients = 0,0,0.094,0.024,0,0,0,0,0,0,0,0,0,0,0, -Io Pole DEC Nutation/Precession coefficients = 0,0,0.04,0.011,0,0,0,0,0,0,0,0,0,0,0, -Io PM Nutation/Precession coefficients = 0,0,-0.085,-0.022,0,0,0,0,0,0,0,0,0,0,0, -Io System Nutation/Precession constants = 73.32,24.62,283.9,355.8,119.9,229.8,352.25,113.35,146.64,49.24,99.360714,175.89537,300.32316,114.0123,49.511251, -Io System Nutation/Precession coefficients = 91472.9,45137.2,4850.7,1191.3,262.1,64.3,2382.6,6070,182945.8,90274.4,4850.4046,1191.9605,262.5475,6070.2476,64.3, - -Testing with PCK polynomial ... -Io Angles = -2.0466383,25.496441,-24.093155 - - - Mars original SPICE values for target body orientation unadjusted - Source = 2 - Time = -69382819 -CJ(0) = 0.65330574 -0.46117449 -0.60042459 - 0.61166293 0.78886884 0.059619006 - 0.44616149 -0.4062069 0.79745588 - Time = -69382785 -CJ(1) = 0.65478275 -0.45926576 -0.60027869 - 0.61008153 0.78998159 0.061070579 - 0.44616149 -0.4062069 0.79745588 - Time = -69382751 -CJ(2) = 0.65625594 -0.45735435 -0.60012927 - 0.60849657 0.79108972 0.062521795 - 0.44616149 -0.4062069 0.79745588 - Time = -69382717 -CJ(3) = 0.65772528 -0.45544026 -0.59997635 - 0.60690805 0.79219323 0.063972645 - 0.44616149 -0.4062069 0.79745588 - Time = -69382683 -CJ(4) = 0.65919078 -0.45352351 -0.59981992 - 0.60531598 0.79329211 0.065423122 - 0.44616149 -0.4062069 0.79745588 - Time = -69382648 -CJ(5) = 0.66065243 -0.45160411 -0.59965998 - 0.60372038 0.79438635 0.066873216 - 0.44616149 -0.4062069 0.79745588 - Time = -69382614 -CJ(6) = 0.66211021 -0.44968207 -0.59949654 - 0.60212124 0.79547595 0.068322919 - 0.44616149 -0.4062069 0.79745588 - Time = -69382580 -CJ(7) = 0.66356413 -0.4477574 -0.59932959 - 0.60051859 0.7965609 0.069772222 - 0.44616149 -0.4062069 0.79745588 - Time = -69382546 -CJ(8) = 0.66501416 -0.44583011 -0.59915914 - 0.59891242 0.79764119 0.071221118 - 0.44616149 -0.4062069 0.79745588 - Time = -69382512 -CJ(9) = 0.66646031 -0.44390022 -0.59898518 - 0.59730276 0.79871681 0.072669597 - 0.44616149 -0.4062069 0.79745588 - - -Now PCK polynomial values for angles unadjusted ... - Io PCK polynomial output - Source = 5 - Angles = -2.0466383,25.496441,-24.093155 - - Mars PCK polynomial output - Source = 5 - Time = -69382819 -CJ(0) = 0.65330574 -0.46117449 -0.60042459 - 0.61166293 0.78886884 0.059619006 - 0.44616149 -0.4062069 0.79745588 - Time = -69382785 -CJ(1) = 0.65478275 -0.45926576 -0.60027869 - 0.61008153 0.78998159 0.061070579 - 0.44616149 -0.4062069 0.79745588 - Time = -69382751 -CJ(2) = 0.65625594 -0.45735435 -0.60012927 - 0.60849657 0.79108972 0.062521795 - 0.44616149 -0.4062069 0.79745588 - Time = -69382717 -CJ(3) = 0.65772528 -0.45544026 -0.59997635 - 0.60690805 0.79219323 0.063972645 - 0.44616149 -0.4062069 0.79745588 - Time = -69382683 -CJ(4) = 0.65919078 -0.45352351 -0.59981992 - 0.60531598 0.79329211 0.065423122 - 0.44616149 -0.4062069 0.79745588 - Time = -69382648 -CJ(5) = 0.66065243 -0.45160411 -0.59965998 - 0.60372038 0.79438635 0.066873216 - 0.44616149 -0.4062069 0.79745588 - Time = -69382614 -CJ(6) = 0.66211021 -0.44968207 -0.59949654 - 0.60212124 0.79547595 0.068322919 - 0.44616149 -0.4062069 0.79745588 - Time = -69382580 -CJ(7) = 0.66356413 -0.4477574 -0.59932959 - 0.60051859 0.7965609 0.069772222 - 0.44616149 -0.4062069 0.79745588 - Time = -69382546 -CJ(8) = 0.66501416 -0.44583011 -0.59915914 - 0.59891242 0.79764119 0.071221118 - 0.44616149 -0.4062069 0.79745588 - Time = -69382512 -CJ(9) = 0.66646031 -0.44390022 -0.59898518 - 0.59730276 0.79871681 0.072669597 - 0.44616149 -0.4062069 0.79745588 - - -Testing angular velocity with Io data ... -SpiceRotation av = -6.3193326e-07 -1.7682968e-05 3.7102704e-05 -J2000 to body-fixed Naif av = -6.3193326e-07 -1.7682968e-05 3.7102704e-05 - - - -Testing partials for target body parameters... -For angles (ra,dec,rotation) = 1.9429654 2.1356375 -0.92665897 -Beginning with J2000 vector 0.78673052 0.30824564 -0.53482681 -lookB = 0.69294371 0.69249343 -0.20070344 - - dLookB with respect to ra = 0.56419869 -0.43208476 0.4571027 - Right ascension partial on A applied to dlookB =: 0.78673052 0.30824564 0 - - dLookB with respect to dec = -0.19972128 0.019831273 -0.62112827 - Declination partial on A applied to dlookB =: 0.27671521 -0.25193486 -0.53482681 - - dLookB with respect to rotation rate = -556.10123 556.46282 0 - Rotation rate partial on A applied to dlookB =: 565090.03 146205.39 -241683.3 - - dLookB with respect to rotation = 0.69249343 -0.69294371 0 - Rotation partial on A applied to dlookB =: 0.87627666 0.22671852 -0.37477468 - - -... Testing failure of body rotation with binary PCK - Source = 0 -Frame type is binary PCK and cannot be updated -End of PCK testing - - -Testing CK based body rotation with 67P/Churyumov–Gerasimenko data ... -Time = 4.6285471e+08 -CJ = 0.93816333 -0.34618155 -0.002810256 - 0.30996014 0.84356223 -0.43855157 - 0.15418909 0.41056193 0.89870163 - - -Testing loading cache from ALE ISD with only time dependent quaternions ... -Frame type = 3 -Is cached? Yes -Has AV? No -Time dependent frame chain = { -94031, 10014, 1 } -Time dependent frame chain = { -94031 } -Time = 0 -CJ(0) = -1 0 0 - 0 -1 0 - 0 0 1 -Time = 1 -CJ(1) = 0 1 0 - -1 0 0 - 0 0 1 -Time = 2 -CJ(2) = 0 1 0 - 1 0 0 - 0 0 -1 -Time = 3 -CJ(3) = -8.6595606e-17 2.220446e-16 -1 - -1 8.6595606e-17 8.6595606e-17 - 8.6595606e-17 1 5.5511151e-17 - - -Testing loading cache from ALE ISD with time dependent quaternions and AV ... -Has AV? Yes - - -Testing loading cache from ALE ISD with time dependent quaternions and constant rotation ... -Time dependent frame chain = { -94030, 10014, 1 } -Time dependent frame chain = { -94031, -94030 } -Time = 0 -CJ(0) = -1 0 0 - 0 0 1 - 0 -1 0 -Time = 1 -CJ(1) = 0 1 0 - 0 0 1 - -1 0 0 -Time = 2 -CJ(2) = 0 1 0 - 0 0 -1 - 1 0 0 -Time = 3 -CJ(3) = -8.6595606e-17 2.220446e-16 -1 - 8.6595606e-17 1 5.5511151e-17 - -1 8.6595606e-17 8.6595606e-17 - - -Testing exceptions... - -**I/O ERROR** Cannot find [INS-99999_TRANSX] in text kernels. - -**PROGRAMMER ERROR** Argument cacheSize must not be less or equal to zero. - -**PROGRAMMER ERROR** Argument startTime must be less than or equal to endTime. - -**PROGRAMMER ERROR** Cache size must be more than 1 if startTime and endTime differ. - -**PROGRAMMER ERROR** A SpiceRotation cache has already been created. - -**PROGRAMMER ERROR** The SpiceRotation has not yet been fit to a function. - -**PROGRAMMER ERROR** Only cached rotations can be returned as a line cache of quaternions and time. - -**PROGRAMMER ERROR** To create table source of data must be either Memcache or PolyFunction. - -**USER ERROR** Target body orientation information not available. Rerun spiceinit. - -**PROGRAMMER ERROR** Unable to evaluate the derivative of the SPICE rotation fit polynomial for the given coefficient index [-1]. Index is negative or exceeds degree of polynomial [2]. - -**PROGRAMMER ERROR** Unable to evaluate the derivative of the target body rotation fit polynomial for the given coefficient index [100]. Index is negative or exceeds degree of polynomial [2]. - -**PROGRAMMER ERROR** A rotation axis is outside the valid range of 1 to 3. - -**USER ERROR** Time cache not available -- rerun spiceinit. - -**PROGRAMMER ERROR** The SpiceRotation pointing angles must be fit to polynomials in order to compute angular velocity. - -**PROGRAMMER ERROR** SpiceRotation::LoadCache(json) only supports Spice source. diff --git a/isis/src/base/objs/SpiceRotation/SpiceRotation_Darwin_x86_64_MacOSX10_15.truth b/isis/src/base/objs/SpiceRotation/SpiceRotation_Darwin_x86_64_MacOSX10_15.truth deleted file mode 100644 index a8558bd9b8..0000000000 --- a/isis/src/base/objs/SpiceRotation/SpiceRotation_Darwin_x86_64_MacOSX10_15.truth +++ /dev/null @@ -1,714 +0,0 @@ -Unit test for SpiceRotation -Naif code = -94031 -Testing without cache (from SPICE)... -CJ(0) = -0.87506927 0.25477955 -0.41151081 - 0.011442263 0.86088548 0.50867009 - 0.48386242 0.44041295 -0.75624969 -av(0) = -1.3817139e-05 -0.0011493844 -0.00067443921 -CJ(1) = -0.85216522 0.27457809 -0.44544506 - 0.011408438 0.86081401 0.5087918 - 0.52314843 0.42849284 -0.73668827 -av(1) = -1.2759664e-05 -0.0011485667 -0.00067607282 -CJ(2) = -0.82753684 0.29372914 -0.47844118 - 0.011307844 0.86075918 0.50888679 - 0.56129752 0.41571243 -0.71563138 -av(2) = -1.4155561e-05 -0.001147111 -0.00067413283 -CJ(3) = -0.80133591 0.31214822 -0.51031779 - 0.011159773 0.86071999 0.50895635 - 0.59811054 0.40214997 -0.69320934 -av(3) = -1.2104446e-05 -0.0011411423 -0.00066849871 -CJ(4) = -0.77359018 0.32985508 -0.54106734 - 0.010977931 0.86068895 0.50901279 - 0.63359113 0.38782749 -0.66944164 -av(4) = -1.4107831e-05 -0.0011349124 -0.0006662493 -CJ(5) = -0.74451309 0.34675249 -0.57049362 - 0.010796958 0.86067614 0.50903832 - 0.66752055 0.3728261 -0.64452852 -av(5) = -1.1968844e-05 -0.0011267333 -0.00066073722 -CJ(6) = -0.71415 0.36283075 -0.59861809 - 0.010597655 0.86068385 0.50902947 - 0.69991247 0.35717945 -0.61850252 -av(6) = -8.9185184e-06 -0.0011163624 -0.00065670687 -CJ(7) = -0.68276816 0.37813868 -0.625171 - 0.010490873 0.86063983 0.50910611 - 0.73055977 0.34104285 -0.59158448 -av(7) = -1.3255742e-05 -0.0011054424 -0.00064995353 -CJ(8) = -0.6504334 0.39252175 -0.65027923 - 0.010371283 0.86063225 0.50912136 - 0.75949248 0.32440531 -0.56385491 -av(8) = -1.1327819e-05 -0.0010915537 -0.00063894876 -CJ(9) = -0.61729588 0.4060182 -0.67386573 - 0.010223693 0.86060645 0.50916796 - 0.78666465 0.30741789 -0.53539982 -av(9) = -1.2932496e-05 -0.0010747293 -0.00063276804 - -Testing with cache ... -Time = -69382819 -CJ(0) = -0.87506927 0.25477955 -0.41151081 - 0.011442263 0.86088548 0.50867009 - 0.48386242 0.44041295 -0.75624969 -av(0) = -1.3817139e-05 -0.0011493844 -0.00067443921 -Time = -69382785 -CJ(1) = -0.85216522 0.27457809 -0.44544506 - 0.011408438 0.86081401 0.5087918 - 0.52314843 0.42849284 -0.73668827 -av(1) = -1.2759664e-05 -0.0011485667 -0.00067607282 -Time = -69382751 -CJ(2) = -0.82753684 0.29372914 -0.47844118 - 0.011307844 0.86075918 0.50888679 - 0.56129752 0.41571243 -0.71563138 -av(2) = -1.4155561e-05 -0.001147111 -0.00067413283 -Time = -69382717 -CJ(3) = -0.80133591 0.31214822 -0.51031779 - 0.011159773 0.86071999 0.50895635 - 0.59811054 0.40214997 -0.69320934 -av(3) = -1.2104446e-05 -0.0011411423 -0.00066849871 -Time = -69382683 -CJ(4) = -0.77359018 0.32985508 -0.54106734 - 0.010977931 0.86068895 0.50901279 - 0.63359113 0.38782749 -0.66944164 -av(4) = -1.4107831e-05 -0.0011349124 -0.0006662493 -Time = -69382648 -CJ(5) = -0.74451309 0.34675249 -0.57049362 - 0.010796958 0.86067614 0.50903832 - 0.66752055 0.3728261 -0.64452852 -av(5) = -1.1968844e-05 -0.0011267333 -0.00066073722 -Time = -69382614 -CJ(6) = -0.71415 0.36283075 -0.59861809 - 0.010597655 0.86068385 0.50902947 - 0.69991247 0.35717945 -0.61850252 -av(6) = -8.9185184e-06 -0.0011163624 -0.00065670687 -Time = -69382580 -CJ(7) = -0.68276816 0.37813868 -0.625171 - 0.010490873 0.86063983 0.50910611 - 0.73055977 0.34104285 -0.59158448 -av(7) = -1.3255742e-05 -0.0011054424 -0.00064995353 -Time = -69382546 -CJ(8) = -0.6504334 0.39252175 -0.65027923 - 0.010371283 0.86063225 0.50912136 - 0.75949248 0.32440531 -0.56385491 -av(8) = -1.1327819e-05 -0.0010915537 -0.00063894876 -Time = -69382512 -CJ(9) = -0.61729588 0.4060182 -0.67386573 - 0.010223693 0.86060645 0.50916796 - 0.78666465 0.30741789 -0.53539982 -av(9) = -1.2932496e-05 -0.0010747293 -0.00063276804 -Cache Size: 10 - -Testing with functions ... -Source = 3 -Time = -69382819 -CJ(0) = -0.87506744 0.25462094 -0.41161286 - 0.011738947 0.86135321 0.5078709 - 0.48385863 0.43958939 -0.75673113 -av(0) = 3.9588092e-05 -0.0011571406 -0.00066422493 -Time = -69382785 -CJ(1) = -0.85215758 0.27464212 -0.44542021 - 0.011286673 0.86064824 0.50907487 - 0.52316352 0.42878469 -0.73650771 -av(1) = 1.2612887e-05 -0.0011528552 -0.00066929916 -Time = -69382751 -CJ(2) = -0.82753094 0.29389355 -0.47835042 - 0.011001086 0.86036145 0.50956565 - 0.56131231 0.41641897 -0.71520887 -av(2) = -7.8092276e-06 -0.001146583 -0.00067221199 -Time = -69382717 -CJ(3) = -0.80130119 0.31232593 -0.51026357 - 0.010876467 0.86037533 0.5095449 - 0.59816227 0.40274907 -0.69281678 -av(3) = -2.1501533e-05 -0.0011389681 -0.00067272227 -Time = -69382683 -CJ(4) = -0.77358897 0.32991801 -0.54103069 - 0.010878267 0.86056939 0.50921703 - 0.63359432 0.3880392 -0.66931593 -av(4) = -2.8366393e-05 -0.0011306014 -0.00067058131 -Time = -69382648 -CJ(5) = -0.7445192 0.34667611 -0.57053207 - 0.010943787 0.86082321 0.50878643 - 0.66751135 0.37255749 -0.64469335 -av(5) = -2.8375445e-05 -0.0011220116 -0.00066553371 -Time = -69382614 -CJ(6) = -0.71421902 0.36263313 -0.5986555 - 0.010983412 0.86101859 0.50845487 - 0.69983609 0.35657286 -0.6189388 -av(6) = -2.1559923e-05 -0.0011136579 -0.00065731818 -Time = -69382580 -CJ(7) = -0.68281661 0.37784723 -0.62529429 - 0.010882256 0.86104113 0.50841887 - 0.73050876 0.34035224 -0.59204502 -av(7) = -8.001423e-06 -0.0011059244 -0.00064566852 -Time = -69382546 -CJ(8) = -0.65044065 0.39240013 -0.65034537 - 0.010502127 0.86078088 0.50886735 - 0.75948448 0.324158 -0.56400791 -av(8) = 1.2176658e-05 -0.0010991161 -0.00063031469 -Time = -69382512 -CJ(9) = -0.61722064 0.40639527 -0.67370733 - 0.0096837405 0.86013226 0.50997914 - 0.78673052 0.30824564 -0.53482681 -av(9) = 3.8816777e-05 -0.0010934565 -0.00061098396 - -Testing with polynomial functions over Spice ... -Source = 4 -Time = -69382819 -CJ(0) = -0.87809698 0.25267525 -0.40632612 - 0.010857485 0.85950052 0.51101953 - 0.4783595 0.44431303 -0.75746823 -av(0) = 3.6136802e-05 -0.001148937 -0.00071783127 -Time = -69382785 -CJ(1) = -0.85534528 0.27482047 -0.43915619 - 0.01383053 0.85950782 0.51093544 - 0.5178737 0.43095246 -0.73897687 -av(1) = 2.6818529e-05 -0.0011482899 -0.00072824243 -Time = -69382751 -CJ(2) = -0.83089148 0.29534676 -0.47158206 - 0.015622983 0.85955538 0.51080376 - 0.55621513 0.41705497 -0.71881144 -av(2) = 1.5045992e-05 -0.0011468841 -0.00073507982 -Time = -69382717 -CJ(3) = -0.80487479 0.31420086 -0.50344253 - 0.0162853 0.8597142 0.5105157 - 0.59322117 0.40270251 -0.69707915 -av(3) = 6.7201932e-06 -0.00114088 -0.0007382229 -Time = -69382683 -CJ(4) = -0.77730696 0.33143284 -0.53473934 - 0.015873612 0.86003947 0.50998054 - 0.62892123 0.38792318 -0.6737757 -av(4) = -5.6601096e-06 -0.0011345655 -0.00074475059 -Time = -69382648 -CJ(5) = -0.74837985 0.34697393 -0.56527576 - 0.01447613 0.86059696 0.50908086 - 0.66311239 0.37280285 -0.64907626 -av(5) = -1.3898006e-05 -0.001126288 -0.00074801566 -Time = -69382614 -CJ(6) = -0.71811664 0.36084247 -0.59506403 - 0.012135221 0.86143483 0.50772312 - 0.69581695 0.35738319 -0.62298959 -av(6) = -2.1224594e-05 -0.0011158407 -0.00075276262 -Time = -69382580 -CJ(7) = -0.68675883 0.37311393 -0.62381752 - 0.0090314657 0.86251995 0.50594245 - 0.72682924 0.34182646 -0.59571296 -av(7) = -3.5938808e-05 -0.0011049021 -0.00075478687 -Time = -69382546 -CJ(8) = -0.65434784 0.38366056 -0.65163908 - 0.005132805 0.86396924 0.50351842 - 0.75617628 0.32613145 -0.56730566 -av(8) = -4.4387854e-05 -0.0010910882 -0.00075255999 -Time = -69382512 -CJ(9) = -0.62100725 0.39254656 -0.67842257 - 0.00050302319 0.86574982 0.50047677 - 0.78380466 0.31045844 -0.53783438 -av(9) = -5.6369117e-05 -0.0010744677 -0.00075515738 - -Test fitting polynomial function over cache to new cache -Source = 2 -Time = -69382819 -CJ(0) = -0.87809698 0.25267525 -0.40632612 - 0.010857485 0.85950052 0.51101953 - 0.4783595 0.44431303 -0.75746823 -av(0) = 3.6136802e-05 -0.001148937 -0.00071783127 -Time = -69382785 -CJ(1) = -0.85534528 0.27482047 -0.43915619 - 0.01383053 0.85950782 0.51093544 - 0.5178737 0.43095246 -0.73897687 -av(1) = 2.6818529e-05 -0.0011482899 -0.00072824243 -Time = -69382751 -CJ(2) = -0.83089148 0.29534676 -0.47158206 - 0.015622983 0.85955538 0.51080376 - 0.55621513 0.41705497 -0.71881144 -av(2) = 1.5045992e-05 -0.0011468841 -0.00073507982 -Time = -69382717 -CJ(3) = -0.80487479 0.31420086 -0.50344253 - 0.0162853 0.8597142 0.5105157 - 0.59322117 0.40270251 -0.69707915 -av(3) = 6.7201932e-06 -0.00114088 -0.0007382229 -Time = -69382683 -CJ(4) = -0.77730696 0.33143284 -0.53473934 - 0.015873612 0.86003947 0.50998054 - 0.62892123 0.38792318 -0.6737757 -av(4) = -5.6601096e-06 -0.0011345655 -0.00074475059 -Time = -69382648 -CJ(5) = -0.74837985 0.34697393 -0.56527576 - 0.01447613 0.86059696 0.50908086 - 0.66311239 0.37280285 -0.64907626 -av(5) = -1.3898006e-05 -0.001126288 -0.00074801566 -Time = -69382614 -CJ(6) = -0.71811664 0.36084247 -0.59506403 - 0.012135221 0.86143483 0.50772312 - 0.69581695 0.35738319 -0.62298959 -av(6) = -2.1224594e-05 -0.0011158407 -0.00075276262 -Time = -69382580 -CJ(7) = -0.68675883 0.37311393 -0.62381752 - 0.0090314657 0.86251995 0.50594245 - 0.72682924 0.34182646 -0.59571296 -av(7) = -3.5938808e-05 -0.0011049021 -0.00075478687 -Time = -69382546 -CJ(8) = -0.65434784 0.38366056 -0.65163908 - 0.005132805 0.86396924 0.50351842 - 0.75617628 0.32613145 -0.56730566 -av(8) = -4.4387854e-05 -0.0010910882 -0.00075255999 -Time = -69382512 -CJ(9) = -0.62100725 0.39254656 -0.67842257 - 0.00050302319 0.86574982 0.50047677 - 0.78380466 0.31045844 -0.53783438 -av(9) = -5.6369117e-05 -0.0010744677 -0.00075515738 - -Testing ToReferencePartial method -For angles (ra,dec,twist) = 1.9429654 2.1356375 -0.92665897 - For lookJ = 0.78673052 0.30824564 -0.53482681 -Right ascension partial on A applied to lookJ =: -0.50997914 -0.67370733 0 -Right ascension partial on B applied to lookJ =: -0.50997914 -0.67370733 0 -Right ascension partial on C applied to lookJ =: -0.50997914 -0.67370733 0 -Declination partial on A applied to lookJ =: -0.7977269 0.60301797 0 - -Twist partial on A applied to lookJ =: 0.0011693703 -0.00020943951 0 - -Testing with setting functions ... -Source = 3 -Time = -69382819 -CJ(0) = -0.87506744 0.25462094 -0.41161286 - 0.011738947 0.86135321 0.5078709 - 0.48385863 0.43958939 -0.75673113 -av(0) = 3.9588092e-05 -0.0011571406 -0.00066422493 -Time = -69382785 -CJ(1) = -0.85215758 0.27464212 -0.44542021 - 0.011286673 0.86064824 0.50907487 - 0.52316352 0.42878469 -0.73650771 -av(1) = 1.2612887e-05 -0.0011528552 -0.00066929916 -Time = -69382751 -CJ(2) = -0.82753094 0.29389355 -0.47835042 - 0.011001086 0.86036145 0.50956565 - 0.56131231 0.41641897 -0.71520887 -av(2) = -7.8092276e-06 -0.001146583 -0.00067221199 -Time = -69382717 -CJ(3) = -0.80130119 0.31232593 -0.51026357 - 0.010876467 0.86037533 0.5095449 - 0.59816227 0.40274907 -0.69281678 -av(3) = -2.1501533e-05 -0.0011389681 -0.00067272227 -Time = -69382683 -CJ(4) = -0.77358897 0.32991801 -0.54103069 - 0.010878267 0.86056939 0.50921703 - 0.63359432 0.3880392 -0.66931593 -av(4) = -2.8366393e-05 -0.0011306014 -0.00067058131 -Time = -69382648 -CJ(5) = -0.7445192 0.34667611 -0.57053207 - 0.010943787 0.86082321 0.50878643 - 0.66751135 0.37255749 -0.64469335 -av(5) = -2.8375445e-05 -0.0011220116 -0.00066553371 -Time = -69382614 -CJ(6) = -0.71421902 0.36263313 -0.5986555 - 0.010983412 0.86101859 0.50845487 - 0.69983609 0.35657286 -0.6189388 -av(6) = -2.1559923e-05 -0.0011136579 -0.00065731818 -Time = -69382580 -CJ(7) = -0.68281661 0.37784723 -0.62529429 - 0.010882256 0.86104113 0.50841887 - 0.73050876 0.34035224 -0.59204502 -av(7) = -8.001423e-06 -0.0011059244 -0.00064566852 -Time = -69382546 -CJ(8) = -0.65044065 0.39240013 -0.65034537 - 0.010502127 0.86078088 0.50886735 - 0.75948448 0.324158 -0.56400791 -av(8) = 1.2176658e-05 -0.0010991161 -0.00063031469 -Time = -69382512 -CJ(9) = -0.61722064 0.40639527 -0.67370733 - 0.0096837405 0.86013226 0.50997914 - 0.78673052 0.30824564 -0.53482681 -av(9) = 3.8816777e-05 -0.0010934565 -0.00061098396 - -Testing line cache... -Time = -69382819 -CJ(0) = -0.87506744 0.25462094 -0.41161286 - 0.011738947 0.86135321 0.5078709 - 0.48385863 0.43958939 -0.75673113 -av(0) = 3.9588092e-05 -0.0011571406 -0.00066422493 -Time = -69382785 -CJ(1) = -0.85215758 0.27464212 -0.44542021 - 0.011286673 0.86064824 0.50907487 - 0.52316352 0.42878469 -0.73650771 -av(1) = 1.2612887e-05 -0.0011528552 -0.00066929916 -Time = -69382751 -CJ(2) = -0.82753094 0.29389355 -0.47835042 - 0.011001086 0.86036145 0.50956565 - 0.56131231 0.41641897 -0.71520887 -av(2) = -7.8092276e-06 -0.001146583 -0.00067221199 -Time = -69382717 -CJ(3) = -0.80130119 0.31232593 -0.51026357 - 0.010876467 0.86037533 0.5095449 - 0.59816227 0.40274907 -0.69281678 -av(3) = -2.1501533e-05 -0.0011389681 -0.00067272227 -Time = -69382683 -CJ(4) = -0.77358897 0.32991801 -0.54103069 - 0.010878267 0.86056939 0.50921703 - 0.63359432 0.3880392 -0.66931593 -av(4) = -2.8366393e-05 -0.0011306014 -0.00067058131 -Time = -69382648 -CJ(5) = -0.7445192 0.34667611 -0.57053207 - 0.010943787 0.86082321 0.50878643 - 0.66751135 0.37255749 -0.64469335 -av(5) = -2.8375445e-05 -0.0011220116 -0.00066553371 -Time = -69382614 -CJ(6) = -0.71421902 0.36263313 -0.5986555 - 0.010983412 0.86101859 0.50845487 - 0.69983609 0.35657286 -0.6189388 -av(6) = -2.1559923e-05 -0.0011136579 -0.00065731818 -Time = -69382580 -CJ(7) = -0.68281661 0.37784723 -0.62529429 - 0.010882256 0.86104113 0.50841887 - 0.73050876 0.34035224 -0.59204502 -av(7) = -8.001423e-06 -0.0011059244 -0.00064566852 -Time = -69382546 -CJ(8) = -0.65044065 0.39240013 -0.65034537 - 0.010502127 0.86078088 0.50886735 - 0.75948448 0.324158 -0.56400791 -av(8) = 1.2176658e-05 -0.0010991161 -0.00063031469 -Time = -69382512 -CJ(9) = -0.61722064 0.40639527 -0.67370733 - 0.0096837405 0.86013226 0.50997914 - 0.78673052 0.30824564 -0.53482681 -av(9) = 3.8816777e-05 -0.0010934565 -0.00061098396 - -Testing tables ... -Time = -69382819 -CJ(0) = -0.87506744 0.25462094 -0.41161286 - 0.011738947 0.86135321 0.5078709 - 0.48385863 0.43958939 -0.75673113 -av(0) = 3.9588092e-05 -0.0011571406 -0.00066422493 -Time = -69382785 -CJ(1) = -0.85215758 0.27464212 -0.44542021 - 0.011286673 0.86064824 0.50907487 - 0.52316352 0.42878469 -0.73650771 -av(1) = 1.2612887e-05 -0.0011528552 -0.00066929916 -Time = -69382751 -CJ(2) = -0.82753094 0.29389355 -0.47835042 - 0.011001086 0.86036145 0.50956565 - 0.56131231 0.41641897 -0.71520887 -av(2) = -7.8092276e-06 -0.001146583 -0.00067221199 -Time = -69382717 -CJ(3) = -0.80130119 0.31232593 -0.51026357 - 0.010876467 0.86037533 0.5095449 - 0.59816227 0.40274907 -0.69281678 -av(3) = -2.1501533e-05 -0.0011389681 -0.00067272227 -Time = -69382683 -CJ(4) = -0.77358897 0.32991801 -0.54103069 - 0.010878267 0.86056939 0.50921703 - 0.63359432 0.3880392 -0.66931593 -av(4) = -2.8366393e-05 -0.0011306014 -0.00067058131 -Time = -69382648 -CJ(5) = -0.7445192 0.34667611 -0.57053207 - 0.010943787 0.86082321 0.50878643 - 0.66751135 0.37255749 -0.64469335 -av(5) = -2.8375445e-05 -0.0011220116 -0.00066553371 -Time = -69382614 -CJ(6) = -0.71421902 0.36263313 -0.5986555 - 0.010983412 0.86101859 0.50845487 - 0.69983609 0.35657286 -0.6189388 -av(6) = -2.1559923e-05 -0.0011136579 -0.00065731818 -Time = -69382580 -CJ(7) = -0.68281661 0.37784723 -0.62529429 - 0.010882256 0.86104113 0.50841887 - 0.73050876 0.34035224 -0.59204502 -av(7) = -8.001423e-06 -0.0011059244 -0.00064566852 -Time = -69382546 -CJ(8) = -0.65044065 0.39240013 -0.65034537 - 0.010502127 0.86078088 0.50886735 - 0.75948448 0.324158 -0.56400791 -av(8) = 1.2176658e-05 -0.0010991161 -0.00063031469 -Time = -69382512 -CJ(9) = -0.61722064 0.40639527 -0.67370733 - 0.0096837405 0.86013226 0.50997914 - 0.78673052 0.30824564 -0.53482681 -av(9) = 3.8816777e-05 -0.0010934565 -0.00061098396 - -Testing vector methods -v = 0 0 1 -v = 0 1.6653345e-16 1 -Testing with linear function ... -Source = 3 -Time = -69382819 -CJ(0) = -0.87506927 0.25477955 -0.41151081 - 0.011442263 0.86088548 0.50867009 - 0.48386242 0.44041295 -0.75624969 -Time = -69382512 -CJ(1) = -0.61729588 0.4060182 -0.67386573 - 0.010223693 0.86060645 0.50916796 - 0.78666465 0.30741789 -0.53539982 - -Testing Nadir rotation ... -Time = -69382819 -CJ(0) = -0.87397636 0.25584047 -0.41317186 - 0.011529483 0.86087973 0.50867786 - 0.48583166 0.43980876 -0.75533824 -Time = -69382785 -CJ(1) = -0.8510575 0.27545415 -0.44701918 - 0.011395904 0.86083688 0.50875338 - 0.52494883 0.42788419 -0.73576073 -Time = -69382751 -CJ(2) = -0.82643964 0.29447099 -0.47987952 - 0.011259757 0.86079693 0.508824 - 0.56291272 0.415109 -0.71471238 -Time = -69382717 -CJ(3) = -0.80023437 0.31282061 -0.5116329 - 0.011120698 0.86076027 0.50888906 - 0.59958426 0.4015408 -0.69228874 -Time = -69382683 -CJ(4) = -0.77256675 0.3304389 -0.54217225 - 0.010977542 0.86072774 0.5089472 - 0.63483865 0.38724396 -0.66859704 -Time = -69382648 -CJ(5) = -0.74357294 0.34727037 -0.57140403 - 0.01082962 0.86070008 0.50899715 - 0.66856713 0.37228842 -0.64375409 -Time = -69382614 -CJ(6) = -0.71339766 0.36327069 -0.59924801 - 0.010678492 0.86067708 0.50903923 - 0.70067806 0.35674833 -0.6178842 -Time = -69382580 -CJ(7) = -0.6821915 0.37840638 -0.62563837 - 0.010527022 0.86065772 0.50907512 - 0.73109776 0.34070061 -0.59111687 -Time = -69382546 -CJ(8) = -0.65010809 0.39265255 -0.65052551 - 0.010377232 0.86064111 0.50910626 - 0.75977087 0.32422345 -0.5635844 -Time = -69382512 -CJ(9) = -0.61730133 0.40599204 -0.67387649 - 0.010229777 0.86062698 0.50913313 - 0.78666029 0.30739495 -0.53541939 - -Testing angle wrapping... - Using anchor angle of 30, 240 changes to -120 - Using anchor angle of 30, -10 changes to -10 - Using anchor angle of 30, -180 changes to 180 - Using anchor angle of 30, 90 changes to 90 - - -Begin tests for PCK data... - -Test LoadPCFromSpice and all the coefficient accessors... -Test CacheLabel for PCK data... -Test LoadPCFromTable... -Io Pole RA coefficients = 268.05,-0.009,0 -Io Pole DEC coefficients = 64.5,0.003,0 -Io PM coefficients = 200.39,203.48895,0 -Io Pole RA Nutation/Precession coefficients = 0,0,0.094,0.024,0,0,0,0,0,0,0,0,0,0,0, -Io Pole DEC Nutation/Precession coefficients = 0,0,0.04,0.011,0,0,0,0,0,0,0,0,0,0,0, -Io PM Nutation/Precession coefficients = 0,0,-0.085,-0.022,0,0,0,0,0,0,0,0,0,0,0, -Io System Nutation/Precession constants = 73.32,24.62,283.9,355.8,119.9,229.8,352.25,113.35,146.64,49.24,99.360714,175.89537,300.32316,114.0123,49.511251, -Io System Nutation/Precession coefficients = 91472.9,45137.2,4850.7,1191.3,262.1,64.3,2382.6,6070,182945.8,90274.4,4850.4046,1191.9605,262.5475,6070.2476,64.3, - -Testing with PCK polynomial ... -Io Angles = -2.0466383,25.496441,-24.093155 - - - Mars original SPICE values for target body orientation unadjusted - Source = 2 - Time = -69382819 -CJ(0) = 0.65330574 -0.46117449 -0.60042459 - 0.61166293 0.78886884 0.059619006 - 0.44616149 -0.4062069 0.79745588 - Time = -69382785 -CJ(1) = 0.65478275 -0.45926576 -0.60027869 - 0.61008153 0.78998159 0.061070579 - 0.44616149 -0.4062069 0.79745588 - Time = -69382751 -CJ(2) = 0.65625594 -0.45735435 -0.60012927 - 0.60849657 0.79108972 0.062521795 - 0.44616149 -0.4062069 0.79745588 - Time = -69382717 -CJ(3) = 0.65772528 -0.45544026 -0.59997635 - 0.60690805 0.79219323 0.063972645 - 0.44616149 -0.4062069 0.79745588 - Time = -69382683 -CJ(4) = 0.65919078 -0.45352351 -0.59981992 - 0.60531598 0.79329211 0.065423122 - 0.44616149 -0.4062069 0.79745588 - Time = -69382648 -CJ(5) = 0.66065243 -0.45160411 -0.59965998 - 0.60372038 0.79438635 0.066873216 - 0.44616149 -0.4062069 0.79745588 - Time = -69382614 -CJ(6) = 0.66211021 -0.44968207 -0.59949654 - 0.60212124 0.79547595 0.068322919 - 0.44616149 -0.4062069 0.79745588 - Time = -69382580 -CJ(7) = 0.66356413 -0.4477574 -0.59932959 - 0.60051859 0.7965609 0.069772222 - 0.44616149 -0.4062069 0.79745588 - Time = -69382546 -CJ(8) = 0.66501416 -0.44583011 -0.59915914 - 0.59891242 0.79764119 0.071221118 - 0.44616149 -0.4062069 0.79745588 - Time = -69382512 -CJ(9) = 0.66646031 -0.44390022 -0.59898518 - 0.59730276 0.79871681 0.072669597 - 0.44616149 -0.4062069 0.79745588 - - -Now PCK polynomial values for angles unadjusted ... - Io PCK polynomial output - Source = 5 - Angles = -2.0466383,25.496441,-24.093155 - - Mars PCK polynomial output - Source = 5 - Time = -69382819 -CJ(0) = 0.65330574 -0.46117449 -0.60042459 - 0.61166293 0.78886884 0.059619006 - 0.44616149 -0.4062069 0.79745588 - Time = -69382785 -CJ(1) = 0.65478275 -0.45926576 -0.60027869 - 0.61008153 0.78998159 0.061070579 - 0.44616149 -0.4062069 0.79745588 - Time = -69382751 -CJ(2) = 0.65625594 -0.45735435 -0.60012927 - 0.60849657 0.79108972 0.062521795 - 0.44616149 -0.4062069 0.79745588 - Time = -69382717 -CJ(3) = 0.65772528 -0.45544026 -0.59997635 - 0.60690805 0.79219323 0.063972645 - 0.44616149 -0.4062069 0.79745588 - Time = -69382683 -CJ(4) = 0.65919078 -0.45352351 -0.59981992 - 0.60531598 0.79329211 0.065423122 - 0.44616149 -0.4062069 0.79745588 - Time = -69382648 -CJ(5) = 0.66065243 -0.45160411 -0.59965998 - 0.60372038 0.79438635 0.066873216 - 0.44616149 -0.4062069 0.79745588 - Time = -69382614 -CJ(6) = 0.66211021 -0.44968207 -0.59949654 - 0.60212124 0.79547595 0.068322919 - 0.44616149 -0.4062069 0.79745588 - Time = -69382580 -CJ(7) = 0.66356413 -0.4477574 -0.59932959 - 0.60051859 0.7965609 0.069772222 - 0.44616149 -0.4062069 0.79745588 - Time = -69382546 -CJ(8) = 0.66501416 -0.44583011 -0.59915914 - 0.59891242 0.79764119 0.071221118 - 0.44616149 -0.4062069 0.79745588 - Time = -69382512 -CJ(9) = 0.66646031 -0.44390022 -0.59898518 - 0.59730276 0.79871681 0.072669597 - 0.44616149 -0.4062069 0.79745588 - - -Testing angular velocity with Io data ... -SpiceRotation av = -6.3193326e-07 -1.7682968e-05 3.7102704e-05 -J2000 to body-fixed Naif av = -6.3193326e-07 -1.7682968e-05 3.7102704e-05 - - - -Testing partials for target body parameters... -For angles (ra,dec,rotation) = 1.9429654 2.1356375 -0.92665897 -Beginning with J2000 vector 0.78673052 0.30824564 -0.53482681 -lookB = 0.69294371 0.69249343 -0.20070344 - - dLookB with respect to ra = 0.56419869 -0.43208476 0.4571027 - Right ascension partial on A applied to dlookB =: 0.78673052 0.30824564 0 - - dLookB with respect to dec = -0.19972128 0.019831273 -0.62112827 - Declination partial on A applied to dlookB =: 0.27671521 -0.25193486 -0.53482681 - - dLookB with respect to rotation rate = -556.10123 556.46282 0 - Rotation rate partial on A applied to dlookB =: 565090.03 146205.39 -241683.3 - - dLookB with respect to rotation = 0.69249343 -0.69294371 0 - Rotation partial on A applied to dlookB =: 0.87627666 0.22671852 -0.37477468 - - -... Testing failure of body rotation with binary PCK - Source = 0 -Frame type is binary PCK and cannot be updated -End of PCK testing - - -Testing CK based body rotation with 67P/Churyumov–Gerasimenko data ... -Time = 4.6285471e+08 -CJ = 0.93816333 -0.34618155 -0.002810256 - 0.30996014 0.84356223 -0.43855157 - 0.15418909 0.41056193 0.89870163 - - -Testing loading cache from ALE ISD with only time dependent quaternions ... -Frame type = 3 -Is cached? Yes -Has AV? No -Time dependent frame chain = { -94031, 10014, 1 } -Time dependent frame chain = { -94031 } -Time = 0 -CJ(0) = -1 0 0 - 0 -1 0 - 0 0 1 -Time = 1 -CJ(1) = 0 1 0 - -1 0 0 - 0 0 1 -Time = 2 -CJ(2) = 0 1 0 - 1 0 0 - 0 0 -1 -Time = 3 -CJ(3) = -8.6595606e-17 2.220446e-16 -1 - -1 8.6595606e-17 8.6595606e-17 - 8.6595606e-17 1 5.5511151e-17 - - -Testing loading cache from ALE ISD with time dependent quaternions and AV ... -Has AV? Yes - - -Testing loading cache from ALE ISD with time dependent quaternions and constant rotation ... -Time dependent frame chain = { -94030, 10014, 1 } -Time dependent frame chain = { -94031, -94030 } -Time = 0 -CJ(0) = -1 0 0 - 0 0 1 - 0 -1 0 -Time = 1 -CJ(1) = 0 1 0 - 0 0 1 - -1 0 0 -Time = 2 -CJ(2) = 0 1 0 - 0 0 -1 - 1 0 0 -Time = 3 -CJ(3) = -8.6595606e-17 2.220446e-16 -1 - 8.6595606e-17 1 5.5511151e-17 - -1 8.6595606e-17 8.6595606e-17 - - -Testing exceptions... - -**I/O ERROR** Cannot find [INS-99999_TRANSX] in text kernels. - -**PROGRAMMER ERROR** Argument cacheSize must not be less or equal to zero. - -**PROGRAMMER ERROR** Argument startTime must be less than or equal to endTime. - -**PROGRAMMER ERROR** Cache size must be more than 1 if startTime and endTime differ. - -**PROGRAMMER ERROR** A SpiceRotation cache has already been created. - -**PROGRAMMER ERROR** The SpiceRotation has not yet been fit to a function. - -**PROGRAMMER ERROR** Only cached rotations can be returned as a line cache of quaternions and time. - -**PROGRAMMER ERROR** To create table source of data must be either Memcache or PolyFunction. - -**USER ERROR** Target body orientation information not available. Rerun spiceinit. - -**PROGRAMMER ERROR** Unable to evaluate the derivative of the SPICE rotation fit polynomial for the given coefficient index [-1]. Index is negative or exceeds degree of polynomial [2]. - -**PROGRAMMER ERROR** Unable to evaluate the derivative of the target body rotation fit polynomial for the given coefficient index [100]. Index is negative or exceeds degree of polynomial [2]. - -**PROGRAMMER ERROR** A rotation axis is outside the valid range of 1 to 3. - -**USER ERROR** Time cache not available -- rerun spiceinit. - -**PROGRAMMER ERROR** The SpiceRotation pointing angles must be fit to polynomials in order to compute angular velocity. - -**PROGRAMMER ERROR** SpiceRotation::LoadCache(json) only supports Spice source. diff --git a/isis/src/base/objs/SpiceRotation/unitTest.cpp b/isis/src/base/objs/SpiceRotation/unitTest.cpp deleted file mode 100644 index 01eb126da7..0000000000 --- a/isis/src/base/objs/SpiceRotation/unitTest.cpp +++ /dev/null @@ -1,892 +0,0 @@ -#include -#include -#include - -#include - -#include "FileName.h" -#include "IException.h" -#include "Preference.h" -#include "SpiceRotation.h" -#include "Table.h" - -// Declarations for bindings for Naif Spicelib routines that do not have -// a wrapper -extern int bodeul_(integer *body, doublereal *et, doublereal *ra, - doublereal *dec, doublereal *w, doublereal *lamda); - -using json = nlohmann::json; -using namespace std; -using namespace Isis; - -//TODO test loadPCFromSpice() and loadPCFromTable() methods -//TODO see end of unit test for exceptions that need to be tested - -int main(int argc, char *argv[]) { - Preference::Preferences(true); - - cout << setprecision(8); - cout << "Unit test for SpiceRotation" << endl; - - // Test case is taken from moc red wide angle image ab102401 - // sn = MGS/561812335:32/MOC-WA/RED - // Load kernels to allow testing of various SpiceRotation sources - FileName f("$ISISTESTDATA/isis/src/base/unitTestData/kernels"); - QString dir = f.expanded() + "/"; - QString naif (dir + "naif0007.tls"); - QString mgs(dir + "MGS_SCLKSCET.00045.tsc"); - QString mocti(dir + "moc13.ti"); - QString mocbc(dir + "moc.bc"); - QString mocbsp(dir + "moc.bsp"); - QString de(dir + "de405.bsp"); - FileName pckFile("$base/kernels/pck/pck00009.tpc"); - QString pck(pckFile.expanded()); - QString cgFK(dir + "ROS_V29.TF"); - QString cgCK(dir + "CATT_DV_145_02_______00216.BC"); - //QString mocadd(dir+"mocAddendum.ti"); - QString mocspice(dir + "mocSpiceRotationUnitTest.ti"); - furnsh_c(naif.toLatin1().data()); - furnsh_c(mgs.toLatin1().data()); - furnsh_c(mocti.toLatin1().data()); - furnsh_c(mocbc.toLatin1().data()); - furnsh_c(mocbsp.toLatin1().data()); - furnsh_c(de.toLatin1().data()); - furnsh_c(pck.toLatin1().data()); - furnsh_c(mocspice.toLatin1().data()); - furnsh_c(cgFK.toLatin1().data()); - furnsh_c(cgCK.toLatin1().data()); - - double startTime = -69382819.0; - double endTime = -69382512.0; - double slope = (endTime - startTime) / (10 - 1); - - SpiceInt code; - namfrm_c("MGS_MOC", &code); -// namfrm_c ("IAU_MARS", &code); - cout << "Naif code = " << code << endl; - - - SpiceRotation rot(-94031); // MGS_MOC - - // Normal testing of SetEphemerisTime ie. source=SPICE(no cache) - cout << "Testing without cache (from SPICE)... " << endl; - for (int i = 0; i < 10; i++) { - double t = startTime + (double) i * slope; - rot.SetEphemerisTime(t); - vector CJ = rot.Matrix(); - - cout << "CJ(" << i << ") = " << CJ[0] << " " << CJ[1] << " " << CJ[2] << endl; - cout << " " << CJ[3] << " " << CJ[4] << " " << CJ[5] << endl; - cout << " " << CJ[6] << " " << CJ[7] << " " << CJ[8] << endl; - - if (rot.HasAngularVelocity()) { - vector av = rot.AngularVelocity(); - cout << "av(" << i << ") = " << av[0] << " " << av[1] << " " << av[2] << endl; - } - } - cout << endl; - - // Testing with cache - cout << "Testing with cache ... " << endl; - rot.LoadCache(startTime, endTime, 10); - for (int i = 0; i < 10; i++) { - double t = startTime + (double) i * slope; - rot.SetEphemerisTime(t); - vector CJ = rot.Matrix(); - cout << "Time = " << rot.EphemerisTime() << endl; - cout << "CJ(" << i << ") = " << CJ[0] << " " << CJ[1] << " " << CJ[2] << endl; - cout << " " << CJ[3] << " " << CJ[4] << " " << CJ[5] << endl; - cout << " " << CJ[6] << " " << CJ[7] << " " << CJ[8] << endl; - - if (rot.HasAngularVelocity()) { - vector av = rot.AngularVelocity(); - cout << "av(" << i << ") = " << av[0] << " " << av[1] << " " << av[2] << endl; - } - } - std::cout << "Cache Size: " << rot.cacheSize() << '\n'; - cout << endl; - - // Save off cache for polynomial over SPICE test - Table tab = rot.Cache("TestPolyOver"); - - // Testing with Functions - cout << "Testing with functions ... " << endl; - vector abcAng1, abcAng2, abcAng3; - rot.SetPolynomial(); - rot.GetPolynomial(abcAng1, abcAng2, abcAng3); - cout << "Source = " << rot.GetSource() << endl; - - for (int i = 0; i < 10; i++) { - double t = startTime + (double) i * slope; - rot.SetEphemerisTime(t); - vector CJ = rot.Matrix(); - cout << "Time = " << rot.EphemerisTime() << endl; - cout << "CJ(" << i << ") = " << CJ[0] << " " << CJ[1] << " " << CJ[2] << endl; - cout << " " << CJ[3] << " " << CJ[4] << " " << CJ[5] << endl; - cout << " " << CJ[6] << " " << CJ[7] << " " << CJ[8] << endl; - - if (rot.HasAngularVelocity()) { - vector av = rot.AngularVelocity(); - cout << "av(" << i << ") = " << av[0] << " " << av[1] << " " << av[2] << endl; - } - } - cout << endl; - - - // Testing polynomial over Spice - cout << "Testing with polynomial functions over Spice ... " << endl; - SpiceRotation rot2(-94031); - rot2.LoadCache(tab); - rot2.ComputeBaseTime(); - abcAng1.clear(); - abcAng2.clear(); - abcAng3.clear(); - rot2.SetPolynomialDegree(2); - abcAng1.push_back(0.0030493533013399013); - abcAng1.push_back(-0.0027570887651990781); - abcAng1.push_back(0.0042922079124063069); - abcAng2.push_back(0.0059563322487913659); - abcAng2.push_back(0.00050048260885665553); - abcAng2.push_back(-0.0035838749526626921); - abcAng3.push_back(0.0057982287753588907); - abcAng3.push_back(-0.009966680359987867); - abcAng3.push_back(-0.0073237560434568881); - rot2.SetPolynomial(abcAng1, abcAng2, abcAng3, SpiceRotation::PolyFunctionOverSpice); - cout << "Source = " << rot2.GetSource() << endl; - - for (int i = 0; i < 10; i++) { - double t = startTime + (double) i * slope; - rot2.SetEphemerisTime(t); - vector CJ = rot2.Matrix(); - cout << "Time = " << rot2.EphemerisTime() << endl; - cout << "CJ(" << i << ") = " << CJ[0] << " " << CJ[1] << " " << CJ[2] << endl; - cout << " " << CJ[3] << " " << CJ[4] << " " << CJ[5] << endl; - cout << " " << CJ[6] << " " << CJ[7] << " " << CJ[8] << endl; - - if (rot2.HasAngularVelocity()) { - vector av = rot2.AngularVelocity(); - cout << "av(" << i << ") = " << av[0] << " " << av[1] << " " << av[2] << endl; - } - } - cout << endl; - - // Test polynomial over Cache conversion to reduced cache - cout << "Test fitting polynomial function over cache to new cache" << endl; - - // Get new cache using existing cache and polynomial - Table tab2 = rot2.Cache("Outputcache"); - SpiceRotation rot3(-94031); - - - // Load tab2 into the object - rot3.LoadCache(tab2); - - cout << "Source = " << rot3.GetSource() << endl; - - for (int i = 0; i < 10; i++) { - double t = startTime + (double) i * slope; - rot3.SetEphemerisTime(t); - vector CJ = rot3.Matrix(); - cout << "Time = " << rot3.EphemerisTime() << endl; - cout << "CJ(" << i << ") = " << CJ[0] << " " << CJ[1] << " " << CJ[2] << endl; - cout << " " << CJ[3] << " " << CJ[4] << " " << CJ[5] << endl; - cout << " " << CJ[6] << " " << CJ[7] << " " << CJ[8] << endl; - - if (rot3.HasAngularVelocity()) { - vector av = rot3.AngularVelocity(); - cout << "av(" << i << ") = " << av[0] << " " << av[1] << " " << av[2] << endl; - } - } - cout << endl; - - - // Testing ToReferencePartial method - cout << "Testing ToReferencePartial method" << endl; - vector angles = rot.Angles(3, 1, 3); - cout << "For angles (ra,dec,twist) = " << angles[0] << " " << angles[1] << " " << angles[2] - << endl; - vector lookC; - lookC.push_back(0.); - lookC.push_back(0.); - lookC.push_back(1.); - vector lookJ = rot.J2000Vector(lookC); - // Save a J2000 vector for testing target body partial methods later. - vector testLookJ(lookJ); - cout << " For lookJ = " << lookJ[0] << " " << lookJ[1] << " " << lookJ[2] << endl; - vector dAraLookC(3); - dAraLookC = rot.ToReferencePartial(lookJ, SpiceRotation::WRT_RightAscension, 0); - // Take care of round-off problem. Look for a better way - if (abs(dAraLookC[2]) < .00000000001) dAraLookC[2] = 0.; - cout << "Right ascension partial on A applied to lookJ =: " << dAraLookC[0] << " " - << dAraLookC[1] << " " << dAraLookC[2] << endl; - - vector dBraLookC(3); - dBraLookC = rot.ToReferencePartial(lookJ, SpiceRotation::WRT_RightAscension, 1); - if (abs(dBraLookC[2]) < .00000000001) dBraLookC[2] = 0.; - cout << "Right ascension partial on B applied to lookJ =: " << dBraLookC[0] << " " - << dBraLookC[1] << " " << dBraLookC[2] << endl; - - vector dCraLookC(3); - dCraLookC = rot.ToReferencePartial(lookJ, SpiceRotation::WRT_RightAscension, 2); - if (abs(dCraLookC[2]) < .00000000001) dCraLookC[2] = 0.; - cout << "Right ascension partial on C applied to lookJ =: " << dCraLookC[0] << " " - << dCraLookC[1] << " " << dCraLookC[2] << endl; - - vector dAdecLookC(3); - dAdecLookC = rot.ToReferencePartial(lookJ, SpiceRotation::WRT_Declination, 0); - if (abs(dAdecLookC[2]) < .00000000001) dAdecLookC[2] = 0.; - cout << "Declination partial on A applied to lookJ =: " << dAdecLookC[0] << " " - << dAdecLookC[1] << " " << dAdecLookC[2] << endl << endl; - - vector dAtwLookC; - dAtwLookC = rot.ToReferencePartial(lookJ, SpiceRotation::WRT_Twist, 0); - for (int i = 0; i < 3; i++) { - if (abs(dAtwLookC[i]) < .00000000000001) dAtwLookC[i] = 0.; - } - cout << "Twist partial on A applied to lookJ =: " << dAtwLookC[0] << " " - << dAtwLookC[1] << " " << dAtwLookC[2] << endl << endl; - - cout << "Testing with setting functions ... " << endl; - Table tab1 = rot.Cache("Test"); - SpiceRotation rot4(-94031); - SpiceRotation::Source source = SpiceRotation::Spice; -// rot4.SetSource(source); -// rot4.LoadCache(startTime, endTime, 10); - rot4.LoadCache(tab1); -// rot4.SetPolynomial(abcAng1, abcAng2, abcAng3); - source = rot4.GetSource(); - cout << "Source = " << source << endl; - for (int i = 0; i < 10; i++) { - double t = startTime + (double) i * slope; - rot4.SetEphemerisTime(t); - vector CJ = rot4.Matrix(); - cout << "Time = " << rot4.EphemerisTime() << endl; - cout << "CJ(" << i << ") = " << CJ[0] << " " << CJ[1] << " " << CJ[2] << endl; - cout << " " << CJ[3] << " " << CJ[4] << " " << CJ[5] << endl; - cout << " " << CJ[6] << " " << CJ[7] << " " << CJ[8] << endl; - - if (rot4.HasAngularVelocity()) { - vector av = rot4.AngularVelocity(); - cout << "av(" << i << ") = " << av[0] << " " << av[1] << " " << av[2] << endl; - } - } - cout << endl; - - - // Test LineCache method - cout << "Testing line cache..." << endl; - Table tab4 = rot4.LineCache("Test5"); - SpiceRotation rot5(-94031); - rot5.LoadCache(tab4); - - for (int i = 0; i < 10; i++) { - double t = startTime + (double) i * slope; - rot5.SetEphemerisTime(t); - vector CJ = rot5.Matrix(); - cout << "Time = " << rot5.EphemerisTime() << endl; - cout << "CJ(" << i << ") = " << CJ[0] << " " << CJ[1] << " " << CJ[2] << endl; - cout << " " << CJ[3] << " " << CJ[4] << " " << CJ[5] << endl; - cout << " " << CJ[6] << " " << CJ[7] << " " << CJ[8] << endl; - - if (rot5.HasAngularVelocity()) { - vector av = rot5.AngularVelocity(); - cout << "av(" << i << ") = " << av[0] << " " << av[1] << " " << av[2] << endl; - } - } - cout << endl; - - - // Test table options - cout << "Testing tables ... " << endl; - Table tab3 = rot.Cache("Test"); - SpiceRotation rot6(-94031); - rot6.LoadCache(tab3); - for (int i = 0; i < 10; i++) { - double t = startTime + (double) i * slope; - rot6.SetEphemerisTime(t); - vector CJ = rot6.Matrix(); - cout << "Time = " << rot6.EphemerisTime() << endl; - cout << "CJ(" << i << ") = " << CJ[0] << " " << CJ[1] << " " << CJ[2] << endl; - cout << " " << CJ[3] << " " << CJ[4] << " " << CJ[5] << endl; - cout << " " << CJ[6] << " " << CJ[7] << " " << CJ[8] << endl; -// cout << "Spacecraft (J) = " << p[0] << " " << p[1] << " " << p[2] << endl; - - if (rot6.HasAngularVelocity()) { - vector av = rot6.AngularVelocity(); - cout << "av(" << i << ") = " << av[0] << " " << av[1] << " " << av[2] << endl; - } - } - cout << endl; - -// Test J2000 and Reference vector methods - cout << "Testing vector methods" << endl; - rot6.SetEphemerisTime(startTime); - vector v(3); - v[0] = 0.; - v[1] = 0.; - v[2] = 1.; - vector vout = rot6.J2000Vector(v); - cout << "v = " << v[0] << " " << v[1] << " " << v[2] << endl; - v = rot6.ReferenceVector(vout); - - // Take care of Solaris round-off problem. Look for a better way - if (abs(v[0]) < .00000000000000012) v[0] = 0.; - if (abs(v[1]) < .00000000000000012) v[1] = 0.; - cout << "v = " << v[0] << " " << v[1] << " " << v[2] << endl; - - - - // Testing linear Function - cout << "Testing with linear function ... " << endl; - SpiceRotation linrot(-94031); - linrot.LoadCache(startTime, endTime, 2); - linrot.SetEphemerisTime(startTime); - linrot.SetEphemerisTime(endTime); - - linrot.SetPolynomial(); - linrot.GetPolynomial(abcAng1, abcAng2, abcAng3); - - cout << "Source = " << linrot.GetSource() << endl; - - for (int i = 0; i < 2; i++) { - double t = startTime + (double) i * (endTime - startTime); - linrot.SetEphemerisTime(t); - vector CJ = linrot.Matrix(); - cout << "Time = " << linrot.EphemerisTime() << endl; - cout << "CJ(" << i << ") = " << CJ[0] << " " << CJ[1] << " " << CJ[2] << endl; - cout << " " << CJ[3] << " " << CJ[4] << " " << CJ[5] << endl; - cout << " " << CJ[6] << " " << CJ[7] << " " << CJ[8] << endl; - } - cout << endl; - - -// Test Nadir source option - cout << "Testing Nadir rotation ... " << endl; - SpiceRotation naRot(-94031, 499); - - for (int i = 0; i < 10; i++) { - double t = startTime + (double) i * slope; - naRot.SetEphemerisTime(t); - vector CJ = naRot.Matrix(); - - cout << "Time = " << naRot.EphemerisTime() << endl; - cout << "CJ(" << i << ") = " << CJ[0] << " " << CJ[1] << " " << CJ[2] << endl; - cout << " " << CJ[3] << " " << CJ[4] << " " << CJ[5] << endl; - cout << " " << CJ[6] << " " << CJ[7] << " " << CJ[8] << endl; - } - cout << endl; - - // Test angle wrap method - double newangle = naRot.WrapAngle(0.5235987756, 4.188790205); - cout << "Testing angle wrapping..." << endl; - cout << " Using anchor angle of 30, 240 changes to " << newangle * 180. / pi_c() << endl; - newangle = naRot.WrapAngle(0.5235987756, -0.1745329252); - cout << " Using anchor angle of 30, -10 changes to " << newangle * 180. / pi_c() << endl; - newangle = naRot.WrapAngle(0.5235987756, -3.141592654); - cout << " Using anchor angle of 30, -180 changes to " << newangle * 180. / pi_c() << endl; - newangle = naRot.WrapAngle(0.5235987756, 1.570796327); - cout << " Using anchor angle of 30, 90 changes to " << newangle * 180. / pi_c() << endl < 1 - // Use Galileo Io image with product id = 21I0165 for testing nutation/precession terms. Mars has none. - // tet = -15839262.24291 - // body frame code for Io = 10023 - // Use Europa for exercising the code using nutation/precession terms. Mars has none. - SpiceRotation targrot1(10014); //Frame code for Mars - // SpiceRotation targrotV1(10024); //Frame code for Europa - // targrotV1.LoadCache(-646009153.46723, -646009153.46723, 1); // This calls LoadPcFromSpice for Europa - SpiceRotation targrotV1(10023); //Frame code for Io - targrotV1.LoadCache(-15839262.24291, -15839262.24291, 1); // This calls LoadPcFromSpice for Io - targrot1.LoadCache(startTime, endTime, 2); // This calls LoadPcFromSpice for Mars - cout << "Test CacheLabel for PCK data..." << endl; - Table pcktab = targrot1.Cache("Planetary constants test table"); // This calls CacheLabel - Table pcktabV = targrotV1.Cache("Planetary constants test table"); // This calls CacheLabel - SpiceRotation targrot(10014); // Mars - // SpiceRotation targrotV(10024); // Europa -- The results for pm will differ slightly from TrigBasis because of the older PCK - SpiceRotation targrotV(10023); // Io -- - cout << "Test LoadPCFromTable..." << endl; - targrot.LoadCache(pcktab); // This calls LoadPcFromTable - targrotV.LoadCache(pcktabV); // This calls LoadPcFromTable - // Now get the values - vector poleRa = targrotV.poleRaCoefs(); - vector poleDec = targrotV.poleDecCoefs(); - vector prMer = targrotV.pmCoefs(); - vector raNutPrec = targrotV.poleRaNutPrecCoefs(); - vector decNutPrec = targrotV.poleDecNutPrecCoefs(); - vector pmNutPrec = targrotV.pmNutPrecCoefs(); - vector sysNutPrec0 = targrotV.sysNutPrecConstants(); - vector sysNutPrec1 = targrotV.sysNutPrecCoefs(); - cout << "Io Pole RA coefficients = " << poleRa[0].degrees() << "," << poleRa[1].degrees() << "," - << poleRa[2].degrees() << endl; - cout << "Io Pole DEC coefficients = " << poleDec[0].degrees() << "," << poleDec[1].degrees() - << "," << poleDec[2].degrees() << endl; - cout << "Io PM coefficients = " << prMer[0].degrees() << "," << prMer[1].degrees() << "," - << prMer[2].degrees() << endl; - int numcoef = (int) sysNutPrec0.size(); - - if (raNutPrec.size() > 0) { - cout << "Io Pole RA Nutation/Precession coefficients = "; - for (int ic = 0; ic < numcoef; ic++) cout << raNutPrec[ic] << ","; - cout << endl; - } - if (decNutPrec.size() > 0) { - cout << "Io Pole DEC Nutation/Precession coefficients = "; - for (int ic = 0; ic < numcoef; ic++) cout << decNutPrec[ic] << ","; - cout << endl; - } - if (pmNutPrec.size() > 0) { - cout << "Io PM Nutation/Precession coefficients = "; - for (int ic = 0; ic < numcoef; ic++) cout << pmNutPrec[ic] << ","; - cout << endl; - } - if (sysNutPrec0.size() > 0) { - cout << "Io System Nutation/Precession constants = "; - for (int ic = 0; ic < numcoef; ic++) cout << sysNutPrec0[ic].degrees() << ","; - cout << endl; - } - if (sysNutPrec0.size() > 0) { - cout << "Io System Nutation/Precession coefficients = "; - for (int ic = 0; ic < numcoef; ic++) cout << sysNutPrec1[ic].degrees() << ","; - cout << endl; - } - - // Test SetPckPolynomial methods - cout << endl << "Testing with PCK polynomial ... " << endl; - - SpiceInt ibod; - doublereal tet, tra, tdec, tomega, tlambda; - - // Only save one set - // For testing Europa with the nutation/precession terms and a cache size of 1 - // tet = -646009153.46723; // time et for Europa - // ibod = 502; // Europa - // bodeul_(&ibod, &tet, &tra,&tdec, &tomega, &tlambda); - // targrotV.SetEphemerisTime(tet); - // vector pckanglesV = targrotV.Angles(3, 1, 3); - // cout << " Angles = " << pckanglesV[0]*dpr_c() <<","<< pckanglesV[1]*dpr_c() <<"," - // << pckanglesV[2]*dpr_c() < pckanglesV = targrotV.Angles(3, 1, 3); - cout << "Io Angles = " << pckanglesV[0]*dpr_c() <<","<< pckanglesV[1]*dpr_c() <<"," - << pckanglesV[2]*dpr_c() < av = targrotV.AngularVelocity(); - cout << "SpiceRotation av = " << av[0] << " " << av[1] << " " << av[2] << endl; - SpiceDouble tsipm[6][6]; - sxform_c ( "J2000", "IAU_IO", -15839262.24291, tsipm); - // sxform_c ( "J2000", "IAU_EUROPA", -646009153.46723, tsipm); - SpiceDouble tipm[3][3]; - vector nav(3,0.); - xf2rav_c (tsipm, tipm, &(nav[0]) ); - cout << "J2000 to body-fixed Naif av = " << nav[0] << " " << nav[1] << " " << nav[2] << endl; - } - cout << endl; - - cout << endl << endl << "Testing partials for target body parameters..." << endl; - targrot.SetEphemerisTime(startTime); - cout << "For angles (ra,dec,rotation) = " << angles[0] << " " << angles[1] << " " << angles[2] - << endl; - // vector dLookB(3); - cout << "Beginning with J2000 vector " << testLookJ[0] << " " << testLookJ[1] << " " << testLookJ[2] << endl; - vector lookB = targrot.ReferenceVector(testLookJ); - cout << "lookB = " << lookB[0] << " " << lookB[1] << " " << lookB[2] << endl; - - vector dLookB = targrot.ToReferencePartial(testLookJ, SpiceRotation::WRT_RightAscension, 0); - cout << endl << " dLookB with respect to ra = " << dLookB[0] << " " << dLookB[1] << " " << dLookB[2] << endl; - vector matchLookJ(3); - matchLookJ = targrot.toJ2000Partial(dLookB, SpiceRotation::WRT_RightAscension, 0); - cout << " Right ascension partial on A applied to dlookB =: " << matchLookJ[0] << " " - << matchLookJ[1] << " " << matchLookJ[2] << endl; - - dLookB = targrot.ToReferencePartial(testLookJ, SpiceRotation::WRT_Declination, 0); - cout << endl << " dLookB with respect to dec = " << dLookB[0] << " " << dLookB[1] << " " - << dLookB[2] << endl; - matchLookJ = targrot.toJ2000Partial(dLookB, SpiceRotation::WRT_Declination, 0); - cout << " Declination partial on A applied to dlookB =: " << matchLookJ[0] << " " - << matchLookJ[1] << " " << matchLookJ[2] << endl; - - dLookB = targrot.ToReferencePartial(testLookJ, SpiceRotation::WRT_Twist, 1); - cout << endl << " dLookB with respect to rotation rate = " << dLookB[0] << " " << - dLookB[1] << " " << dLookB[2] << endl; - //If I apply toJ2000Partial to dLookB, I get back lookJ(x,y,0) with roundoff -- 05-12-2015 DAC - matchLookJ = targrot.toJ2000Partial(dLookB, SpiceRotation::WRT_Twist, 1); - cout << " Rotation rate partial on A applied to dlookB =: " << matchLookJ[0] << " " - << matchLookJ[1] << " " << matchLookJ[2] << endl; - - dLookB = targrot.ToReferencePartial(testLookJ, SpiceRotation::WRT_Twist, 0); - cout << endl << " dLookB with respect to rotation = " << dLookB[0] << " " << - dLookB[1] << " " << dLookB[2] << endl; - //If I apply toJ2000Partial to dLookB, I get back lookJ(x,y,0) with roundoff -- 05-12-2015 DAC - matchLookJ = targrot.toJ2000Partial(dLookB, SpiceRotation::WRT_Twist, 0); - cout << " Rotation partial on A applied to dlookB =: " << matchLookJ[0] << " " - << matchLookJ[1] << " " << matchLookJ[2] << endl; - - cout << endl << endl << "... Testing failure of body rotation with binary PCK" << endl; - FileName fb("$base/kernels/"); - QString dirb = fb.expanded() + "/"; - QString bpck(dirb + "pck/lunar_de403_1950-2199_pa.bpc"); - QString fk(dirb + "fk/lunarMeanEarth001.tf"); - furnsh_c(bpck.toLatin1().data()); - furnsh_c(fk.toLatin1().data()); - SpiceRotation targrotbin(310001); //Frame code for Moon - cout << " Source = " << targrotbin.GetSource() << endl; - targrotbin.LoadCache(startTime, startTime, 1); // This calls LoadPcFromSpice - SpiceRotation::FrameType frameType = targrotbin.getFrameType(); - - if (frameType == SpiceRotation::BPC) - cout << "Frame type is binary PCK and cannot be updated" << endl; - - - cout << "End of PCK testing" << endl; - - // Test CK based body rotation - cout << endl << endl << "Testing CK based body rotation with 67P/Churyumov–Gerasimenko data ..." << endl; - - SpiceRotation cgRotation(-1000012000); - // Test time from Rosetta OSIRIS NAC image n20140901t144253568id30f22 - double cgTestTime = 462854709.88606; - cgRotation.SetEphemerisTime(cgTestTime); - vector cgCJ = cgRotation.Matrix(); - cout << "Time = " << cgRotation.EphemerisTime() << endl; - cout << "CJ = " << cgCJ[0] << " " << cgCJ[1] << " " << cgCJ[2] << endl; - cout << " " << cgCJ[3] << " " << cgCJ[4] << " " << cgCJ[5] << endl; - cout << " " << cgCJ[6] << " " << cgCJ[7] << " " << cgCJ[8] << endl; - - // Test loading cache from ALE ISD with only time dependent quaternions - cout << endl << endl << "Testing loading cache from ALE ISD with only time dependent quaternions ..." << endl; - SpiceRotation aleQuatRot(-94031); - // Test Rotations are 'xyz' euler angle rotations: - // [0, 0, 0], - // [-90, 0, 0], - // [-90, 180, 0], - // [-90, 180, 90] - json aleQuatIsd = {{"ck_table_start_time" , 0.0}, - {"ck_table_end_time" , 3.0}, - {"ck_table_original_size" , 4}, - {"ephemeris_times" , {0.0, 1.0, 2.0, 3.0}}, - {"time_dependent_frames" , {-94031, 10014, 1}}, - {"quaternions" , {{0.0, 0.0, 0.0, 1.0}, - {-1.0 / sqrt(2), 0.0, 0.0, 1.0 / sqrt(2)}, - {0.0, 1.0 / sqrt(2), 1.0 / sqrt(2), 0.0}, - {-0.5, -0.5, 0.5, 0.5}}}}; - aleQuatRot.LoadCache(aleQuatIsd); - cout << "Frame type = " << aleQuatRot.getFrameType() << endl; - cout << "Is cached? " << (aleQuatRot.IsCached() ? "Yes" : "No") << endl; - cout << "Has AV? " << (aleQuatRot.HasAngularVelocity() ? "Yes" : "No") << endl; - vector timeDepChain = aleQuatRot.TimeFrameChain(); - cout << "Time dependent frame chain = { "; - for (unsigned int i = 0; i < timeDepChain.size(); i++) { - if (i > 0) { - cout << ", "; - } - cout << timeDepChain[i]; - } - cout << " }" << endl; - vector constChain = aleQuatRot.ConstantFrameChain(); - cout << "Time dependent frame chain = { "; - for (int i = 0; i < constChain.size(); i++) { - if (i > 0) { - cout << ", "; - } - cout << constChain[i]; - } - cout << " }" << endl; - for (int t = 0; t <= 3; t++) { - aleQuatRot.SetEphemerisTime(t); - vector CJ = aleQuatRot.Matrix(); - cout << "Time = " << aleQuatRot.EphemerisTime() << endl; - cout << "CJ(" << t << ") = " << CJ[0] << " " << CJ[1] << " " << CJ[2] << endl; - cout << " " << CJ[3] << " " << CJ[4] << " " << CJ[5] << endl; - cout << " " << CJ[6] << " " << CJ[7] << " " << CJ[8] << endl; - } - - // Test loading cache from ALE ISD with time dependent quaternions and AV - cout << endl << endl << "Testing loading cache from ALE ISD with time dependent quaternions and AV ..." << endl; - SpiceRotation aleQuatAVRot(-94031); - json aleQuatAVIsd(aleQuatIsd); - aleQuatAVIsd["angular_velocities"] = {{-Isis::PI / 2, 0.0, 0.0}, - {0.0, Isis::PI, 0.0}, - {0.0, 0.0, Isis::PI / 2}, - {0.0, 0.0, Isis::PI / 2}}; - aleQuatAVRot.LoadCache(aleQuatAVIsd); - cout << "Has AV? " << (aleQuatAVRot.HasAngularVelocity() ? "Yes" : "No") << endl; - - // Test loading cache from ALE ISD with time dependent quaternions and constant rotation - cout << endl << endl << "Testing loading cache from ALE ISD with time dependent quaternions and constant rotation ..." << endl; - SpiceRotation aleQuatConstRot(-94031); - json aleQuatConstIsd(aleQuatIsd); - aleQuatConstIsd["time_dependent_frames"] = {-94030, 10014, 1}; - aleQuatConstIsd["constant_frames"] = {-94031, -94030}; - aleQuatConstIsd["constant_rotation"] = {1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0}; - aleQuatConstRot.LoadCache(aleQuatConstIsd); - timeDepChain = aleQuatConstRot.TimeFrameChain(); - cout << "Time dependent frame chain = { "; - for (int i = 0; i < timeDepChain.size(); i++) { - if (i > 0) { - cout << ", "; - } - cout << timeDepChain[i]; - } - cout << " }" << endl; - constChain = aleQuatConstRot.ConstantFrameChain(); - cout << "Time dependent frame chain = { "; - for (int i = 0; i < constChain.size(); i++) { - if (i > 0) { - cout << ", "; - } - cout << constChain[i]; - } - cout << " }" << endl; - for (int t = 0; t <= 3; t++) { - aleQuatConstRot.SetEphemerisTime(t); - vector CJ = aleQuatConstRot.Matrix(); - cout << "Time = " << aleQuatConstRot.EphemerisTime() << endl; - cout << "CJ(" << t << ") = " << CJ[0] << " " << CJ[1] << " " << CJ[2] << endl; - cout << " " << CJ[3] << " " << CJ[4] << " " << CJ[5] << endl; - cout << " " << CJ[6] << " " << CJ[7] << " " << CJ[8] << endl; - } - - //Test exceptions - cout << endl << endl << "Testing exceptions..." << endl; - SpiceRotation testRot(-94031); // MGS_MOC - - - // SpiceRotation(frameCode, targetCode) - // "Cannot find [key] in text kernels - try { - cout << endl; - SpiceRotation sr(-99999, 499); // will not have a INS_TRANSX key - } - catch (IException &e) { - e.print(); - } - - // LoadCache(startTime, endTime, size) - // "Argument cacheSize must not be less or equal to zero" - try { - cout << endl; - testRot.LoadCache(10, 20, -1); - } - catch (IException &e) { - e.print(); - } - - // "Argument startTime must be less than or equal to endTime" - try { - cout << endl; - testRot.LoadCache(20, 10, 1); - } - catch (IException &e) { - e.print(); - } - - // "Cache size must be more than 1 if startTime and endTime differ" - try { - cout << endl; - testRot.LoadCache(10, 20, 1); - } - catch (IException &e) { - e.print(); - } - - // "A SpiceRotation cache has already been created" - try { - cout << endl; - testRot.LoadCache(startTime, endTime, 2); - testRot.LoadCache(startTime, endTime - 1, 2); - } - catch (IException &e) { - e.print(); - } - - // ReloadCache() - // "The SpiceRotation has not yet been fit to a function" - try { - cout << endl; - testRot.ReloadCache(); - } - catch (IException &e) { - e.print(); - } - - // LineCache(tableName) - // "Only cached rotations can be returned as a line cache of quaternions and time" - try { - cout << endl; - SpiceRotation sr(-94031); - sr.LineCache("TableTest"); - } - catch (IException &e) { - e.print(); - } - - // Cache(tableName) - // "To create table source of data must be either Memcache or PolyFunction" - try { - cout << endl; - SpiceRotation sr(-94031); - sr.Cache("TableTest"); - } - catch (IException &e) { - e.print(); - } - - // toJ2000Partial() - //TODO test its 3 exceptions - - // usePckPolynomial() - // "Target body orientation information not available. Rerun spiceinit." - try { - cout << endl; - testRot.usePckPolynomial(); - } - catch (IException &e) { - e.print(); - } - - // DPolynomial(coeffIndex) - // "Unable to evaluate the derivative of the SPCIE rotation fit - // polynomial for the given coefficient index. Index is negative - // or exceeds degree of polynomial" - try { - cout << endl; - testRot.DPolynomial(-1); - } - catch (IException &e) { - e.print(); - } - - // DPckPolynomial(partialVar, coeffIndex) - // "Unable to evaluate the derivative of the SPCIE rotation fit - // polynomial for the given coefficient index. Index is negative - // or exceeds degree of polynomial" - try { - cout << endl; - testRot.DPckPolynomial(SpiceRotation::WRT_Twist, 100); - } - catch (IException &e) { - e.print(); - } - - // ToReferencePartial(lookJ, partialVar, coeffIndex) - // "Only CK and PCK partials can be calculated" - //TODO (need to use a frame type that isn't UNKNOWN, CK, or PCK (try BPC?) - - - // SetAxes(axis1, axis2, axis3) - // "A rotation axis is outside the valid range of 1 to 3" - try { - cout << endl; - testRot.SetAxes(0,2,3); - } - catch (IException &e) { - e.print(); - } - - // LoadTimeCache() - //TODO test its 3 exceptions - - // GetFullCacheTime() - // "Time cache not availabe -- rerun spiceinit" - try { - cout << endl; - SpiceRotation sr(-94031); - sr.GetFullCacheTime(); - } - catch (IException &e) { - e.print(); - } - - // FrameTrace() - //TODO test its 3 exceptions - - // ComputeAv() - // "The SpiceRotation pointing angles must be fit to polynomials in order to - // compute angular velocity." - try { - cout << endl; - testRot.ComputeAv(); - } - catch (IException &e) { - e.print(); - } - - // LoadCache(json) - // "SpiceRotation::LoadCache(json) only support Spice source - try { - cout << endl; - json errorTestIsd = {"Invalid"}; - linrot.LoadCache(errorTestIsd); - } - catch (IException &e) { - e.print(); - } - - //TODO - // "Planetary angular velocity must be fit computed with PCK polynomials " - - // SetEphemerisTimeSpice() - //TODO test its 3 exceptions -} diff --git a/isis/tests/SpiceRotationTests.cpp b/isis/tests/SpiceRotationTests.cpp new file mode 100644 index 0000000000..75ca7fe019 --- /dev/null +++ b/isis/tests/SpiceRotationTests.cpp @@ -0,0 +1,819 @@ +#include "gmock/gmock.h" + +#include +#include +#include +#include +#include + +#include + +#include + +#include "Angle.h" +#include "FileName.h" +#include "IException.h" +#include "Preference.h" +#include "SpiceRotation.h" +#include "Table.h" +#include "TestUtilities.h" + +// Declarations for bindings for Naif Spicelib routines that do not have +// a wrapper +extern int bodeul_(integer *body, doublereal *et, doublereal *ra, + doublereal *dec, doublereal *w, doublereal *lamda); + +using json = nlohmann::json; +using namespace std; +using namespace Isis; + +// Old unit test set output precision to 8 digits. +double testTolerance = 1e-8; + +// Test case is taken from moc red wide angle image ab102401 +// sn = MGS/561812335:32/MOC-WA/RED +// +// This is written as a fixture to ensure that the test kernels get unloaded +// regardless of how the test finishes. +class SpiceRotationKernels : public ::testing::Test { + protected: + vector kernels; + double startTime; + double endTime; + int frameCode; + int targetCode; + + void SetUp() { + startTime = -69382819.0; + endTime = -69382512.0; + frameCode = -94031; + targetCode = 499; + + QString dir = FileName("$ISISTESTDATA/isis/src/base/unitTestData/kernels").expanded() + "/"; + kernels.clear(); + kernels.push_back(dir + "naif0007.tls"); + kernels.push_back(dir + "MGS_SCLKSCET.00045.tsc"); + kernels.push_back(dir + "moc13.ti"); + kernels.push_back(dir + "moc.bc"); + kernels.push_back(dir + "moc.bsp"); + kernels.push_back(dir + "de405.bsp"); + kernels.push_back(dir + "pck00009.tpc"); + kernels.push_back(dir + "mocSpiceRotationUnitTest.ti"); + kernels.push_back(dir + "ROS_V29.TF"); + kernels.push_back(dir + "CATT_DV_145_02_______00216.BC"); + for (QString& kernel : kernels) { + furnsh_c(kernel.toLatin1().data()); + } + } + + void TearDown() { + for (QString& kernel : kernels) { + unload_c(kernel.toLatin1().data()); + } + } +}; + +class SpiceRotationIsd : public ::testing::Test { + protected: + json isd; + json isdAv; + json isdConst; + + void SetUp() { + isd = {{"ck_table_start_time" , 0.0}, + {"ck_table_end_time" , 3.0}, + {"ck_table_original_size" , 4}, + {"ephemeris_times" , {0.0, 1.0, 2.0, 3.0}}, + {"time_dependent_frames" , {-94031, 10014, 1}}, + {"quaternions" , {{0.0, 0.0, 0.0, 1.0}, + {-1.0 / sqrt(2), 0.0, 0.0, 1.0 / sqrt(2)}, + {0.0, 1.0 / sqrt(2), 1.0 / sqrt(2), 0.0}, + {-0.5, -0.5, 0.5, 0.5}}}}; + isdAv = isd; + isdAv["angular_velocities"] = {{-Isis::PI / 2, 0.0, 0.0}, + {0.0, Isis::PI, 0.0}, + {0.0, 0.0, Isis::PI / 2}, + {0.0, 0.0, Isis::PI / 2}}; + isdConst = isd; + isdConst["time_dependent_frames"] = {-94030, 10014, 1}; + isdConst["constant_frames"] = {-94031, -94030}; + isdConst["constant_rotation"] = {1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0}; + } +}; + +TEST_F(SpiceRotationKernels, FromSpice) { + SpiceRotation rot(frameCode); + + // Start time + rot.SetEphemerisTime(startTime); + EXPECT_DOUBLE_EQ(rot.EphemerisTime(), startTime); + + vector startCJ = rot.Matrix(); + EXPECT_PRED_FORMAT3(AssertVectorsNear, startCJ, + (vector{-0.87506927, 0.25477955, -0.41151081, + 0.011442263, 0.86088548, 0.50867009, + 0.48386242, 0.44041295, -0.75624969}), + testTolerance); + + ASSERT_TRUE(rot.HasAngularVelocity()); + vector startAV = rot.AngularVelocity(); + EXPECT_PRED_FORMAT3(AssertVectorsNear, startAV, + (vector{-1.3817139e-05, -0.0011493844, -0.00067443921}), + testTolerance); + + // Middle time + rot.SetEphemerisTime(startTime + (4 * (endTime - startTime) / 9)); + + vector midCJ = rot.Matrix(); + EXPECT_PRED_FORMAT3(AssertVectorsNear, midCJ, + (vector{-0.77359018, 0.32985508, -0.54106734, + 0.010977931, 0.86068895, 0.50901279, + 0.63359113, 0.38782749, -0.66944164}), + testTolerance); + + ASSERT_TRUE(rot.HasAngularVelocity()); + vector midAV = rot.AngularVelocity(); + EXPECT_PRED_FORMAT3(AssertVectorsNear, midAV, + (vector{-1.4107831e-05, -0.0011349124, -0.0006662493}), + testTolerance); + + // End time + rot.SetEphemerisTime(endTime); + + vector endCJ = rot.Matrix(); + EXPECT_PRED_FORMAT3(AssertVectorsNear, endCJ, + (vector{-0.61729588, 0.4060182, -0.67386573, + 0.010223693, 0.86060645, 0.50916796, + 0.78666465, 0.30741789, -0.53539982}), + testTolerance); + + EXPECT_TRUE(rot.HasAngularVelocity()); + vector endAV = rot.AngularVelocity(); + EXPECT_PRED_FORMAT3(AssertVectorsNear, endAV, + (vector{-1.2932496e-05, -0.0010747293, -0.00063276804}), + testTolerance); + + + // Cache it + rot.LoadCache(startTime, endTime, 10); + + // Check start again + rot.SetEphemerisTime(startTime); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), startCJ, testTolerance); + + ASSERT_TRUE(rot.HasAngularVelocity()); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.AngularVelocity(), startAV, testTolerance); + + // Check middle again + rot.SetEphemerisTime(startTime + (4 * (endTime - startTime) / 9)); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), midCJ, testTolerance); + + ASSERT_TRUE(rot.HasAngularVelocity()); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.AngularVelocity(), midAV, testTolerance); + + // Check end again + rot.SetEphemerisTime(endTime); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), endCJ, testTolerance); + + ASSERT_TRUE(rot.HasAngularVelocity()); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.AngularVelocity(), endAV, testTolerance); + + + // Fit polynomial + rot.SetPolynomial(); + + // Check start again + rot.SetEphemerisTime(startTime); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), + (vector{-0.87506744, 0.25462094, -0.41161286, + 0.011738947, 0.86135321, 0.5078709, + 0.48385863, 0.43958939, -0.75673113}), + testTolerance); + + ASSERT_TRUE(rot.HasAngularVelocity()); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.AngularVelocity(), + (vector{3.9588092e-05, -0.0011571406, -0.00066422493}), + testTolerance); + + // Check middle again + rot.SetEphemerisTime(startTime + (4 * (endTime - startTime) / 9)); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), + (vector{-0.77358897, 0.32991801, -0.54103069, + 0.010878267, 0.86056939, 0.50921703, + 0.63359432, 0.3880392, -0.66931593}), + testTolerance); + + ASSERT_TRUE(rot.HasAngularVelocity()); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.AngularVelocity(), + (vector{-2.8366393e-05, -0.0011306014, -0.00067058131}), + testTolerance); + + // Check end again + rot.SetEphemerisTime(endTime); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), + (vector{-0.61722064, 0.40639527, -0.67370733, + 0.0096837405, 0.86013226, 0.50997914, + 0.78673052, 0.30824564, -0.53482681}), + testTolerance); + + ASSERT_TRUE(rot.HasAngularVelocity()); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.AngularVelocity(), + (vector{3.8816777e-05, -0.0010934565, -0.00061098396}), + testTolerance); +} + + +TEST_F(SpiceRotationKernels, Nadir) { + SpiceRotation rot(frameCode, targetCode); + + rot.SetEphemerisTime(startTime); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), + (vector{-0.87397636, 0.25584047, -0.41317186, + 0.011529483, 0.86087973, 0.50867786, + 0.48583166, 0.43980876, -0.75533824}), + testTolerance); +} + + +TEST_F(SpiceRotationKernels, Pck) { + SpiceRotation ioRot(10023); // Use IO because it has nutation/precession + ioRot.LoadCache(-15839262.24291, -15839262.24291, 1); + + EXPECT_EQ(ioRot.getFrameType(), SpiceRotation::PCK); + + // These are angles so we can't use vector comparison + vector poleRa = ioRot.poleRaCoefs(); + EXPECT_EQ(poleRa.size(), 3); + EXPECT_NEAR(poleRa[0].degrees(), 268.05, testTolerance); + EXPECT_NEAR(poleRa[1].degrees(), -0.009, testTolerance); + EXPECT_NEAR(poleRa[2].degrees(), 0.0, testTolerance); + + vector poleDec = ioRot.poleDecCoefs(); + EXPECT_EQ(poleDec.size(), 3); + EXPECT_NEAR(poleDec[0].degrees(), 64.5, testTolerance); + EXPECT_NEAR(poleDec[1].degrees(), 0.003, testTolerance); + EXPECT_NEAR(poleDec[2].degrees(), 0.0, testTolerance); + + vector prMer = ioRot.pmCoefs(); + EXPECT_EQ(prMer.size(), 3); + EXPECT_NEAR(prMer[0].degrees(), 200.39, testTolerance); + EXPECT_NEAR(prMer[1].degrees(), 203.4889538, testTolerance); + EXPECT_NEAR(prMer[2].degrees(), 0.0, testTolerance); + + vector sysNutPrec0 = ioRot.sysNutPrecConstants(); + EXPECT_EQ(sysNutPrec0.size(), 15); + EXPECT_NEAR(sysNutPrec0[0].degrees(), 73.32, testTolerance); + EXPECT_NEAR(sysNutPrec0[1].degrees(), 24.62, testTolerance); + EXPECT_NEAR(sysNutPrec0[2].degrees(), 283.9, testTolerance); + EXPECT_NEAR(sysNutPrec0[3].degrees(), 355.8, testTolerance); + EXPECT_NEAR(sysNutPrec0[4].degrees(), 119.9, testTolerance); + EXPECT_NEAR(sysNutPrec0[5].degrees(), 229.8, testTolerance); + EXPECT_NEAR(sysNutPrec0[6].degrees(), 352.25, testTolerance); + EXPECT_NEAR(sysNutPrec0[7].degrees(), 113.35, testTolerance); + EXPECT_NEAR(sysNutPrec0[8].degrees(), 146.64, testTolerance); + EXPECT_NEAR(sysNutPrec0[9].degrees(), 49.24, testTolerance); + EXPECT_NEAR(sysNutPrec0[10].degrees(), 99.360714, testTolerance); + EXPECT_NEAR(sysNutPrec0[11].degrees(), 175.895369, testTolerance); + EXPECT_NEAR(sysNutPrec0[12].degrees(), 300.323162, testTolerance); + EXPECT_NEAR(sysNutPrec0[13].degrees(), 114.012305, testTolerance); + EXPECT_NEAR(sysNutPrec0[14].degrees(), 49.511251, testTolerance); + + vector sysNutPrec1 = ioRot.sysNutPrecCoefs(); + EXPECT_EQ(sysNutPrec1.size(), 15); + EXPECT_NEAR(sysNutPrec1[0].degrees(), 91472.9, testTolerance); + EXPECT_NEAR(sysNutPrec1[1].degrees(), 45137.2, testTolerance); + EXPECT_NEAR(sysNutPrec1[2].degrees(), 4850.7, testTolerance); + EXPECT_NEAR(sysNutPrec1[3].degrees(), 1191.3, testTolerance); + EXPECT_NEAR(sysNutPrec1[4].degrees(), 262.1, testTolerance); + EXPECT_NEAR(sysNutPrec1[5].degrees(), 64.3, testTolerance); + EXPECT_NEAR(sysNutPrec1[6].degrees(), 2382.6, testTolerance); + EXPECT_NEAR(sysNutPrec1[7].degrees(), 6070, testTolerance); + EXPECT_NEAR(sysNutPrec1[8].degrees(), 182945.8, testTolerance); + EXPECT_NEAR(sysNutPrec1[9].degrees(), 90274.4, testTolerance); + EXPECT_NEAR(sysNutPrec1[10].degrees(), 4850.4046, testTolerance); + EXPECT_NEAR(sysNutPrec1[11].degrees(), 1191.9605, testTolerance); + EXPECT_NEAR(sysNutPrec1[12].degrees(), 262.5475, testTolerance); + EXPECT_NEAR(sysNutPrec1[13].degrees(), 6070.2476, testTolerance); + EXPECT_NEAR(sysNutPrec1[14].degrees(), 64.3, testTolerance); + + // These are doubles so we can use vector comparison + EXPECT_PRED_FORMAT3(AssertVectorsNear, ioRot.poleRaNutPrecCoefs(), + (vector{0.0, 0.0, 0.094, 0.024, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0}), + testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, ioRot.poleDecNutPrecCoefs(), + (vector{0.0, 0.0, 0.04, 0.011, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0}), + testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, ioRot.pmNutPrecCoefs(), + (vector{0.0, 0.0, -0.085, -0.022, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0}), + testTolerance); +} + + +TEST_F(SpiceRotationIsd, FromALE) { + // Test with just a time dependent rotation + SpiceRotation aleQuatRot(-94031); + aleQuatRot.LoadCache(isd); + + EXPECT_EQ(aleQuatRot.getFrameType(), SpiceRotation::CK); + EXPECT_TRUE(aleQuatRot.IsCached()); + EXPECT_FALSE(aleQuatRot.HasAngularVelocity()); + + vector timeDepChain = aleQuatRot.TimeFrameChain(); + EXPECT_EQ(timeDepChain.size(), 3); + EXPECT_EQ(timeDepChain[0], -94031); + EXPECT_EQ(timeDepChain[1], 10014); + EXPECT_EQ(timeDepChain[2], 1); + + aleQuatRot.SetEphemerisTime(0.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, aleQuatRot.Matrix(), + (vector{-1.0, 0.0, 0.0, + 0.0, -1.0, 0.0, + 0.0, 0.0, 1.0}), + testTolerance); + + aleQuatRot.SetEphemerisTime(1.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, aleQuatRot.Matrix(), + (vector{0.0, 1.0, 0.0, + -1.0, 0.0, 0.0, + 0.0, 0.0, 1.0}), + testTolerance); + + aleQuatRot.SetEphemerisTime(2.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, aleQuatRot.Matrix(), + (vector{0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, + 0.0, 0.0, -1.0}), + testTolerance); + + aleQuatRot.SetEphemerisTime(3.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, aleQuatRot.Matrix(), + (vector{0.0, 0.0, -1.0, + -1.0, 0.0, 0.0, + 0.0, 1.0, 0.0}), + testTolerance); + + + // Test with angular velocity + SpiceRotation aleQuatAVRot(-94031); + aleQuatAVRot.LoadCache(isdAv); + + ASSERT_TRUE(aleQuatAVRot.HasAngularVelocity()); + + aleQuatAVRot.SetEphemerisTime(0.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, aleQuatAVRot.AngularVelocity(), + (vector{-Isis::PI / 2.0, 0.0, 0.0}), testTolerance); + + aleQuatAVRot.SetEphemerisTime(1.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, aleQuatAVRot.AngularVelocity(), + (vector{0.0, Isis::PI, 0.0}), testTolerance); + + aleQuatAVRot.SetEphemerisTime(2.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, aleQuatAVRot.AngularVelocity(), + (vector{0.0, 0.0, Isis::PI / 2.0}), testTolerance);; + + aleQuatAVRot.SetEphemerisTime(3.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, aleQuatAVRot.AngularVelocity(), + (vector{0.0, 0.0, Isis::PI / 2.0}), testTolerance); + + + // Test with a constant rotation + SpiceRotation aleQuatConstRot(-94031); + aleQuatConstRot.LoadCache(isdConst); + + vector constChain = aleQuatConstRot.ConstantFrameChain(); + EXPECT_EQ(constChain.size(), 2); + EXPECT_EQ(constChain[0], -94031); + EXPECT_EQ(constChain[1], -94030); + + aleQuatConstRot.SetEphemerisTime(0.0); + aleQuatRot.SetEphemerisTime(0.0); + vector oldCJ = aleQuatRot.Matrix(); + // The constant rotation should swap Y and Z + EXPECT_PRED_FORMAT3(AssertVectorsNear, aleQuatConstRot.Matrix(), + (vector{oldCJ[0], oldCJ[1], oldCJ[2], + oldCJ[6], oldCJ[7], oldCJ[8], + oldCJ[3], oldCJ[4], oldCJ[5]}), + testTolerance); + + aleQuatConstRot.SetEphemerisTime(1.0); + aleQuatRot.SetEphemerisTime(1.0); + oldCJ = aleQuatRot.Matrix(); + EXPECT_PRED_FORMAT3(AssertVectorsNear, aleQuatConstRot.Matrix(), + (vector{oldCJ[0], oldCJ[1], oldCJ[2], + oldCJ[6], oldCJ[7], oldCJ[8], + oldCJ[3], oldCJ[4], oldCJ[5]}), + testTolerance); + + aleQuatConstRot.SetEphemerisTime(2.0); + aleQuatRot.SetEphemerisTime(2.0); + oldCJ = aleQuatRot.Matrix(); + EXPECT_PRED_FORMAT3(AssertVectorsNear, aleQuatConstRot.Matrix(), + (vector{oldCJ[0], oldCJ[1], oldCJ[2], + oldCJ[6], oldCJ[7], oldCJ[8], + oldCJ[3], oldCJ[4], oldCJ[5]}), + testTolerance); + + aleQuatConstRot.SetEphemerisTime(3.0); + aleQuatRot.SetEphemerisTime(3.0); + oldCJ = aleQuatRot.Matrix(); + EXPECT_PRED_FORMAT3(AssertVectorsNear, aleQuatConstRot.Matrix(), + (vector{oldCJ[0], oldCJ[1], oldCJ[2], + oldCJ[6], oldCJ[7], oldCJ[8], + oldCJ[3], oldCJ[4], oldCJ[5]}), + testTolerance); +} + + +TEST_F(SpiceRotationIsd, Cache) { + SpiceRotation rot(-94031); + rot.LoadCache(isd); + Table rotTable = rot.Cache("TestCache"); + + SpiceRotation newRot(-94031); + newRot.LoadCache(rotTable); + + rot.SetEphemerisTime(0.0); + newRot.SetEphemerisTime(0.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), newRot.Matrix(), testTolerance); + + rot.SetEphemerisTime(1.0); + newRot.SetEphemerisTime(1.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), newRot.Matrix(), testTolerance); + + rot.SetEphemerisTime(2.0); + newRot.SetEphemerisTime(2.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), newRot.Matrix(), testTolerance); + + rot.SetEphemerisTime(3.0); + newRot.SetEphemerisTime(3.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), newRot.Matrix(), testTolerance); +} + + +TEST_F(SpiceRotationIsd, LineCache) { + SpiceRotation polyRot(-94031); + polyRot.LoadCache(isd); + polyRot.ComputeBaseTime(); + polyRot.SetPolynomialDegree(1); + // The base time is set to 1.5, and the time scale is set to 1.5 so these + // coefficients are scaled accordingly. The unscaled equations are: + // angle1 = -pi/2 + pi/2 * t + // angle2 = -pi + pi/2 * t + // angle3 = pi - pi/2 * t + // + // Note ISIS defaults to ZXZ rotation axis order + vector angle1Coeffs = {Isis::PI / 4.0, 3.0 * Isis::PI / 4.0}; + vector angle2Coeffs = {-Isis::PI / 4.0, 3.0 * Isis::PI / 4.0}; + vector angle3Coeffs = {Isis::PI / 4.0, -3.0 * Isis::PI / 4.0}; + polyRot.SetPolynomial(angle1Coeffs, angle2Coeffs, angle3Coeffs, SpiceRotation::PolyFunction); + + // LineCache converts the SpiceRotation from a polynomial into a cache so save off these now + polyRot.SetEphemerisTime(0.0); + vector cj0 = polyRot.Matrix(); + + polyRot.SetEphemerisTime(1.0); + vector cj1 = polyRot.Matrix(); + + polyRot.SetEphemerisTime(2.0); + vector cj2 = polyRot.Matrix(); + + polyRot.SetEphemerisTime(3.0); + vector cj3 = polyRot.Matrix(); + + Table rotTable = polyRot.LineCache("TestCache"); + SpiceRotation newRot(-94031); + newRot.LoadCache(rotTable); + + polyRot.SetEphemerisTime(0.0); + newRot.SetEphemerisTime(0.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, polyRot.Matrix(), cj0, testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, newRot.Matrix(), cj0, testTolerance); + + polyRot.SetEphemerisTime(1.0); + newRot.SetEphemerisTime(1.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, polyRot.Matrix(), cj1, testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, newRot.Matrix(), cj1, testTolerance); + + polyRot.SetEphemerisTime(2.0); + newRot.SetEphemerisTime(2.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, polyRot.Matrix(), cj2, testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, newRot.Matrix(), cj2, testTolerance); + + polyRot.SetEphemerisTime(3.0); + newRot.SetEphemerisTime(3.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, polyRot.Matrix(), cj3, testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, newRot.Matrix(), cj3, testTolerance); +} + +TEST_F(SpiceRotationIsd, PolyCache) { + SpiceRotation polyRot(-94031); + polyRot.LoadCache(isd); + polyRot.ComputeBaseTime(); + polyRot.SetPolynomialDegree(1); + // The base time is set to 1.5, and the time scale is set to 1.5 so these + // coefficients are scaled accordingly. The unscaled equations are: + // angle1 = -pi/2 + pi/2 * t + // angle2 = -pi + pi/2 * t + // angle3 = pi - pi/2 * t + // + // Note ISIS defaults to ZXZ rotation axis order + vector angle1Coeffs = {Isis::PI / 4.0, 3.0 * Isis::PI / 4.0}; + vector angle2Coeffs = {-Isis::PI / 4.0, 3.0 * Isis::PI / 4.0}; + vector angle3Coeffs = {Isis::PI / 4.0, -3.0 * Isis::PI / 4.0}; + polyRot.SetPolynomial(angle1Coeffs, angle2Coeffs, angle3Coeffs, SpiceRotation::PolyFunction); + + Table rotTable = polyRot.Cache("TestCache"); + SpiceRotation newRot(-94031); + newRot.LoadCache(rotTable); + + EXPECT_EQ(polyRot.GetSource(), newRot.GetSource()); + EXPECT_NEAR(polyRot.GetBaseTime(), newRot.GetBaseTime(), testTolerance); + EXPECT_NEAR(polyRot.GetTimeScale(), newRot.GetTimeScale(), testTolerance); + + polyRot.SetEphemerisTime(0.0); + newRot.SetEphemerisTime(0.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, polyRot.Matrix(), newRot.Matrix(), testTolerance); + + polyRot.SetEphemerisTime(1.0); + newRot.SetEphemerisTime(1.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, polyRot.Matrix(), newRot.Matrix(), testTolerance); + + polyRot.SetEphemerisTime(2.0); + newRot.SetEphemerisTime(2.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, polyRot.Matrix(), newRot.Matrix(), testTolerance); + + polyRot.SetEphemerisTime(3.0); + newRot.SetEphemerisTime(3.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, polyRot.Matrix(), newRot.Matrix(), testTolerance); +} + + +TEST_F(SpiceRotationIsd, PolyOverCache) { + SpiceRotation rot(-94031); + rot.LoadCache(isd); + rot.ComputeBaseTime(); + rot.SetPolynomialDegree(1); + // The base time is set to 1.5, and the time scale is set to 1.5 so these + // coefficients are scaled to be -90 at 0, 0 at 1, 90 at 2, and 180 at 3. + vector angle1Coeffs = {Isis::PI / 4, 3 * Isis::PI / 4}; + vector angle2Coeffs = {0.0, 0.0}; + vector angle3Coeffs = {0.0, 0.0}; + rot.SetPolynomial(angle1Coeffs, angle2Coeffs, angle3Coeffs, SpiceRotation::PolyFunctionOverSpice); + + rot.SetEphemerisTime(0.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), + (vector{0.0, 1.0, 0.0, + -1.0, 0.0, 0.0, + 0.0, 0.0, 1.0}), + testTolerance); + + rot.SetEphemerisTime(1.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), + (vector{0.0, 1.0, 0.0, + -1.0, 0.0, 0.0, + 0.0, 0.0, 1.0}), + testTolerance); + + rot.SetEphemerisTime(2.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), + (vector{-1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, -1.0}), + testTolerance); + + rot.SetEphemerisTime(3.0); + EXPECT_PRED_FORMAT3(AssertVectorsNear, rot.Matrix(), + (vector{0.0, 0.0, -1.0, + 1.0, 0.0, 0.0, + 0.0, -1.0, 0.0}), + testTolerance); +} + + +TEST_F(SpiceRotationIsd, VectorRotation) { + SpiceRotation rot(-94031); + rot.LoadCache(isd); + + vector unitX = {1.0, 0.0, 0.0}; + vector unitY = {0.0, 1.0, 0.0}; + vector unitZ = {0.0, 0.0, 1.0}; + + rot.SetEphemerisTime(1.0); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.J2000Vector(unitX), + unitY, testTolerance); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.J2000Vector(unitY), + (vector{-1.0, 0.0, 0.0}), testTolerance); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.J2000Vector(unitZ), + unitZ, testTolerance); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ReferenceVector(unitX), + (vector{0.0, -1.0, 0.0}), testTolerance); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ReferenceVector(unitY), + unitX, testTolerance); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ReferenceVector(unitZ), + unitZ, testTolerance); +} + + +TEST_F(SpiceRotationIsd, PolynomialPartials) { + SpiceRotation rot(-94031); + rot.LoadCache(isd); + rot.ComputeBaseTime(); + rot.SetPolynomialDegree(1); + // The base time is set to 1.5, and the time scale is set to 1.5 so these + // coefficients are scaled accordingly. The unscaled equations are: + // angle1 = -pi/2 + pi/2 * t + // angle2 = -pi + pi/2 * t + // angle3 = pi - pi/2 * t + // + // Note ISIS defaults to ZXZ rotation axis order + vector angle1Coeffs = {Isis::PI / 4.0, 3.0 * Isis::PI / 4.0}; + vector angle2Coeffs = {-Isis::PI / 4.0, 3.0 * Isis::PI / 4.0}; + vector angle3Coeffs = {Isis::PI / 4.0, -3.0 * Isis::PI / 4.0}; + rot.SetPolynomial(angle1Coeffs, angle2Coeffs, angle3Coeffs, SpiceRotation::PolyFunction); + + // At t = 1.0, the angles are: + // angle1 = 0.0 + // angle2 = -pi/2 + // angle3 = pi/2 + rot.SetEphemerisTime(1.0); + + // Test each unit vector which should map to the columns of the jacobian for + // ToReferencePartial and the rows of the Jacobian for ToJ2000Partial. + // + // For the linear coefficient the Jacobian is multiplied by scaled_t = -1 / 3. + vector unitX = {1.0, 0.0, 0.0}; + vector unitY = {0.0, 1.0, 0.0}; + vector unitZ = {0.0, 0.0, 1.0}; + + // Partials wrt angle 1 + // Jacobian matrix is + // 0 0 0 + // 0 -1 0 + // -1 0 0 + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitX, SpiceRotation::WRT_RightAscension, 0), + (vector{0.0, 0.0, -1.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitX, SpiceRotation::WRT_RightAscension, 1), + (vector{0.0, 0.0, 1.0 / 3.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitX, SpiceRotation::WRT_RightAscension, 0), + (vector{0.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitX, SpiceRotation::WRT_RightAscension, 1), + (vector{0.0, 0.0, 0.0}), testTolerance); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitY, SpiceRotation::WRT_RightAscension, 0), + (vector{0.0, -1.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitY, SpiceRotation::WRT_RightAscension, 1), + (vector{0.0, 1.0 / 3.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitY, SpiceRotation::WRT_RightAscension, 0), + (vector{0.0, -1.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitY, SpiceRotation::WRT_RightAscension, 1), + (vector{0.0, 1.0 / 3.0, 0.0}), testTolerance); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitZ, SpiceRotation::WRT_RightAscension, 0), + (vector{0.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitZ, SpiceRotation::WRT_RightAscension, 1), + (vector{0.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitZ, SpiceRotation::WRT_RightAscension, 0), + (vector{-1.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitZ, SpiceRotation::WRT_RightAscension, 1), + (vector{1.0 / 3.0, 0.0, 0.0}), testTolerance); + + + // Partials wrt angle 2 + // Jacobian matrix is + // 0 -1 0 + // 0 0 0 + // 0 0 -1 + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitX, SpiceRotation::WRT_Declination, 0), + (vector{0.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitX, SpiceRotation::WRT_Declination, 1), + (vector{0.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitX, SpiceRotation::WRT_Declination, 0), + (vector{0.0, -1.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitX, SpiceRotation::WRT_Declination, 1), + (vector{0.0, 1.0 / 3.0, 0.0}), testTolerance); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitY, SpiceRotation::WRT_Declination, 0), + (vector{-1.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitY, SpiceRotation::WRT_Declination, 1), + (vector{1.0 / 3.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitY, SpiceRotation::WRT_Declination, 0), + (vector{0.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitY, SpiceRotation::WRT_Declination, 1), + (vector{0.0, 0.0, 0.0}), testTolerance); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitZ, SpiceRotation::WRT_Declination, 0), + (vector{0.0, 0.0, -1.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitZ, SpiceRotation::WRT_Declination, 1), + (vector{0.0, 0.0, 1.0 / 3.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitZ, SpiceRotation::WRT_Declination, 0), + (vector{0.0, 0.0, -1.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitZ, SpiceRotation::WRT_Declination, 1), + (vector{0.0, 0.0, 1.0 / 3.0}), testTolerance); + + + // Partials wrt angle 3 + // Jacobian matrix is + // -1 0 0 + // 0 0 1 + // 0 0 0 + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitX, SpiceRotation::WRT_Twist, 0), + (vector{-1.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitX, SpiceRotation::WRT_Twist, 1), + (vector{1.0 / 3.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitX, SpiceRotation::WRT_Twist, 0), + (vector{-1.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitX, SpiceRotation::WRT_Twist, 1), + (vector{1.0 / 3.0, 0.0, 0.0}), testTolerance); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitY, SpiceRotation::WRT_Twist, 0), + (vector{0.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitY, SpiceRotation::WRT_Twist, 1), + (vector{0.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitY, SpiceRotation::WRT_Twist, 0), + (vector{0.0, 0.0, 1.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitY, SpiceRotation::WRT_Twist, 1), + (vector{0.0, 0.0, -1.0 / 3.0}), testTolerance); + + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitZ, SpiceRotation::WRT_Twist, 0), + (vector{0.0, 1.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.ToReferencePartial(unitZ, SpiceRotation::WRT_Twist, 1), + (vector{0.0, -1.0 / 3.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitZ, SpiceRotation::WRT_Twist, 0), + (vector{0.0, 0.0, 0.0}), testTolerance); + EXPECT_PRED_FORMAT3(AssertVectorsNear, + rot.toJ2000Partial(unitZ, SpiceRotation::WRT_Twist, 1), + (vector{0.0, 0.0, 0.0}), testTolerance); +} + +TEST(SpiceRotation, WrapAngle) { + SpiceRotation rot(-94031); + + EXPECT_NEAR(rot.WrapAngle(Isis::PI / 6.0, 4.0 * Isis::PI / 3.0), + -2.0 * Isis::PI / 3.0, testTolerance); + EXPECT_NEAR(rot.WrapAngle(Isis::PI / 6.0, -1.0 * Isis::PI / 18.0), + -1.0 * Isis::PI / 18.0, testTolerance); + EXPECT_NEAR(rot.WrapAngle(Isis::PI / 6.0, -1.0 * Isis::PI), + Isis::PI, testTolerance); + EXPECT_NEAR(rot.WrapAngle(Isis::PI / 6.0, Isis::PI / 2.0), + Isis::PI / 2.0, testTolerance); +} diff --git a/isis/tests/TestUtilities.cpp b/isis/tests/TestUtilities.cpp index d95fa9cfac..8ce86f757a 100644 --- a/isis/tests/TestUtilities.cpp +++ b/isis/tests/TestUtilities.cpp @@ -110,4 +110,43 @@ namespace Isis { return ::testing::AssertionSuccess(); } + + /** + * Asserts that two vectors are within a given tolerance of each other. + * If the vectors are not the same size, then they are not assumed to be equal. + * The difference between two vectors is the maximum elementwise difference, + * the infinity norm. + */ + ::testing::AssertionResult AssertVectorsNear( + const char* vec1_expr, + const char* vec2_expr, + const char* tolerance_expr, + const std::vector &vec1, + const std::vector &vec2, + double tolerance) { + if (vec1.size() != vec2.size()) { + return ::testing::AssertionFailure() << "Vector " << vec1_expr + << " and Vector " << vec2_expr << " have different sizes " + << vec1.size() << " and " << vec2.size() << "."; + } + std::vector differences; + for (size_t i = 0; i < vec1.size(); i++) { + if (abs(vec1[i] - vec2[i]) > tolerance) { + differences.push_back(i); + } + } + if (differences.empty()) { + return ::testing::AssertionSuccess(); + } + ::testing::AssertionResult failure = ::testing::AssertionFailure() + << "Vector " << vec1_expr << " and Vector " << vec2_expr + << " differ by more than tolerance " << tolerance_expr + << " which evaluates to " << tolerance << ".\n"; + for (size_t &index : differences) { + failure = failure << " Index: " << index << " values: " + << vec1[index] << " and " << vec2[index] << ".\n"; + } + return failure; + } + } diff --git a/isis/tests/TestUtilities.h b/isis/tests/TestUtilities.h index 35c9108634..84df1255aa 100644 --- a/isis/tests/TestUtilities.h +++ b/isis/tests/TestUtilities.h @@ -4,6 +4,7 @@ #include "gtest/gtest.h" #include +#include #include @@ -39,6 +40,14 @@ namespace Isis { PvlGroup group1, PvlGroup group2); + ::testing::AssertionResult AssertVectorsNear( + const char* vec1_expr, + const char* vec2_expr, + const char* tolerance_expr, + const std::vector &vec1, + const std::vector &vec2, + double tolerance); + } #endif