Skip to content

Support DiaObject catalogs#104

Merged
hombit merged 1 commit into
mainfrom
dia-object-support
Jul 20, 2026
Merged

Support DiaObject catalogs#104
hombit merged 1 commit into
mainfrom
dia-object-support

Conversation

@hombit

@hombit hombit commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds support for the Rubin DiaObject catalog so a model trained on the Object catalog can be applied to diaObjectForcedSource light curves.

obj="dia" opens dia_object_collection / diaObjectForcedSource (both img="cal" psfFlux and img="diff" psfDiffFlux). The per-source model features (flux/err, visit-derived skyBg/seeing/expTime, detector geometry, one-hot bands) come through unchanged. The two object-level features DiaObjects lack are handled as:

  • object_mag — derived from {band}_scienceFluxMean via the new flux2mag; not required for dia (undefined values kept), since it does not affect the whitening.
  • extendedness — set to 0.0 (point-source assumption), with a TODO to cross-match the science Object catalog for the real per-object value.

Changes

  • datasets/rubin_dp.py: obj="dia" branches in _open_catalog; _normalize_dia_object_columns; relaxed the object_mag dropna for dia.
  • utils/mag_flux.py: add flux2mag (inverse of mag2flux).
  • pipelines/train_on_rubin_dp.py: ignore missing coord_ra/coord_dec (DiaObject uses ra/dec).
  • scripts/plot_reduced_chi2.py, scripts/plot_kl.py: --obj/--img overrides.

Notes

…rcedSource)

- rubin_dp.py: obj="dia" opens dia_object_collection / diaObjectForcedSource
  (cal and diff photometry). Object-level psfMag/extendedness are absent, so
  object_mag is derived from {band}_scienceFluxMean and extendedness is set to
  0.0 (point-source assumption; TODO: cross-match the science Object catalog
  for a real per-object extendedness). The object magnitude is not required for
  dia, since it does not affect the whitening.
- mag_flux.py: add flux2mag (inverse of mag2flux).
- train_on_rubin_dp.py: ignore missing coord_ra/coord_dec when dropping columns
  (the DiaObject catalog uses ra/dec instead).
- scripts/plot_reduced_chi2.py, scripts/plot_kl.py: add --obj/--img overrides so
  a trained model can be applied to a different catalog/photometry type.
@hombit
hombit enabled auto-merge July 20, 2026 18:42
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 38.46154% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.99%. Comparing base (008ec4d) to head (7c409a0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/uncle_val/datasets/rubin_dp.py 36.36% 14 Missing ⚠️
src/uncle_val/utils/mag_flux.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #104      +/-   ##
==========================================
- Coverage   53.22%   52.99%   -0.24%     
==========================================
  Files          32       32              
  Lines        2018     2040      +22     
==========================================
+ Hits         1074     1081       +7     
- Misses        944      959      +15     

☔ 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.

@hombit
hombit merged commit ee26e2c into main Jul 20, 2026
6 of 8 checks passed
@hombit
hombit deleted the dia-object-support branch July 20, 2026 18:46
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