Skip to content

Commit

Permalink
Try catch in propres
Browse files Browse the repository at this point in the history
  • Loading branch information
LuEdRaMo committed Aug 25, 2024
1 parent cc43f4c commit 8a36919
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/orbitdetermination/orbitdetermination.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ function propres(radec::Vector{RadecMPC{T}}, jd0::V, q0::Vector{U}, params::NEOP
return bwd, fwd, Vector{OpticalResidual{T, U}}(undef, 0)
end
# O-C residuals
res = residuals(radec, params;
xvs = et -> auday2kmsec(params.eph_su(et/daysec)),
xve = et -> auday2kmsec(params.eph_ea(et/daysec)),
xva = et -> bwdfwdeph(et, bwd, fwd))

return bwd, fwd, res
try
res = residuals(radec, params;
xvs = et -> auday2kmsec(params.eph_su(et/daysec)),
xve = et -> auday2kmsec(params.eph_ea(et/daysec)),
xva = et -> bwdfwdeph(et, bwd, fwd))
return bwd, fwd, res
catch
return bwd, fwd, Vector{OpticalResidual{T, U}}(undef, 0)
end
end

# In-place method of propres
Expand All @@ -63,12 +66,16 @@ function propres!(res::Vector{OpticalResidual{T, U}}, radec::Vector{RadecMPC{T}}
return bwd, fwd
end
# O-C residuals
residuals!(res, radec, params;
xvs = et -> auday2kmsec(params.eph_su(et/daysec)),
xve = et -> auday2kmsec(params.eph_ea(et/daysec)),
xva = et -> bwdfwdeph(et, bwd, fwd))

return bwd, fwd
try
residuals!(res, radec, params;
xvs = et -> auday2kmsec(params.eph_su(et/daysec)),
xve = et -> auday2kmsec(params.eph_ea(et/daysec)),
xva = et -> bwdfwdeph(et, bwd, fwd))
return bwd, fwd
catch
empty!(res)
return bwd, fwd
end
end

@doc raw"""
Expand Down

0 comments on commit 8a36919

Please sign in to comment.