Skip to content

astrometric_uncertainty_Veres2017 selects on catalogue names, but obs80 supplies single-char codes #548

Description

@matthewholman

Summary

astrometric_uncertainty_Veres2017 selects its per-station σ by comparing catalog against
catalogue names ("Gaia1", "UCAC4", "PPMXL", …), but Obs80Reader supplies the
single-character MPC code ("U", "q", "t", …). Every name-keyed branch is therefore
unreachable for obs80 input, and the affected stations silently fall through to their else
value.

debias() already handles both spellings — that was the #409 fix, and its comment says so
explicitly:

catalog may be a catalog NAME (an MPC_CATALOGS key, e.g. "UCAC4", as ADES provides) or
the single-char CODE that obs80 supplies (an MPC_CATALOGS value, e.g. "q"). bias_dict is
keyed by the code, so map a name to its code and let a code pass through -- otherwise
debiasing silently no-ops on all obs80 input (issue #409).

astrometric_uncertainty_Veres2017 never got the same treatment.

Where

  • src/layup/utilities/astrometric_uncertainty.py:87,107,117 and the 568 / Y28 / G83 /
    309 branches — all compare against MPC_CATALOGS keys.
  • src/layup/utilities/file_io/Obs80Reader.py"cat": slice(71, 72), a single character.
  • src/layup/utilities/debiasing.py:79-88 — the correct handling, for comparison.

Reproduction

from layup.utilities.astrometric_uncertainty import astrometric_uncertainty_Veres2017 as V
jd = 2458000.0
for stn, code, name in [("568", "U", "Gaia1"), ("T09", "W", "Gaia3"),
                        ("Y28", "t", "PPMXL"), ("309", "q", "UCAC4")]:
    prg = "&" if stn == "309" else None
    print(stn, V(obsCode=stn, jd_tdb=jd, catalog=code, program=prg),
               V(obsCode=stn, jd_tdb=jd, catalog=name, program=prg))
568 1.5 0.1
T09 1.5 0.1
Y28 1.5 0.3
309 1.5 0.3

So a Gaia-referenced observation from 568 is weighted at 1.5″ instead of 0.1″ — 15× too loose,
225× in the weight.

Impact

Small in practice, and I would rather report that than overstate it. Measured over a 2.5%
shard sample of the MPC archive as ingested for a full-catalogue fit:

observations sampled σ changes if the code is decoded mean σ as-is mean σ decoded
numbered 13,272,316 3,345 (0.025%) 0.7887″ 0.7884″
unnumbered 623,714 1,297 (0.208%) 0.5946″ 0.5922″

Station 568 dominates the affected set. The reason the exposure is so low is that the two
largest catalogue classes in the archive — Gaia DR2 (V) and Gaia EDR3 (X), together 43% of
numbered and 39% of unnumbered observations — are not in MPC_CATALOGS at all, so they take
the generic elif catalog: 1.0 branch either way.

It did not move any result we depend on. It is still wrong, and it will matter more as the
Gaia-referenced fraction from those specific stations grows.

Suggested fix

Mirror debias() — normalise the input before the comparisons:

from layup.utilities.debiasing import MPC_CATALOGS
_CODE_TO_NAME = {v: k for k, v in MPC_CATALOGS.items()}
catalog = _CODE_TO_NAME.get(catalog, catalog)   # code -> name; a name passes through

Two things worth deciding at the same time:

  1. MPC_CATALOGS has no entry for Gaia DR2 (V), Gaia EDR3 (X), UCAC-5 (Y) or ATLAS-2
    (Z). For debiasing that is correct — the Farnocchia tables have no column for them and
    Gaia-referenced astrometry needs no correction — but the Veres model does want to
    distinguish them, so the σ path needs its own code→name map rather than borrowing the
    debiasing one.
  2. "Gaia3E" appears in the σ branches but not in MPC_CATALOGS, so the two modules disagree
    on the naming already.

Version

main @ b6d7edd.

Surfaced while reconstructing how a full-MPC catalogue fit was weighted.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions