Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadcastable Pseudorange calculation #4

Open
dominformant opened this issue Jan 27, 2022 · 0 comments
Open

Broadcastable Pseudorange calculation #4

dominformant opened this issue Jan 27, 2022 · 0 comments

Comments

@dominformant
Copy link
Contributor

dominformant commented Jan 27, 2022

In my opinion, it would be preferable to broadcast a function get_pseudo_range over the sat_states instead of looping inside the function pseudo_range.

function pseudo_ranges(
sat_states::AbstractVector{SatelliteState{Float64}}
)
for i in 1:length(sat_states)
is_sat_healthy_and_decodable(sat_states[i].decoder_state) || throw(BadData("SV not decoded properly, #decoder: " * string(i)))
end
N_sats = length(sat_states)
c = sat_states[1].decoder_state.constants.c
times = map(i -> calc_corrected_time(sat_states[i]), 1:N_sats)
t_ref = maximum(times)
τ = map(i -> t_ref - times[i], 1:N_sats)
pseudoranges = τ .* c
return pseudoranges
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant