SAGUARO-MMA / kne-cand-vetting

BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

fix uncertainty calculation in stack_photometry #20

Closed griffin-h closed 5 months ago

griffin-h commented 5 months ago

We currently have two different calculations of the uncertainty for binned ATLAS photometry, and I think both are slightly wrong.

The first is from the original ATLAS code, which uses Σσ / N^1.5, where σ are the uncertainties on the N original points.

The second, which we introduced, is (Σσ^2)^0.5, which correctly adds the uncertainties in quadrature but doesn't divide by the number of points.

I removed the duplicate calculation and replaced them both with (Σσ^2)^0.5 / N.

I also removed the old_div function, which was probably a remnant of some previous Python 2 to Python 3 conversion. Because ATLAS reports their fluxes as whole numbers of μJy, using the old divide function could introduce rounding errors. (In practice, this didn't happen, because the ATLAS code to read the forced photometry files converted all numbers to floats.)