Skip to content

Commit

Permalink
Fix reduce_nights
Browse files Browse the repository at this point in the history
  • Loading branch information
LuEdRaMo committed Sep 10, 2023
1 parent 9ba3513 commit 09bc141
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/observations/process_radec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,11 @@ end
Special method of [`extrapolation`](@ref) to be used by [`gaussinitcond`](@ref).
"""
function extrapolation(df::AbstractDataFrame)
if !allunique(df.date)
gdf = groupby(df, :date)
df = combine(gdf, [, ] .=> x -> sum(x)/length(x), :observatory => identity, renamecols = false)
end

if isone(nrow(df))
return (observatory = df.observatory[1], date = df.date[1], α = df.α[1], δ = df.δ[1])
end
Expand Down Expand Up @@ -619,7 +624,7 @@ function extrapolation(df::AbstractDataFrame)

# Evaluate polynomials at mean date
α_mean = mod2pi(α_p(t_mean))
δ_mean = mod2pi(δ_p(t_mean))
δ_mean = δ_p(t_mean)

return (observatory = df.observatory[1], date = julian2datetime(t_julian[1] + t_mean), α = α_mean, δ = δ_mean)
end
Expand Down
4 changes: 2 additions & 2 deletions src/orbit_determination/gauss_method.jl
Original file line number Diff line number Diff line change
Expand Up @@ -466,13 +466,13 @@ for i in 1:2
# Backward propagation
bwd = propagate(RNp1BP_pN_A_J23E_J2S_eph_threads!, maxsteps, jd0, nyears_bwd, q0;
order = order, abstol = abstol, parse_eqs = parse_eqs)
if length(bwd.t) == maxsteps + 1
if bwd.t[end] > t0 - jd0
continue
end
# Forward propagation
fwd = propagate(RNp1BP_pN_A_J23E_J2S_eph_threads!, maxsteps, jd0, nyears_fwd, q0;
order = order, abstol = abstol, parse_eqs = parse_eqs)
if length(fwd.t) == maxsteps + 1
if fwd.t[end] < tf - jd0
continue
end
# O-C residuals
Expand Down

0 comments on commit 09bc141

Please sign in to comment.