Skip to content

Fix comparison-star duplicates from cross-site astrometry - #133

Open
sfoale wants to merge 1 commit into
mainfrom
fix/comparison-star-duplicates-and-extrapolation
Open

Fix comparison-star duplicates from cross-site astrometry#133
sfoale wants to merge 1 commit into
mainfrom
fix/comparison-star-duplicates-and-extrapolation

Conversation

@sfoale

@sfoale sfoale commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

A multi-telescope series disagrees on catalog positions by one to two arcsec frame to frame, which the 1.0 arcsec cross-match radius read as different stars. One star became several candidates, all of which centroided back onto it, so the ensemble filled with copies reporting identical counts, and each fragment made the others look unisolated. On a 13-frame Kleopatra set spanning five telescopes, 8 of the 10 selected comparison stars were four duplicated pairs.

Widen the radius to 2.5 arcsec, match each row to its nearest cluster rather than the first within range, carry the cluster position as the mean of its rows, and merge clusters closer together than one aperture radius, which centroiding cannot separate in any case. The same set now selects 10 distinct stars, all catalogued on every frame, with isolation distances of 9.6 to 54.7 arcsec rather than 1.0 to 1.8.

Also report when the target falls outside the comparison ensemble's magnitude range, where its calibrated magnitude is extrapolated from the zero point rather than interpolated within it.

A multi-telescope series disagrees on catalog positions by one to two
arcsec frame to frame, which the 1.0 arcsec cross-match radius read as
different stars. One star became several candidates, all of which
centroided back onto it, so the ensemble filled with copies reporting
identical counts, and each fragment made the others look unisolated. On
a 13-frame Kleopatra set spanning five telescopes, 8 of the 10 selected
comparison stars were four duplicated pairs.

Widen the radius to 2.5 arcsec, match each row to its nearest cluster
rather than the first within range, carry the cluster position as the
mean of its rows, and merge clusters closer together than one aperture
radius, which centroiding cannot separate in any case. The same set now
selects 10 distinct stars, all catalogued on every frame, with isolation
distances of 9.6 to 54.7 arcsec rather than 1.0 to 1.8.

Also report when the target falls outside the comparison ensemble's
magnitude range, where its calibrated magnitude is extrapolated from the
zero point rather than interpolated within it.

@jnation3406 jnation3406 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine overall to me. One day when we aren't working on different branches we should try to unify the catalog matching / nearest source code so we don't have so many different versions.

for row in rows:
nearest = -1
if cluster_ra.size:
separations = angular_distances_arcsec(row["ra_deg"], row["dec_deg"], cluster_ra, cluster_dec)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is very similar to the find_nearest_source function in catalog_utils.py, but that is in my hr_diagram branch for now. We may want to refactor later to re-use code for all the things doing nearest matching on catalogs.

This function also looks a lot like minimum_neighbor_distances_arcsec from geometry.py. Claude says that can be sped up a ton by using astropy's match_to_catalog_sky to do the MxN catalog nearest neighbor matching using a KD-tree instead of the full MxN looping. But maybe you've already considered these things.


def _extrapolated_target_diagnostic(frame_calibrations: Mapping[str, FrameCalibration]) -> str | None:
"""
Says so when the target falls outside the comparison stars' magnitude range, where its

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Reports when" vs "Says so when"

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.

2 participants