From 68916b6c1b96f4414085040c4fe2f31711bf9301 Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <MichielCottaar@protonmail.com>
Date: Thu, 30 May 2024 10:44:39 +0100
Subject: [PATCH] Replace qval with qvec where appropriate

---
 src/components/instant_gradients.jl | 18 +++++++++---------
 src/parts/epi_readouts.jl           |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/components/instant_gradients.jl b/src/components/instant_gradients.jl
index 68f6b74..d78ffe7 100644
--- a/src/components/instant_gradients.jl
+++ b/src/components/instant_gradients.jl
@@ -20,13 +20,13 @@ If the `orientation` is set an [`InstantGradient1D`](@ref) is returned, otherwis
 """
 abstract type InstantGradient{N} <: EventComponent end
 
-function (::Type{InstantGradient})(; orientation=nothing, group=nothing, qval=nothing, variables...)
+function (::Type{InstantGradient})(; orientation=nothing, group=nothing, variables...)
     if isnothing(orientation)
-        res = InstantGradient3D(get_free_variable.(qval), group)
+        res = InstantGradient3D(nothing, group)
     else
-        res = InstantGradient1D(get_free_variable(qval), orientation, group)
-        if !(res.qval isa Number)
-            @constraint global_model() res.qval >= 0
+        res = InstantGradient1D(nothing, orientation, group)
+        if !(res.qvec isa Number)
+            @constraint global_model() res.qvec >= 0
         end
     end
     set_simple_constraints!(res, variables)
@@ -52,11 +52,11 @@ struct InstantGradient3D <: InstantGradient{3}
     group :: Union{Nothing, Symbol}
 end
 
-function InstantGradient3D(; qval=[nothing, nothing, nothing], group=nothing, variables...)
-    if isnothing(qval)
-        qval = [nothing, nothing, nothing]
+function InstantGradient3D(; qvec=nothing, group=nothing, variables...)
+    if isnothing(qvec)
+        qvec = [nothing, nothing, nothing]
     end
-    res = InstantGradient3D(get_free_variable.(qval), group)
+    res = InstantGradient3D(get_free_variable.(qvec), group)
     set_simple_constraints!(res, variables)
     return res
 end
diff --git a/src/parts/epi_readouts.jl b/src/parts/epi_readouts.jl
index 8d775e7..a2a35be 100644
--- a/src/parts/epi_readouts.jl
+++ b/src/parts/epi_readouts.jl
@@ -55,7 +55,7 @@ function EPIReadout(; resolution::AbstractVector{<:Integer}, recenter=false, gro
         apply_simple_constraint!(variables.qvec(res.recenter_gradient), VariableType[sign * variables.qvec(pos)[1]/2, -ky_lines[end] * res.ky_step, 0.])
     end
     for shift in unique(ky_lines[2:end] - ky_lines[1:end-1])
-        res.blips[shift] = Trapezoid(orientation=[0, shift > 0 ? 1 : -1, 0], group=group, qval=abs(shift) * res.ky_step)
+        res.blips[shift] = Trapezoid(qvec=[0., shift * res.ky_step, 0.], group=group)
     end
     set_simple_constraints!(res, vars)
     return res
-- 
GitLab