Linking across nights and orbits
Grouping tracklets from different nights (Follow-up tools), and a preliminary orbit from them.
AsteroidPipeline.link_across_nights Method
link_across_nights(night_movers::AbstractVector;
match_radius_arcsec::Real=5.0,
max_accel_arcsec_per_day2::Real=Inf,
min_nights::Integer=2)Group tracklets from different observing nights that are consistent with one moving object: link_candidates's problem one level up, on sky coordinates rather than pixels (each night has its own pointing), and over gaps of days, where orbital curvature starts to matter.
night_movers[k] is night k's astrometric_calibrate (or search_field) table (id, frame, x, y, ra, dec, epoch). Each night's tracklets are fit to a linear rate in a tangent plane around their mean position (_linfit) and extrapolated to every other night's tracklets' mean epoch. A pair is accepted when the extrapolation lands within match_radius_arcsec, plus max_accel_arcsec_per_day2 * Δt_days^2 for curvature if that is finite. Accepted pairs are grouped transitively (union-find), and groups spanning at least min_nights nights are kept. Tracklets with fewer than 2 points have no rate and are skipped.
The defaults are not calibrated on real multi-night data: tune match_radius_arcsec to your cadence and targets.
Returns groups, each a Vector of (night, id) named tuples.
AsteroidPipeline.link_nights Method
link_nights(night_movers, observatory; sigma=0.5, max_days=15, outlier_sigma=3.0, min_nights=3)Link tracklets seen on different nights into one object each, by orbit: link_across_nights's problem, solved with fit_orbit instead of straight lines.
night_movers[k] is night k's table of tracklet points (id, ra, dec in degrees, epoch as JD UTC), as astrometric_calibrate gives them; observatory is the MPC site code, one for all nights or one per night. Tracklets with fewer than 2 points are skipped. The observers' positions come from JPL Horizons (a live request).
Two tracklets max_days apart or less are first compared by their motion: the mean angular velocity between them must equal the mean of their own velocities, as it does for any motion of constant acceleration. The allowance is 3σ of the measured velocities (each point sigma arcsec), plus the next term of the motion, bounded by 6|v|ω²Δt²/12 with ω the tracklet's own angular rate plus the Earth's mean motion. The diurnal parallax is taken out first, for a grid of distances from 0.02 to 50 AU; a pair passes at any one of them. A pair that passes is then fitted with an orbit, started by ranging over those distances only; it is linked when every observation is within outlier_sigma times sigma of it; the point farthest from it may be left out and the orbit refitted, one point of a tracklet of 3 or more. Linked pairs are grown, best fitting first, by the tracklet from another night whose addition fits best, refitted from the orbit already found, while the orbit still fits every observation. Each tracklet ends in at most one linkage: those spanning more nights first, then those with smaller residuals.
Returns the linkages spanning at least min_nights nights. Two nights are not enough: two tracklets moving like asteroids often fit some orbit, and false tracklets were linked on two nights by the dozen, never on three (Linking across nights). Each linkage is a named tuple: tracklets ((night, id) named tuples, in time order), orbit (the fit_orbit result, without the points left out) and dropped ((night, id, epoch) of the points left out).
AsteroidPipeline._gauss_orbits Method
_gauss_orbits(ρ̂, R, t) -> Vector of (r2, v2)Gauss's method (Curtis 2014, Algorithm 5.5) for three lines of sight ρ̂ from heliocentric observer positions R at TT Julian Dates t: one state at the middle epoch per positive root of the eighth-degree equation for the heliocentric distance, at least _MIN_DISTANCE from every observer.
AsteroidPipeline._kepler_propagate Method
_kepler_propagate(r0, v0, dt) -> (r, v)Two-body heliocentric position (AU) and velocity (AU/day) dt days after (r0, v0), by the universal variable (Curtis 2014, Orbital Mechanics for Engineering Students, Algorithms 3.3-3.4): any conic.
AsteroidPipeline._lambert Method
_lambert(r1, r2, dt) -> v1, or `nothing`The velocity at r1 of the two-body arc reaching r2 dt days later, prograde with respect to the ecliptic, less than one revolution (Curtis 2014, Algorithm 5.2, universal variable; z by bisection, on which the time of flight increases monotonically).
AsteroidPipeline.fit_orbit Method
fit_orbit(ra, dec, epochs, observatory; sigma=0.5, outlier_sigma=3.0)A preliminary orbit from astrometry: ra, dec (degrees) at epochs (Julian Dates UTC, 1972 or later), each from the MPC site observatory (one code, or one per observation). The observers' heliocentric positions come from JPL Horizons (a live request).
First orbits come from Gauss's method on the first, middle and last observation (one per root of its eighth-degree equation) and from systematic ranging (Virtanen, Muinonen & Bowell 2001): a grid of distances at the first and last observation, joined by Lambert's problem, of which the five fitting best are kept. Each is refined by least squares on the heliocentric state at the middle epoch, with observations weighted by sigma (arcsec, one or per observation), and the one with the smallest weighted residuals kept, among those not within 0.01 AU of the observer (Gauss's spurious root, the observer's own orbit). Observations whose residual exceeds outlier_sigma times their sigma are then left out and the fit repeated, until none is (Carpino, Milani & Chesley 2003 reject on the same principle, with a χ² threshold).
The motion is two-body around the Sun, with light time: no planet perturbs it, so the orbit predicts well over weeks to months for a main-belt object, less for one passing near a planet. Observations from one night alone don't constrain it; the arc should cover several nights.
Returns a named tuple: epoch (JD TT of the state), state (heliocentric position, AU, and velocity, AU/day, ICRF equatorial), covariance (6×6, from the weighted fit), elements (a, e, i, node, peri, M, q: osculating, heliocentric ecliptic J2000, degrees), sigma_elements (their 1σ, by linear propagation of the covariance), residuals (arcsec, ra times cos δ and dec, per observation), used (false for the outliers), rms (arcsec, of the used ones), arc_days.
AsteroidPipeline.orbit_ephemeris Method
orbit_ephemeris(orbit, epochs, observatory) -> TableWhere a fit_orbit orbit puts the object as seen from the MPC site observatory at epochs (JD UTC): ra, dec (degrees), delta and r (AU) and sigma (arcsec), the semi-major axis of its 1σ uncertainty ellipse on the sky from the fit's covariance, linearly propagated. A live request to JPL Horizons for the observer's positions.