Report formats and digest2
ADES and 80-column observation lines, and digest2 orbit-class scores (Write and check MPC reports, Follow-up tools).
AsteroidPipeline._jd_to_calendar Method
_jd_to_calendar(jd::Real) -> (year, month, day, day_fraction)Break a Julian Date (UTC) into its Gregorian calendar year/month/integer day plus the leftover fraction of that day (Meeus, Astronomical Algorithms, ch. 7). Callers round day_fraction to their own precision.
AsteroidPipeline._mpc_date Method
_mpc_date(jd::Real) -> StringFormat a Julian Date (UTC) as the MPC 80-column format's "YYYY MM DD.dddddd" date field (columns 16-32; 1e-6 day ≈ 0.0864s precision). A rounding carry re-derives the date, across month and year ends.
AsteroidPipeline._mpc_dec Method
_mpc_dec(dec_deg::Real) -> StringFormat a declination in decimal degrees as the MPC 80-column format's "sDD MM SS.dd" field (columns 45-56; s is a mandatory +/-, per the spec — MPC does not default a blank sign to positive). Clamped at the pole rather than left to overflow into an invalid degrees field: not expected on any real asteroid-search field, but cheap to guard.
AsteroidPipeline._mpc_ra Method
_mpc_ra(ra_deg::Real) -> StringFormat a right ascension in decimal degrees as the MPC 80-column format's "HH MM SS.ddd" field (columns 33-44).
AsteroidPipeline.ades_psv Method
ades_psv(candidates, station::AbstractString; mode::AbstractString="CCD",
trksub_prefix::AbstractString="", astCat=nothing,
photCat=nothing, band=nothing, designations=nothing) -> StringFormat candidates (an astrometric_calibrate table — columns id, frame, x, y, ra, dec, epoch) as an ADES PSV (pipe-separated values) observation table — the format the Minor Planet Center currently requires for astrometric submissions, superseding the legacy fixed-width 80-column format. See mpc80_report for the 80-column format itself, still required by some programs (e.g. IASC, as of 2026) even though the MPC's own submissions now prefer ADES.
New, undesignated objects (this pipeline never produces MPC-designated ones — candidates are locally-numbered tracklets) are identified by trkSub, an observer-chosen tracking label (here, each real tracklet's own id, base-36 encoded to stay compact and prefixed with trksub_prefix if given), which is exactly what this pipeline already produces.
One row per detection point (i.e. one row per candidates row, not one per tracklet) — this is the granularity ADES observation records use; the Minor Planet Center correlates same-trkSub rows into a tracklet on its own end. station is the observer's MPC-assigned station/observatory code (3 characters, e.g. ZTF's is "I41") and must be supplied — there is no way to derive it from pixel data.
With a pos_err column (a position's 1σ per axis, arcsec, as analyze_set gives) each row gets rmsRA and rmsDec; with mag, mag, and with mag_err, rmsMag. A NaN leaves that row's field empty. astCat/photCat/band are the astrometric reference catalog, photometric reference catalog and photometric band; band defaults to "G" when there are magnitudes, the others are omitted unless given. analyze_set fits both astrometry and zero points to Gaia DR3, ADES code "Gaia3": pass astCat="Gaia3", photCat="Gaia3" for its candidates.
Returns the PSV content as a String; write it to a .psv file yourself (e.g. write("submission.psv", ades_psv(candidates, "I41"))).
designations (tracklet id => trkSub) replaces the generated ones, as in mpc80_report.
AsteroidPipeline.julian_date_to_iso8601 Method
julian_date_to_iso8601(jd::Real) -> StringConvert a Julian Date (UTC) to an ISO 8601 UTC timestamp ("YYYY-MM-DDTHH:MM:SS.sssZ"), the format ADES requires for obsTime.
AsteroidPipeline.mpc80_report Method
mpc80_report(candidates, station::AbstractString; note1::AbstractChar=' ',
note2::AbstractChar='C', trksub_prefix::AbstractString="",
band::AbstractChar='G', designations=nothing) -> StringFormat candidates (an astrometric_calibrate table, same shape ades_psv takes) as the legacy MPC1992 fixed-width 80-column format — verified column-by-column against the Minor Planet Center's own published specification (OpticalObs.html, PackedDes.html), not guessed: columns 1-5 packed permanent number, 6-12 packed provisional/temporary designation, 13 discovery asterisk, 14 note 1, 15 note 2, 16-32 date ("YYYY MM DD.dddddd"), 33-44 RA ("HH MM SS.ddd"), 45-56 Dec ("sDD MM SS.dd", sign mandatory — MPC does not default a blank sign to positive), 57-65 blank, 66-71 magnitude+band, 72-77 blank, 78-80 observatory code.
Columns 1-5 are always blank: this pipeline's candidates are locally-numbered tracklets, never MPC-numbered objects. Columns 6-12 use the same real, spec-sanctioned escape hatch ades_psv's trkSub relies on: the spec requires some designation in columns 1-12 ("never leave [them] blank"), but for a brand-new, not-yet-designated discovery it explicitly allows an observer-assigned temporary designation in place of an MPC-packed provisional one — alphanumeric only, max 7 characters here (one shorter than ADES's 8-character trkSub limit, since the packed-number field this shares a slot with doesn't get the eighth column ADES adds). Built the same way as ades_psv's trkSub: each tracklet's own id, base-36 encoded and optionally prefixed via trksub_prefix.
Magnitudes: if candidates has a mag column (e.g. added from candidate_magnitudes: Table(candidates; mag=mags)), each finite value is written to columns 66-70 with one decimal — the precision IASC's own Astrometrica reports use, "21.2 " — and band (default 'G', the Gaia-calibrated band candidate_magnitudes gives) to column 71; a missing or NaN magnitude leaves both blank, which the format allows.
Two real gaps remain (deliberately not guessed at): no discovery asterisk (column 13 always blank — this pipeline doesn't track which observation of a tracklet was reported first), and note1/note2 are fixed per call rather than derived per detection. note2 defaults to 'C' (CCD), matching how ZTF (and most modern digital-sensor surveys) report; see the MPC spec for the full note2 code table if submitting from a different observing mode.
One row (one 80-character line, newline-terminated) per detection point, same granularity as ades_psv. Returns the report content as a String; write it to a file yourself (e.g. write("submission.txt", mpc80_report(candidates, "I41"))).
designations (tracklet id => designation) replaces the generated temporary designations with your own — an observing team's own numbering, "NHU0002", or a NEO Confirmation Page designation for an object already posted there. Each must be 1-7 letters and digits.
AsteroidPipeline.digest2_score Method
digest2_score(candidates, station::AbstractString;
digest2_path::AbstractString="digest2",
config_dir::Union{Nothing,AbstractString}=nothing,
trksub_prefix::AbstractString="") -> TableScore each tracklet in candidates (an astrometric_calibrate table, as mpc80_report takes) for its likelihood of belonging to each orbit class, with the Minor Planet Center's digest2 (short-arc statistical ranging against a solar-system population model).
digest2 is a separate C program (https://github.com/Smithsonian/mpc-public, directory digest2): build it (see Follow-up tools) and put the executable on PATH or pass it as digest2_path. config_dir defaults to the directory of the executable, symlinks resolved, and must hold digest2.model.csv, as it ships with digest2 (digest2.obscodes too, which digest2 downloads from the MPC if missing).
It runs as the MPC runs it: with the astrometric uncertainty of each station from MPC.config in config_dir (1″ for a station not listed, or with no MPC.config), and seeded the same way for every tracklet, so a tracklet always gets the same scores.
The input is mpc80_report's output, sorted by (id, epoch) as digest2 requires. The command is built from an argument vector, never a shell string.
Returns one row per tracklet (id) with digest2's RMS (its linear-motion fit residual, arcsec; NaN if too large to print) and four 0-100 pseudo-probabilities: int_score (any orbit class of MPC interest), neo_score (near-Earth object), and n22_score/n18_score (NEO with H ≤ 22 / ≤ 18). The MPC posts a tracklet with neo_score of 65 or more to its NEO Confirmation Page.
These scores classify orbits; they don't tell real objects from bogus ones. A stationary star linked into a tracklet by a loose match_radius scores neo_score=100, so vet tracklets for consistent motion first.
Throws ArgumentError if digest2_path resolves to nothing runnable or station isn't a 3-character MPC observatory code.