From d94b2182d80a9ed88a9fd03280a0be115757e53b Mon Sep 17 00:00:00 2001 From: Alexander Jaffray Date: Mon, 29 Jan 2024 16:41:15 -0800 Subject: [PATCH] add test for application of k0 and k1 girf --- test/testintegration.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/testintegration.jl b/test/testintegration.jl index b4834a9..51d7bce 100644 --- a/test/testintegration.jl +++ b/test/testintegration.jl @@ -7,16 +7,23 @@ function test_apply_girf!(acq_data,girf_applier) acq_data_ref = deepcopy(acq_data) apply_girf!(acq_data,girf_applier) + # these should be pretty unique checks against ground-truth @test mean(abs2.(fft(acq_data.traj[1].nodes[1,:]))./abs2.(fft(acq_data_ref.traj[1].nodes[1,:]))) - 0.98 < 1e-4 end function test_apply_k0!(acq_data,girf_applier) + acq_data_ref = deepcopy(acq_data) + apply_girf!(acq_data,girf_applier) + + # these should be pretty unique checks against ground-truth + @test mean(angle.(acq_data_ref.kdata[1]) .- angle.(acq_data.kdata[1])) - 0.00118 < 1e-5 end function test_integration() + # load generated AcquisitionData objects and GirfApplier objects to run the test set acq_data = load_object("data/acq_data.jld2") girf_applier_k1 = load_object("data/girf_app_k1.jld2") girf_applier_k0 = load_object("data/girf_app_k0.jld2") @@ -26,6 +33,7 @@ function test_integration() test_apply_girf!(acq_data,girf_applier_k1) test_apply_k0!(acq_data,girf_applier_k0) end + end test_integration() \ No newline at end of file