You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current Problem:DAOStarFinder(data - median) is used for detection, but _calculate_hfd(data, sources, median) passes the raw, un-subtracted data array and manually subtracts the background in a local slice.
Update Needed:
Calculate bg_subtracted_data = data - median globally right after computing sigma_clipped_stats.
Pass bg_subtracted_data directly into DAOStarFinder.
Update the signature of _calculate_hfd to accept bg_subtracted_data and remove the background_median argument entirely. Slices inside _calculate_hfd must come directly from this pre-subtracted array.
2. Upgrade Color Channel Reduction to True Luminance (CIE Weights)
Current Problem:data = data.mean(axis=channel_axis) weighs Red, Green, and Blue channels uniformly, which degrades star profiles on color frames.
Update Needed: Replace uniform averaging with a standard CIE luminance dot product ($Y = 0.299R + 0.587G + 0.114B$) when processing a 3-channel array. If the channel axis is at index 0, properly reorient or handle the axis shift before applying the matrix weights.
3. Update Star Roundness to Track Maximum Asymmetry
Current Problem: The code concatenates roundness1 and roundness2 and takes the uniform np.mean(), which dilutes and hides directional tracking errors (like a sudden wind gust or periodic error along one axis).
Update Needed: Change the aggregation logic from np.mean() to np.max(). The final star_roundness metric must reflect the maximum absolute asymmetry detected across the profiles to ensure strict quality control on tracking.
4. General Cleanup & Performance Guardrails
Ensure that clipping negative pixels to zero (cutout[cutout < 0] = 0) happens safely on an explicit copy of the array slice inside _calculate_hfd to prevent modifying or raising warnings on view slices.
Ensure type casting to standard Python floats/ints remains intact before writing to the database dictionary wrapper.
Required Changes
1. Fix HFD Double-Background Subtraction & Centroid Mismatch
DAOStarFinder(data - median)is used for detection, but_calculate_hfd(data, sources, median)passes the raw, un-subtracted data array and manually subtracts the background in a local slice.bg_subtracted_data = data - medianglobally right after computingsigma_clipped_stats.bg_subtracted_datadirectly intoDAOStarFinder._calculate_hfdto acceptbg_subtracted_dataand remove thebackground_medianargument entirely. Slices inside_calculate_hfdmust come directly from this pre-subtracted array.2. Upgrade Color Channel Reduction to True Luminance (CIE Weights)
data = data.mean(axis=channel_axis)weighs Red, Green, and Blue channels uniformly, which degrades star profiles on color frames.0, properly reorient or handle the axis shift before applying the matrix weights.3. Update Star Roundness to Track Maximum Asymmetry
roundness1androundness2and takes the uniformnp.mean(), which dilutes and hides directional tracking errors (like a sudden wind gust or periodic error along one axis).np.mean()tonp.max(). The finalstar_roundnessmetric must reflect the maximum absolute asymmetry detected across the profiles to ensure strict quality control on tracking.4. General Cleanup & Performance Guardrails
cutout[cutout < 0] = 0) happens safely on an explicit copy of the array slice inside_calculate_hfdto prevent modifying or raising warnings on view slices.