Host galaxy association module#411
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new host-galaxy association utility (DLR + Bayesian scoring) and wires it into the ZTF/LSST enrichment workers, driven by new config options and LS_DR10 crossmatches.
Changes:
- Introduces
utils::hostwith DLR computation, candidate scoring, and association output structs. - Stores
host_galaxyassociation results back into alert documents during ZTF/LSST enrichment when enabled. - Extends
config.yamlcrossmatch configuration to includeLS_DR10and adds ahost_galaxyconfig block.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/utils/mod.rs |
Exposes new host utility module. |
src/utils/host.rs |
Implements host association logic + unit tests. |
src/enrichment/ztf.rs |
Projects cross_matches, runs host association, writes host_galaxy into Mongo updates. |
src/enrichment/lsst.rs |
Runs host association from cross_matches, writes host_galaxy into Mongo updates. |
src/enrichment/mod.rs |
Re-exports host association types. |
src/conf.rs |
Adds host_galaxy to AppConfig. |
config.yaml |
Enables host association and adds LS_DR10 crossmatch configs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@mcoughlin I've opened a new pull request, #412, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Theodlz
left a comment
There was a problem hiding this comment.
Just wondering, because that is not in the PR description. How is this meant to be used? Right now we crossmatch with NED for example, nothing fancy. I want to figure out how we don't end up with too many places for people to look at potential host galaxies.
First off, since this is purely positional (I suppose?), shouldn't we have that info at the object level? If so, and since the crossmatches need to happen just once per object and we do this in the alert worker, should we move that there? Then in the enrichment worker, we could just compute a hosted boolean feature (ala star, near brightstar) and use that to build the babamul topics for example?
|
Throughput results (
|
|
Throughput results (
|
|
Throughput results (
|
|
Throughput results (
|
|
Throughput results (
|
|
Throughput results (
|
#412) Non-finite `shape_e1`/`shape_e2` (NaN, ±∞) would pass through the existing `shape_r` guard and propagate NaN into `axis_ratio`, `b_arcsec`, DLR, and Bayesian posteriors — since `e.min(0.999)` and `f64::max` do not suppress NaN. ## Changes - **Early rejection**: return `None` when `shape_e1` or `shape_e2` are non-finite, before any arithmetic. - **Post-computation guard**: return `None` if derived `q`, `a_arcsec`, or `b_arcsec` are non-finite or ≤ 0 (defensive against edge cases like a NaN `min_b`). - **Tests**: `test_tractor_shape_non_finite_ellipticity` covering NaN `e1`, NaN `e2`, both NaN, `+∞ e1`, `−∞ e2`. ```rust // Before: NaN silently propagated let e = (shape_e1 * shape_e1 + shape_e2 * shape_e2).sqrt(); // NaN if inputs are NaN let e_clamped = e.min(0.999); // NaN.min(0.999) == NaN // After: reject early if !shape_e1.is_finite() || !shape_e2.is_finite() { return None; } // ...and defensively after derivation: if !q.is_finite() || q <= 0.0 || !b.is_finite() || b <= 0.0 { return None; } ``` <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/boom-astro/boom/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mcoughlin <2291947+mcoughlin@users.noreply.github.com>
|
@Theodlz The idea is that GHOST gives you a metric to associated transients with hosts that understands morphology. Because most galaxies are ellipses on the sky, shape matters a lot when doing the association. |
|
Throughput results (
|
|
Throughput results (
|
|
Throughput results (
|
|
Throughput results (
|
This PR adds a host galaxy association module with DLR + Bayesian scoring.
Based on implementation in https://github.com/alexandergagliano/Prost.