Known objects
Cross-matching against SkyBoT (or JPL while it is down), the MPC's orbit file, VSX and SIMBAD (Identify known objects).
AsteroidPipeline.SkyBoTServiceError Type
SkyBoTServiceError(message)SkyBoT answered, but with a server-side failure instead of a result — a # Flag: status other than 1 (objects found) or 0 (none found), or no status line at all. Thrown by crossmatch_catalog(...; :skybot) once retries are exhausted, rather than reporting the candidate as having no known counterpart: a silently empty match would make every known object look like a new discovery.
AsteroidPipeline._angular_distance_arcsec Method
_angular_distance_arcsec(ra1, dec1, ra2, dec2) -> Float64Great-circle angular distance (haversine formula — accurate at any declination, including near the poles, unlike a flat small-angle approximation) between two (ra, dec) points in degrees, returned in arcseconds. Used to resolve which candidate in a _cds_batch_query batch each returned row actually matches, since ADQL's own DISTANCE needs one fixed reference point per query and a batch has several.
AsteroidPipeline._cds_batch_query Method
_cds_batch_query(select, table, ra_col, dec_col, batch, radius_deg) -> StringAn ADQL synchronous query matching rows of table against any member of batch (an iterable of rows with ra/dec fields): one CONTAINS(...) = 1 cone-search clause per candidate, OR-chained into a single request (see crossmatch_catalog). Shared by _crossmatch_simbad and _crossmatch_vsx; which candidate a row matched is resolved client-side.
AsteroidPipeline._crossmatch_skybot Method
_crossmatch_skybot(candidates, radius; observatory=nothing) -> TableQuery SkyBoT once per candidate, concurrently (up to _SKYBOT_CONCURRENCY requests in flight at a time via Julia Tasks, not extra threads — this is a network-latency-bound workload, not a CPU-bound one, so cooperative concurrency on however many threads Julia was started with is enough to see the full speedup). Order of results does not depend on request completion order: each candidate's matches are collected into their own slot and the final table is built from those slots in candidates' original order, not arrival order.
AsteroidPipeline._is_service_failure Method
_is_service_failure(e) -> BoolWhether e is the catalog service failing — unreachable, reset, TLS or protocol trouble, a timeout, a 5xx status — which a retry (or another copy of the catalog) can get past, as opposed to a 4xx status, which means the query itself is wrong and would fail anywhere.
AsteroidPipeline._jpl_field Method
_jpl_field(c, radius_deg, observatory) -> (ra, dec, half_width, epoch, observatory, objects)The objects JPL's Small-Body Identification service places in a square field around c at c.epoch, seen from observatory (an MPC code), with their positions (degrees) and rates (″/h, the RA rate times cos Dec): a field already fetched is reused when it covers the cone and lies within _JPL_MAX_HOURS of c.epoch, where its objects are moved along their rates. Its second pass, the one with precise positions, takes a minute or more, hence one query per field rather than one per candidate. Once it fails (on 2026-11-11 it answered HTTP 504 after 6 minutes, three times over), it is not asked again for _SKYBOT_RETRY_AFTER seconds: the same error is thrown at once.
AsteroidPipeline._known_objects_near Method
_known_objects_near(c, radius_deg; observatory=nothing) -> Vector{NamedTuple}The known solar-system objects within radius_deg of c (ra, dec, epoch), as _skybot_matches returns them plus a source field: from SkyBoT, or, while SkyBoT is unavailable, from JPL's Small-Body Identification service (_jpl_field). Once SkyBoT fails it is not asked again for _SKYBOT_RETRY_AFTER seconds, so a list of candidates doesn't wait out its retries one by one. Throws only if both services fail.
AsteroidPipeline._parse_jpl_sbident Method
_parse_jpl_sbident(json) -> Vector{NamedTuple}The objects of a Small-Body Identification answer's second pass: name as SkyBoT gives it (a numbered object's name, else its designation: "610588 (2006 CX81)" is "2006 CX81"), ra, dec (degrees), mv, and ra_rate (dRA·cos Dec), dec_rate in ″/h. Throws an ErrorException with the service's message if it reports one.
AsteroidPipeline._parse_skybot Method
_parse_skybot(text) -> Vector{NamedTuple}Parse one SkyBoT text-mode cone-search response. Its first line is a status, # Flag: <n>: 1 means a result table follows, 0 means no object in the field (verified against the live service: a short "No solar system object was found" message, still HTTP 200). Anything else — -1, or no status line — is SkyBoT failing server-side, and throws a SkyBoTServiceError: before this check, a -1 response's body (a crash backtrace, no |-delimited rows) parsed as zero matches, so an outage looked exactly like an empty field.
AsteroidPipeline._skybot_matches Method
_skybot_matches(c, radius_deg) -> Vector{NamedTuple}One SkyBoT cone-search request for a single candidate c, run one task per candidate by _crossmatch_skybot.
Up to _SKYBOT_ATTEMPTS tries on any HTTP.HTTPError or SkyBoTServiceError (SkyBoT failing server-side behind HTTP 200, which clears on a resend). fetch is the HTTP call itself, injectable so the retries can be tested without the network.
At some epochs (2009 in Pan-STARRS1's archive, on 2026-11-12 in half the tries) SkyBoT answers "comet conesearch -> Bad request: Epoch … not available" for the whole cone; it is then asked again without comets (-objFilter=110), and its asteroids are found.
The cone asked of SkyBoT is never smaller than _SKYBOT_MIN_CONE (2′), and matches beyond radius_deg are dropped here: asked for 5″, SkyBoT missed a known asteroid 0.94″ from the centre in two of four ZTF frames.
AsteroidPipeline._tap_query Method
_tap_query(url, query) -> CSV.FileRun query (an ADQL string) as a synchronous TAP query against url, returning the CSV response parsed by CSV.File. Shared by _crossmatch_simbad, _crossmatch_vsx and gaia_reference_stars.
A request that stops receiving data for _CATALOG_IDLE_TIMEOUT seconds is abandoned (HTTP.TimeoutError) instead of waiting forever. Retried _TAP_ATTEMPTS tries in all on a failure of the service itself (see _is_service_failure), never on a 4xx answer.
AsteroidPipeline.crossmatch_catalog Method
crossmatch_catalog(candidates, catalog::Symbol; radius::Real,
observatory::Union{Nothing,AbstractString}=nothing, mpcorb=nothing)Cross-match candidate tracklets against a known-object catalog (:skybot, :mpcorb, :vsx or :simbad) within radius arcseconds, to separate known objects from candidates warranting human verification.
candidates is an iterable of rows with id, ra, dec fields (degrees, J2000), such as the table returned by astrometric_calibrate; :skybot and :mpcorb also need each row's epoch (Julian Date).
:skybotasks IMCCE's SkyBoT for the solar-system objects at each row's epoch, or, while SkyBoT is unavailable, JPL's Small-Body Identification service (see_known_objects_near).:mpcorbpropagates the Minor Planet Center's orbits in anMPCORB.DATfile (mpcorb: its path, orread_mpcorb's result) to each row's epoch (see_crossmatch_mpcorb); same columns as:skybot.:vsxand:simbadquery each CDS TAP service with oneOR-chained ADQL cone per candidate,_CDS_BATCH_SIZE(50) per request, and assign each returned row to its candidates client-side. (TAPUPLOADand ADQLUNIONdon't work on these services.) VSX rows carry variability class, magnitudes and period. While the CDS is down, SIMBAD's copy at Harvard and AAVSO's VSX answer instead, with a warning.
Every result has id, ra, dec and distance_arcsec, one row per (candidate, match) pair; a candidate id absent from it has no known counterpart in catalog.
For :skybot and :mpcorb, observatory (an MPC code, e.g. "F51" for Pan-STARRS1, "I41" for ZTF) computes each position from that site rather than the Earth's centre. Leave it unset only for distant objects: parallax moves a near one by many arcseconds (~15" for a Mars-crosser seen from F51).
Each row is matched at its own epoch, so passing every row of a tracklet and counting matches per (id, name) checks that the tracklet follows the object frame by frame. One matched point is a weak test: a static star near a known asteroid's track matches once.
AsteroidPipeline.OfflineAnswerMissing Type
OfflineAnswerMissing(service)Thrown, offline, for a query whose answer was never kept: the set was not analyzed with the network before, or not with the same frames.
sourceAsteroidPipeline.answers_dir Method
answers_dir() -> StringWhere the answers of SkyBoT and JPL's Small-Body Identification service are kept as they came: $XDG_CACHE_HOME (default ~/.cache) /AsteroidPipeline/answers, one file per query. Every answer is kept; analyze_set(...; offline=true) answers from them alone, so an analysis repeated without the network, or after a service changed its answers, gives the same result. Deleting it only costs the queries again.
AsteroidPipeline._crossmatch_mpcorb Method
_crossmatch_mpcorb(candidates, radius; mpcorb, observatory) -> Tablecrossmatch_catalog's :mpcorb backend: every row of candidates against the orbits in mpcorb (a path to MPCORB.DAT, or what read_mpcorb returned) propagated to the row's own epoch, within radius arcsec. Orbits are first screened at one epoch to the ones within a degree of any candidate, so only those are propagated per row.
Next to SkyBoT because the MPC's current orbits identify recently linked or poorly observed objects that older orbits place degrees away.
sourceAsteroidPipeline._heliocentric_equatorial Method
_heliocentric_equatorial(orbit, jd_tt) -> (x, y, z)Two-body heliocentric position (AU, J2000 equatorial) of an MPCORB orbit at jd_tt: mean anomaly advanced at the orbit's own mean motion, Kepler's equation solved by Newton iteration. The same approximation Astrometrica's known-object overlay relies on — fine over the weeks to months between an MPCORB epoch and an observation, not for long arcs.
AsteroidPipeline._observer_heliocentric Method
_observer_heliocentric(jds_utc, observatory) -> Vector{NTuple{3,Float64}}The observer's heliocentric position (AU, ICRF/J2000 equatorial) at each UTC Julian Date, from JPL Horizons (a live request): the Sun's vector as seen from the MPC site observatory, negated. observatory=nothing gives the Earth's centre instead.
AsteroidPipeline.read_mpcorb Method
read_mpcorb(path) -> Vector{NamedTuple}Every orbit in a Minor Planet Center MPCORB.DAT file (the one Astrometrica downloads into its Catalogs directory works): packed, name, H, G, epoch (Julian Date, TT), mean anomaly M, argument of perihelion peri, ascending node node, inclination incl (degrees, J2000 ecliptic), e, semi-major axis a (AU) and mean daily motion n (degrees/day), parsed from the MPC's documented fixed columns. Header lines and lines too short to hold an orbit are skipped.