DM-54923: Allow AP association to fall back to second-best match#358
Conversation
5bbfa70 to
94c2635
Compare
94c2635 to
821719b
Compare
821719b to
c5e0d60
Compare
| obj_dec = dia_objects["dec"].to_numpy()[obj_idx] | ||
|
|
||
| # Wrap RA difference to (-180, 180]. | ||
| dra = ((src_ra - obj_ra) + 180.0) % 360.0 - 180.0 |
There was a problem hiding this comment.
what's the reason to do this offset? doesn't it have the same boundary problems, just in a different location? I think we need dra to be correct even at ra=180
There was a problem hiding this comment.
I'll try to make the comment more clear. This adds 180, does the mod 360, then subtracts the 180 offset back off. This makes sure that the difference is never greater than +/-180.
There was a problem hiding this comment.
Of course! Sorry, wasn't thinking carefully enough
| var_ra = np.maximum(var_ra, sigma_floor_sq_deg) | ||
| var_dec = np.maximum(var_dec, sigma_floor_sq_deg) | ||
|
|
||
| chi2 = dra*dra/var_ra + ddec*ddec/var_dec |
There was a problem hiding this comment.
| chi2 = dra*dra/var_ra + ddec*ddec/var_dec | |
| chi2 = dra**2./var_ra + ddec**2./var_dec |
| if (self._has_position_errors(dia_sources) | ||
| and self._has_position_errors(dia_objects)): | ||
| scores = self._position_nll(dia_sources, dia_objects, src_idx, obj_idx) | ||
| # ``max_dist`` is the sole association gate: every candidate |
There was a problem hiding this comment.
I think ultimately we want to replace this with actual probabilistic association (a la NWAY) rather than using a hard max_dist cut. But no objections for now.
…s are present The associator previously ranked candidate matches by chord distance only and accepted any pair within a fixed 1" cap, ignoring per-source and per-object positional uncertainties entirely. When the uncertainty columns are missing or contain no usable values, the score reverts to the kd-tree chord distance (the previous behavior).
The previous matcher considered only each DIASource's single nearest DIAObject. When two sources competed for the same object, the loser would be unassociated and triggered a new DIAObject even if a viable second-best candidate was nearby.
…sociations This avoids the case where a further diaObject with worse coordinate errors has a lower chi-squared than a nearby diaObject with tight errors.
2d3ba31 to
5cf88d8
Compare
No description provided.