Skip to content

Commit

Permalink
Check for signal and codes type consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
coezmaden committed Nov 14, 2021
1 parent 8f3464d commit 90358a9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/tracking_loop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ function track(
correlator = get_correlator(state)
num_ants = get_num_ants(correlator)
size(signal, 2) == num_ants || throw(ArgumentError("The second dimension of the signal should be equal to the number of antennas specified by num_ants = NumAnts(N) in the TrackingState."))
# typeof(signal) <: StructArray || throw(ArgumentError("Signal is not a StructArray, initialize the signal properly and try again."))
# typeof(signal.re) <: CuArray && typeof(state.system.codes) <: CuArray
# typeof(vec(signal.re)) == typeof(vec(system.codes))|| throw(ArgumentError("Signal and GNSS codes are not of the same type. Please check if CPU or GPU is used."))
if typeof(system.codes) <: CuMatrix
typeof(signal) <: StructArray || throw(ArgumentError("Signal is not a StructArray, initialize the signal properly and try again."))
typeof(signal.re) <: CuArray && typeof(state.system.codes) <: CuArray || throw(ArgumentError("Signal and GNSS codes are not of the same type. Please check if CPU or GPU is used."))
end
downconverted_signal_temp = get_downconverted_signal(state)
downconverted_signal = resize!(downconverted_signal_temp, size(signal, 1), signal)
carrier_replica = get_carrier(state)
Expand Down

0 comments on commit 90358a9

Please sign in to comment.