Skip to content

Feature/aperture photometry#125

Closed
capetillo wants to merge 7 commits into
mainfrom
feature/aperture-photometry
Closed

Feature/aperture photometry#125
capetillo wants to merge 7 commits into
mainfrom
feature/aperture-photometry

Conversation

@capetillo

@capetillo capetillo commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

FEATURE: Aperture Photometry Operation

Background:
Rachel requested aperture photometry as an operation. In adding this operation, centroiding was refactored.

Implementation:

  • Adds an aperture photometry data operation that generates light curve rows, comp star metadata, diagnostics, and diagnostic JPEG for each input file with overlays where the target and comp stars are circled
  • Aperture photometry logic is broken up into utils for light curve generation, comp star selection, photometry logic, geometry, and diagnostics
  • Ranks comp stars using brightness similarity and proximity to the target (following AstroImageJ's weighting logic)
  • Refactors centroiding logic into a shared utility so both the centroiding endpoint and aperture photometry use the same centroiding logic

NOTE
I see that for elp1m008-fa16-20250705-0217-e91 we are getting nan under catalog flux and catalog mag for a comp star @sfoale any thoughts?
Screenshot 2026-07-06 at 3 04 04 PM

capetillo and others added 7 commits May 5, 2026 11:16
…prove target measurement in extended fields.

Improve target measurement for sources blended into extended light
(e.g. supernovae on a host galaxy):
- Accept a centroid only within 6px of the WCS-predicted position;
otherwise (or on centroid failure) measure at the source's provided
coordinates, so the centroid won't be pulled onto a brighter
neighbour or galaxy structure. Records a per-frame diagnostic.
- Skip frames whose catalog lacks RA/Dec/mag instead of aborting.
- Establish comparison stars at >=80% frame coverage rather than 100%.

Extract a Django-free AstroImageJ equivalent centroid and sigma-clipped annulus
background into analysis/centroiding_core.py; centroiding.py maintains the
Django view. The aperture photometry pipeline and the interactive
centroiding endpoint then share one common implementation (verified faithful
to AstroImageJ's Centroid). Collapse three duplicate background
estimators into one, using AIJ's convergence (100/1e-4) for
photometry and its centroid convergence (9/0.1) for centroiding.

Remove dead code (comparison_strategy, FrameResult, unused helpers and
fields) and redundant calibration intermediates. Add characterization
and synthetic regression tests.
…option

Comparison-star selection ranked candidates by |catalog_mag - target_proxy|,
comparing a calibrated catalog magnitude against an instrumental target proxy on
a different zero point. That zero-point offset collapsed the ranking to pick

Rank comparison stars by measured brightness and add arcsec aperture option

Comparison-star selection ranked candidates by |catalog_mag - target_proxy|,
comparing a calibrated catalog magnitude against an instrumental target proxy on
a different zero point. That zero-point offset collapsed the ranking to "pick
the brightest catalog star" instead of stars matching the target's brightness.
Rank instead on each candidate's own measured magnitude (median over
frames), which shares the target proxy's zero point. The catalog magnitude is
still used, correctly, only for the ensemble zero-point calibration.

Because that allows a blended/mismatched candidate with a corrupt catalog magnitude
to bias the catalog magnitude weighted zero point, add a guard that drops
candidates whose (catalog_mag - measured_instrumental_mag) departs from the
ensemble median by more than MAX_ZERO_POINT_RESIDUAL_MAG.

Add an aperture_unit="px"|"arcsec" option to generate_light_curve. With "arcsec"
the aperture is an angular size converted to pixels per frame from its plate
scale (WCS, PIXSCALE fallback), so a fixed aperture covers the same sky across
telescopes of differing pixel scale.

Reword the target recenter fallback diagnostics from "recenter rejected" to
"recenter skipped ... Frame retained" so they are not misread as frame drops:
the frame is always measured at the WCS position and kept.
@capetillo capetillo closed this Jul 7, 2026
@capetillo
capetillo deleted the feature/aperture-photometry branch July 7, 2026 16:53
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