Skip to content

Use MPC/Halley–Marcus photometry by default for comets - #39

Draft
ColinOrionChandler wants to merge 4 commits into
mainfrom
codex/mpc-halley-marcus-main
Draft

ColinOrionChandler wants to merge 4 commits into
mainfrom
codex/mpc-halley-marcus-main

Conversation

@ColinOrionChandler

@ColinOrionChandler ColinOrionChandler commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Comet runs currently use the distance-only magnitude law and ignore the MPC comet brightness exponent. This makes ponder --comet and run_ponder(..., comet=True) use MPC H/G plus the Schleicher–Marcus (Halley–Marcus) dust phase function inside Sorcha, before noise and detection cuts. --comet-photometry legacy preserves the distance-only law; asteroid photometry stays unchanged.

Depends on dirac-institute/sorcha-addons#42. Ponder temporarily pins the tested add-on commit 7cfc0e9f173cc194379991f75d468c4cc482cd13 in its runtime dependencies, so installing this branch obtains the new model automatically. The integration CI installs Ponder normally and verifies the model is present. Replace this source pin with the released minimum version before publishing a Ponder package release. Both PRs remain drafts; no merge or release is part of this update.

  • Pass H through ordinary physical inputs and G through per-chunk complex-parameter sidecars. Missing/nonfinite G becomes 4 with an explicit comet_G_assumed flag; missing H stays unknown.
  • Derive a compatible Sorcha config, reject conflicting phase/activity/lightcurve models, bypass comet saturation and conservative preliminary culling, and retain configured downstream selection.
  • Separate outputs and resume state by a model/configuration/dependency fingerprint. H/G updates trigger historical reruns, preventing reuse of old magnitudes. Record assumptions and the effective config in photometry.json.
  • Add real external-ephemeris Sorcha subprocess comparisons, default/legacy coverage, missing-input handling, chunk alignment, and incremental-state tests. Dedicated integration CI checks that a normal Ponder install provides the pinned companion model, so its integration tests cannot silently skip.

This photometry branch is based directly on main and incorporates its subsequent ASSIST >= 1.2.3 requirement. It excludes the earlier update-mode, NEO, reporting, and generated-data changes on codex/mpc-halley-marcus; that branch remains an intact development snapshot.

Validation: 57 tests passed with a fresh installation of this branch and its pinned add-on, including real Sorcha magnitude and selection checks; Black 23.7.0, isort 5.12.0, pyproject validation, and git diff --check passed. The installed local commit hook could not start because Python 3.11 is unavailable, so the formatters and tests were run directly with the isolated Python 3.13 environment.

Scientific scope: dust-dominated total magnitudes, catalog H treated as zero-phase H_r, fixed Rubin colors, no aperture/point-source recalibration or outburst/gas model. Steep catalog G extrapolated to distant inactive comets can yield extreme faint magnitudes; no separate nucleus contribution is included. The calculation is numerically tested, but accuracy against observed comet photometry has not yet been established. README and docs/comet-photometry.md document the equation, migration, selection settings, and scientific limits. For completeness-focused searches, the guide recommends considering retention of all geometrically eligible comets, including faint and unknown predictions, without magnitude-based exclusion. It also gives a repeatable independent-model and observational validation checklist.

Independent spot check (2026-11-08): 12 comet/epoch cases reproduce Horizons within printed rounding with matched parameters and no phase term; Kete 1.1.0 agrees to floating-point precision. Eight saved Sorcha rows replay exactly, and substituting Horizons geometry changes predictions by less than 0.001 mag. The HM curve agrees with Lowell’s published table to sbpy’s storage precision. Large MPC/JPL H/G disagreements remain, including a 19.6-mag phase-free offset for P/2009 WX51; these model checks do not establish observational accuracy. The comparison CSV, software summary, and selected source records are preserved under docs/validation/.

Documentation update validation: local Markdown links, archived comparison integrity, and git diff --check passed; the existing real-Sorcha test for retention with selection disabled and rejection after a magnitude cut passed (1 test). The local commit hook failed while installing its formatter environment because the home filesystem was full; this documentation commit used the direct checks above.

@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.84211% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.24%. Comparing base (f937ff6) to head (2eddee1).

Files with missing lines Patch % Lines
src/ponder/comet_photometry.py 95.91% 2 Missing ⚠️
src/ponder/runner.py 98.09% 2 Missing ⚠️
src/ponder/utils.py 93.75% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
+ Coverage   84.70%   89.24%   +4.54%     
==========================================
  Files           5        6       +1     
  Lines        1327     1488     +161     
==========================================
+ Hits         1124     1328     +204     
+ Misses        203      160      -43     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant