AutoProf can fail when the input image contains NaNs, even when they are covered by the supplied mask. The mask is read correctly and applied, but _iso_extract() can still return non-finite flux values.
The core issue appears to be in _iso_extract:
- Flux is sampled/interpolated from the raw image first.
- The mask is then evaluated only at the rounded sample coordinates.
- With Lanczos/bicubic interpolation, the interpolation kernel can include nearby NaN pixels.
- As a result, NaNs can enter downstream FFT, quantile, interpolation, and median calculations.
In principle, this should affect all call sites, e.g., center finding, initialization, isophote fitting, and profile extraction. The leak is not limited to NaN. Pixels that are supposed to be masked now enter the sample and bias the results. NaN happens to be the most catastrophic case and gets caught. My observed failure case was in the center finding step, where Center_HillClimb tried to convert NaN to an integer.
AutoProf can fail when the input image contains NaNs, even when they are covered by the supplied mask. The mask is read correctly and applied, but
_iso_extract()can still return non-finite flux values.The core issue appears to be in
_iso_extract:In principle, this should affect all call sites, e.g., center finding, initialization, isophote fitting, and profile extraction. The leak is not limited to NaN. Pixels that are supposed to be masked now enter the sample and bias the results. NaN happens to be the most catastrophic case and gets caught. My observed failure case was in the center finding step, where
Center_HillClimbtried to convert NaN to an integer.