Hi all,

I’m trying to get my head around what’s going on in the pipe_tasks/photoCal.py as the uncertainties we’re getting on our mags are too small (compared to their standard deviation from reference sources), so I’m putting out a request for a little help.

As I understand it from the top line description in `getZeroPoint`

, it should return the zeropoint, the width of the (src - ref) distribution, and the number of good points (after sigma clipping). Indeed, that does seem to what happens if `ngood == 0`

at line 689. Otherwise, the sigma it returns is the inverse sqrt of sum(1/error**2), where error is, I believe, the error due to photon counting statistics. I’m struggling to work out how the latter gives a good estimate of the width of the (src-ref) distribution.

I can see how the latter would hold if photon statistics were the *only* source of errors, but that’s rarely (never?) the case in my experience!

We get far more appropriate errors if we instead adopt `sigma=sig`

on line 707, which would return an estimate of the width of the (src-ref) distribution (as on line 689).

What am I missing?

Thanks,

James