diff --git a/function-tracker.md b/function-tracker.md index 07eb17e..96d74bf 100644 --- a/function-tracker.md +++ b/function-tracker.md @@ -227,7 +227,7 @@ * [ ] [GETCML_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getcml_c.html) - Get the command line * [ ] [GETELM_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getelm_c.html) - Get the components from two-line elements * [ ] [GETFAT_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getfat_c.html) - Get file architecture and type -* [ ] [GETFOV_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getfov_c.html) - Get instrument FOV parameters +* [x] [GETFOV_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getfov_c.html) - Get instrument FOV parameters * [ ] [GETMSG_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getmsg_c.html) - Get Error Message * [ ] [GFBAIL_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfbail_c.html) - GF, interrupt signal indicator * [ ] [GFCLRH_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfclrh_c.html) - GF, clear interrupt signal handler status @@ -483,7 +483,7 @@ * [ ] [SHELLD_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/shelld_c.html) - Shell sort a double precision array * [ ] [SHELLI_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/shelli_c.html) - Shell sort an integer array * [ ] [SIGERR_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/sigerr_c.html) - Signal Error Condition -* [ ] [SINCPT_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/sincpt_c.html) - Surface intercept +* [x] [SINCPT_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/sincpt_c.html) - Surface intercept * [ ] [SIZE_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/size_c.html) - Size of a cell * [ ] [SPD_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spd_c.html) - Seconds per day * [ ] [SPHCYL_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/sphcyl_c.html) - Spherical to cylindrical coordinates @@ -552,9 +552,9 @@ * [ ] [SUMAD_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/sumad_c.html) - Sum of a double precision array * [ ] [SUMAI_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/sumai_c.html) - Sum of an integer array * [ ] [SURFNM_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/surfnm_c.html) - Surface normal vector on an ellipsoid -* [ ] [SURFPT_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/surfpt_c.html) - Surface point on an ellipsoid +* [x] [SURFPT_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/surfpt_c.html) - Surface point on an ellipsoid * [ ] [SURFPV_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/surfpv_c.html) - Surface point and velocity -* [ ] [SWPOOL_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/swpool_c.html) - Set watch on a pool variable +* [x] [SWPOOL_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/swpool_c.html) - Set watch on a pool variable * [ ] [SXFORM_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/sxform_c.html) - State Transformation Matrix * [ ] [SZPOOL_C](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/szpool_c.html) - Get size limitations of the kernel pool diff --git a/src/r.jl b/src/r.jl index 32fc85a..9a6589e 100644 --- a/src/r.jl +++ b/src/r.jl @@ -1,4 +1,4 @@ -export +export rav2xf, reclat, recpgr, @@ -28,8 +28,8 @@ function rav2xf(rot, av) xform = Array{SpiceDouble}(undef, 6, 6) ccall((:rav2xf_c, libcspice), Cvoid, (Ptr{SpiceDouble}, Ptr{SpiceDouble}, Ptr{SpiceDouble}), - rot, av, xform) - xform + permutedims(rot), av, xform) + permutedims(xform) end """ @@ -99,10 +99,10 @@ end """ rotate(angle, iaxis) -Calculate the 3x3 rotation matrix generated by a rotation -of a specified angle about a specified axis. This rotation -is thought of as rotating the coordinate system. - +Calculate the 3x3 rotation matrix generated by a rotation +of a specified angle about a specified axis. This rotation +is thought of as rotating the coordinate system. + ### Arguments ### - `angle`: Angle of rotation (radians) @@ -127,7 +127,7 @@ end Convert rectangular coordinates to range, right ascension, and declination. - + ### Arguments ### - `rectan`: Rectangular coordinates of a point diff --git a/src/x.jl b/src/x.jl index efb60ec..4449ae5 100644 --- a/src/x.jl +++ b/src/x.jl @@ -28,6 +28,7 @@ that indicates whether these are a unique representation. - [NAIF Documentation](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/xf2eul_c.html) """ function xf2eul(xform, axisa, axisb, axisc) + size(xform) != (6, 6) && throw(ArgumentError("`xform` must be a 6x6 matrix.")) eulang = Array{SpiceDouble}(undef, 6) unique = Ref{SpiceBoolean}() ccall((:xf2eul_c, libcspice), Cvoid, @@ -57,12 +58,13 @@ associated with `xform`. - [NAIF Documentation](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/xf2rav_c.html) """ function xf2rav(xform) + size(xform) != (6, 6) && throw(ArgumentError("`xform` must be a 6x6 matrix.")) rot = Array{SpiceDouble}(undef, 3, 3) av = Array{SpiceDouble}(undef, 3) ccall((:xf2rav_c, libcspice), Cvoid, (Ptr{SpiceDouble}, Ptr{SpiceDouble}, Ptr{SpiceDouble}), - xform, rot, av) - rot, av + permutedims(xform), rot, av) + permutedims(rot), av end """ @@ -86,6 +88,7 @@ Returns the converted output state. - [NAIF Documentation](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/xfmsta_c.html) """ function xfmsta(input_state, input_coord_sys, output_coord_sys, body) + length(input_state) != 6 && throw(ArgumentError("Lenght of `input_state` must be 6.")) output_state = Array{SpiceDouble}(undef, 6) ccall((:xfmsta_c, libcspice), Cvoid, (Ptr{SpiceDouble}, Cstring, Cstring, Cstring, Ptr{SpiceDouble}), diff --git a/test/r.jl b/test/r.jl index 53052a5..9dc4429 100644 --- a/test/r.jl +++ b/test/r.jl @@ -1,54 +1,256 @@ -@testset "R" begin - @testset "rotate" begin - act = rotate(π/4, 3) - exp = [sqrt(2)/2.0 sqrt(2)/2.0 0.0; - -sqrt(2)/2.0 sqrt(2)/2.0 0.0; - 0.0 0.0 1.0] - @testset for i in eachindex(act, exp) - @test act[i] ≈ exp[i] +@testset "R" begin +#= @testset "radrec" begin =# +#= npt.assert_array_almost_equal([1.0, 0.0, 0.0], radrec(1.0, 0.0, 0.0)) =# +#= npt.assert_array_almost_equal([0.0, 1.0, 0.0], radrec(1.0, 90.0 * rpd(), 0.0)) =# +#= npt.assert_array_almost_equal([0.0, 0.0, 1.0], radrec(1.0, 0.0, 90.0 * rpd())) =# +#= =# +#= =# + @testset "rav2xf" begin + e = [1.0, 0.0, 0.0] + rz = [0.0 1.0 0.0; -1.0 0.0 0.0; 0.0 0.0 1.0] + exp = [0.0 1.0 0.0 0.0 0.0 0.0; + -1.0 0.0 0.0 0.0 0.0 0.0; + 0.0 0.0 1.0 0.0 0.0 0.0; + 0.0 0.0 1.0 0.0 1.0 0.0; + 0.0 0.0 0.0 -1.0 0.0 0.0; + 0.0 -1.0 0.0 0.0 0.0 1.0] + act = rav2xf(rz, e) + @testset for i in eachindex(exp, act) + @test exp[i] ≈ act[i] + end + end +#= @testset "raxisa" begin =# +#= axis = [1.0, 2.0, 3.0] =# +#= angle = 0.1 * twopi() =# +#= rotate_matrix = axisar(axis, angle) =# +#= axout, angout = raxisa(rotate_matrix) =# +#= expectedAngout = [0.26726124, 0.53452248, 0.80178373] =# +#= npt.assert_approx_equal(angout, 0.62831853, significant=7) =# +#= npt.assert_array_almost_equal(axout, expectedAngout) =# +#= =# +#= =# +#= @testset "reccyl" begin =# +#= expected1 = array([0.0, 0.0, 0.0]) =# +#= expected2 = array([1.0, 90.0 * rpd(), 0.0]) =# +#= expected3 = array([1.0, 270.0 * rpd(), 0.0]) =# +#= npt.assert_array_almost_equal(expected1, reccyl([0.0, 0.0, 0.0]), decimal=7) =# +#= npt.assert_array_almost_equal(expected2, reccyl([0.0, 1.0, 0.0]), decimal=7) =# +#= npt.assert_array_almost_equal(expected3, reccyl([0.0, -1.0, 0.0]), decimal=7) =# +#= =# +#= =# +#= @testset "recgeo" begin =# +#= kclear() =# +#= furnsh(CoreKernels.testMetaKernel) =# +#= num_vals, radii = bodvrd("EARTH", "RADII", 3) =# +#= flat = (radii[0] - radii[2]) / radii[0] =# +#= x = [-2541.748162, 4780.333036, 3360.428190] =# +#= lon, lat, alt = recgeo(x, radii[0], flat) =# +#= actual = [lon * dpr(), lat * dpr(), alt] =# +#= expected = [118.000000, 32.000000, 0.001915518] =# +#= npt.assert_array_almost_equal(actual, expected, decimal=4) =# +#= kclear() =# +#= =# +#= =# + @testset "reclat" begin + act1 = reclat([1.0, 0.0, 0.0]) + act2 = reclat([0.0, 1.0, 0.0]) + act3 = reclat((-1.0, 0.0, 0.0)) + @test [act1[1], act1[2], act1[3]] ≈ [1.0, 0.0, 0.0] + @test [act2[1], act2[2], act2[3]] ≈ [1.0, deg2rad(90.0), 0.0] + @test [act3[1], act3[2], act3[3]] ≈ [1.0, deg2rad(180.0), 0.0] + end + @testset "recpgr" begin + try + furnsh(path(CORE, :lsk), path(CORE, :pck), path(CORE, :spk)) + radii = bodvrd("MARS", "RADII", 3) + flat = (radii[1] - radii[3]) / radii[1] + x = [0.0, -2620.678914818178, 2592.408908856967] + lon, lat, alt = recpgr("MARS", x, radii[1], flat) + actual = [rad2deg(lon), rad2deg(lat), alt] + expected = [90., 45, 300] + @test actual ≈ expected + finally + kclear() end end @testset "recrad" begin act1 = collect(recrad([1.0, 0.0, 0.0])) act2 = collect(recrad([0.0, 1.0, 0.0])) act3 = collect(recrad([0.0, 0.0, 1.0])) - exp1=[1.0, 0.0, 0.0] + exp1 = [1.0, 0.0, 0.0] @testset for i in eachindex(act1, exp1) @test act1[i] ≈ exp1[i] end - exp2=[1.0, deg2rad(90), 0.0] + exp2 = [1.0, deg2rad(90), 0.0] @testset for i in eachindex(act2, exp2) @test act2[i] ≈ exp2[i] end - exp3=[1.0, 0.0, deg2rad(90)] + exp3 = [1.0, 0.0, deg2rad(90)] @testset for i in eachindex(act3, exp3) @test act3[i] ≈ exp3[i] end end - @testset "recpgr" begin - try - furnsh( - path(CORE, :lsk), - path(CORE, :pck), - path(CORE, :spk), - ) - radii = bodvrd("MARS", "RADII", 3) - flat = (radii[1] - radii[3])/ radii[1] - x = [0.0, -2620.678914818178, 2592.408908856967] - lon, lat, alt = recpgr("mars", x, radii[1], flat) - actual = [rad2deg(lon), rad2deg(lat), alt] - expected = [90., 45, 300] - @test actual ≈ expected - finally - kclear() +#= @testset "recsph" begin =# +#= v1 = array([-1.0, 0.0, 0.0]) =# +#= assert recsph(v1) == (1.0, pi/2, pi) =# +#= =# +#= =# +#= @testset "removc" begin =# +#= cell = cell_char(10, 10) =# +#= items = ["one", "two", "three", "four"] =# +#= for i in items: =# +#= insrtc(i, cell) =# +#= removeItems = ["three", "four"] =# +#= for r in removeItems: =# +#= removc(r, cell) =# +#= expected = ["one", "two"] =# +#= assert expected == [x for x in cell] =# +#= =# +#= =# +#= @testset "removd" begin =# +#= cell = cell_double(10) =# +#= items = [0.0, 1.0, 1.0, 2.0, 3.0, 5.0, 8.0, 13.0, 21.0] =# +#= for i in items: =# +#= insrtd(i, cell) =# +#= removeItems = [0.0, 2.0, 4.0, 6.0, 8.0, 12.0] =# +#= for r in removeItems: =# +#= removd(r, cell) =# +#= expected = [1.0, 3.0, 5.0, 13.0, 21.0] =# +#= for x, y in zip(cell, expected): =# +#= assert x == y =# +#= =# +#= =# +#= @testset "removi" begin =# +#= cell = cell_int(10) =# +#= items = [0, 1, 1, 2, 3, 5, 8, 13, 21] =# +#= for i in items: =# +#= insrti(i, cell) =# +#= removeItems = [0, 2, 4, 6, 8, 12] =# +#= for r in removeItems: =# +#= removi(r, cell) =# +#= expected = [1, 3, 5, 13, 21] =# +#= for x, y in zip(cell, expected): =# +#= assert x == y =# +#= =# +#= =# +#= @testset "reordc" begin =# +#= array = ["one", "three", "two", "zero"] =# +#= iorder = [3, 0, 2, 1] =# +#= outarray = reordc(iorder, 4, 5, array) =# +#= # reordc appears to be broken... =# +#= with pytest.raises(AssertionError): =# +#= assert outarray == ["zero", "one", "two", "three"] =# +#= =# +#= @testset "reordd" begin =# +#= array = [1.0, 3.0, 2.0] =# +#= iorder = [0, 2, 1] =# +#= outarray = reordd(iorder, 3, array) =# +#= npt.assert_array_almost_equal(outarray, [1.0, 2.0, 3.0]) =# +#= =# +#= =# +#= @testset "reordi" begin =# +#= array = [1, 3, 2] =# +#= iorder = [0, 2, 1] =# +#= outarray = reordi(iorder, 3, array) =# +#= npt.assert_array_almost_equal(outarray, [1, 2, 3]) =# +#= =# +#= =# +#= @testset "reordl" begin =# +#= array = [True, True, False] =# +#= iorder = [0, 2, 1] =# +#= outarray = reordl(iorder, 3, array) =# +#= npt.assert_array_almost_equal(outarray, [True, False, True]) =# +#= =# +#= =# +#= @testset "repmc" begin =# +#= stringtestone = "The truth is #" =# +#= outstringone = repmc(stringtestone, "#", "SPICE") =# +#= assert outstringone == "The truth is SPICE" =# +#= =# +#= =# +#= @testset "repmct" begin =# +#= stringtestone = "The value is #" =# +#= outstringone = repmct(stringtestone, '#', 5, 'U') =# +#= outstringtwo = repmct(stringtestone, '#', 5, 'l') =# +#= assert outstringone == "The value is FIVE" =# +#= assert outstringtwo == "The value is five" =# +#= =# +#= =# +#= @testset "repmd" begin =# +#= stringtestone = "The value is #" =# +#= outstringone = repmd(stringtestone, '#', 5.0e11, 1) =# +#= assert outstringone == "The value is 5.E+11" =# +#= =# +#= =# +#= @testset "repmf" begin =# +#= stringtestone = "The value is #" =# +#= outstringone = repmf(stringtestone, '#', 5.0e3, 5, 'f') =# +#= outstringtwo = repmf(stringtestone, '#', -5.2e-9, 3, 'e') =# +#= assert outstringone == "The value is 5000.0" =# +#= assert outstringtwo == "The value is -5.20E-09" =# +#= =# +#= =# +#= @testset "repmi" begin =# +#= stringtest = "The value is " =# +#= outstring = repmi(stringtest, "", 5) =# +#= assert outstring == "The value is 5" =# +#= =# +#= =# +#= @testset "repmot" begin =# +#= stringtestone = "The value is #" =# +#= outstringone = repmot(stringtestone, '#', 5, 'U') =# +#= outstringtwo = repmot(stringtestone, '#', 5, 'l') =# +#= assert outstringone == "The value is FIFTH" =# +#= assert outstringtwo == "The value is fifth" =# +#= =# +#= =# +#= @testset "reset" begin =# +#= reset() =# +#= assert not failed() =# +#= =# +#= =# +#= @testset "return_c" begin =# +#= reset() =# +#= assert not return_c() =# +#= reset() =# +#= =# +#= =# + @testset "rotate" begin + act = rotate(π / 4, 3) + exp = [sqrt(2) / 2.0 sqrt(2) / 2.0 0.0; + -sqrt(2) / 2.0 sqrt(2) / 2.0 0.0; + 0.0 0.0 1.0] + @testset for i in eachindex(act, exp) + @test act[i] ≈ exp[i] end end - @testset "reclat" begin - act1 = reclat([1.0, 0.0, 0.0]) - act2 = reclat([0.0, 1.0, 0.0]) - act3 = reclat((-1.0, 0.0, 0.0)) - @test [act1[1], act1[2], act1[3]] ≈ [1.0, 0.0, 0.0] - @test [act2[1], act2[2], act2[3]] ≈ [1.0, deg2rad(90.0), 0.0] - @test [act3[1], act3[2], act3[3]] ≈ [1.0, deg2rad(180.0), 0.0] - end +#= @testset "rotmat" begin =# +#= ident = ident() =# +#= expectedR = [[0.0, 0.0, -1.0], =# +#= [0.0, 1.0, 0.0], =# +#= [1.0, 0.0, 0.0]] =# +#= rOut = rotmat(ident, halfpi(), 2) =# +#= npt.assert_array_almost_equal(rOut, expectedR) =# +#= =# +#= =# +#= @testset "rotvec" begin =# +#= vin = [sqrt(2), 0.0, 0.0] =# +#= angle = pi() / 4 =# +#= iaxis = 3 =# +#= vExpected = [1.0, -1.0, 0.0] =# +#= vout = rotvec(vin, angle, iaxis) =# +#= npt.assert_array_almost_equal(vout, vExpected) =# +#= =# +#= =# +#= @testset "rpd" begin =# +#= assert rpd() == arccos(-1.0) / 180.0 =# +#= =# +#= =# +#= @testset "rquad" begin =# +#= # solve x^2 + 2x + 3 = 0 =# +#= root1, root2 = rquad(1.0, 2.0, 3.0) =# +#= expectedRootOne = [-1.0, sqrt(2.0)] =# +#= expectedRootTwo = [-1.0, -sqrt(2.0)] =# +#= npt.assert_array_almost_equal(root1, expectedRootOne) =# +#= npt.assert_array_almost_equal(root2, expectedRootTwo) =# end diff --git a/test/x.jl b/test/x.jl index fc35ad2..1c22956 100644 --- a/test/x.jl +++ b/test/x.jl @@ -1,46 +1,62 @@ @testset "X" begin - let - furnsh(path(CORE, :pck)) - sx = sxform("J2000", "IAU_JUPITER", 0.0) - eulang, unique = xf2eul(sx, 3, 1, 3) - @test eulang ≈ [-3.10768, 0.44513, -1.83172, -0.0, 0.0, 0.0] rtol=1e-5 - @test_throws SpiceError xf2eul(sx, 4, 1, 4) - unload(path(CORE, :pck)) + @testset "xf2eul" begin + try + furnsh(path(CORE, :pck)) + sx = sxform("J2000", "IAU_JUPITER", 0.0) + eulang, unique = xf2eul(sx, 3, 1, 3) + @test eulang ≈ [-3.10768, 0.44513, -1.83172, -0.0, 0.0, 0.0] rtol=1e-5 + @test_throws SpiceError xf2eul(sx, 4, 1, 4) + @test_throws ArgumentError xf2eul(randn(3,3), 3, 1, 3) + finally + kclear() + end end - let + @testset "xf2rav" begin e1 = [1.0, 0.0, 0.0] rz1 = [0.0 1.0 0.0; -1.0 0.0 0.0; 0.0 0.0 1.0] xform = rav2xf(rz1, e1) rz2, e2 = xf2rav(xform) @test e1 ≈ e2 @test rz1 ≈ rz2 + @test_throws ArgumentError xf2rav(randn(3, 3)) end - let - furnsh(path(CORE, :lsk), path(CORE, :spk)) - et = str2et("July 4, 2003 11:00 AM PST") - state, lt = spkezr("Mars", et, "J2000", "Earth", abcorr="LT+S") - expected_lt = 269.6898813661505 - expected_state = [7.38222353105354905128e+07, -2.71279189984722770751e+07, - -1.87413063014898747206e+07, -6.80851334001380692484e+00, - 7.51399612408221173609e+00, 3.00129849265935222391e+00] - @test lt ≈ expected_lt - @test state ≈ expected_state - state_lat = xfmsta(state, "rectangular", "latitudinal", " ") - expected_lat_state = [8.08509924324866235256e+07, -3.52158255331780634112e-01, - -2.33928262716770696272e-01, -9.43348972618204761886e+00, - 5.98157681117165682860e-08, 1.03575559016377728336e-08] - @test state_lat ≈ expected_lat_state - kclear() + @testset "xfmsta" begin + try + furnsh(path(CORE, :lsk), path(CORE, :spk)) + et = str2et("July 4, 2003 11:00 AM PST") + state, lt = spkezr("Mars", et, "J2000", "Earth", abcorr="LT+S") + expected_lt = 269.6898813661505 + expected_state = [7.38222353105354905128e+07, -2.71279189984722770751e+07, + -1.87413063014898747206e+07, -6.80851334001380692484e+00, + 7.51399612408221173609e+00, 3.00129849265935222391e+00] + @test lt ≈ expected_lt + @test state ≈ expected_state + state_lat = xfmsta(state, "rectangular", "latitudinal", " ") + expected_lat_state = [8.08509924324866235256e+07, -3.52158255331780634112e-01, + -2.33928262716770696272e-01, -9.43348972618204761886e+00, + 5.98157681117165682860e-08, 1.03575559016377728336e-08] + @test state_lat ≈ expected_lat_state + @test_throws ArgumentError xfmsta(state[1:5], "rectangular", "latitudinal", " ") + finally + kclear() + end end - let a = randn(6, 6) + @testset "xpose6" begin + a = randn(6, 6) @test SPICE._xpose6(a) == transpose(a) + end + @testset "xposeg" begin + a = randn(6, 6) @test SPICE._xposeg(a) == transpose(a) end - let a = randn(3, 3) + @testset "xpose" begin + a = randn(3, 3) @test SPICE._xpose(a) == transpose(a) - @test SPICE._xposeg(a) == transpose(a) end - let a = randn(3, 5) + @testset "xposeg" begin + a = randn(3, 3) + @test SPICE._xposeg(a) == transpose(a) + a = randn(3, 5) @test SPICE._xposeg(a) == transpose(a) end end