Fix Version/s: None
DM-17830 was yielding AM1 of 0 for HSC WIDE tracts 9615 and 9697 which have visits numbers in the single digits. AM1 is the median of the RMS of the distances between 2 stars in N visits. Closer inspection revealed that more than half of the RMSs were exactly zero, which is why the median was exactly zero. Michael Wood-Vasey quickly found the problem which was that if a pair appeared in exactly one visit, the stdev([one distance]) was exactly 0 and not NaN.
Require at least 2 distances before computing their stdev.
Michael Wood-Vasey will investigate the potential bias is in the median RMS as a function of N.
This change will increase our reported AMx reported in squash.
Do you want to review? I spent 5 minutes looking at what it'd take to build something that quacked like a matchedDataset to test the whole amx calculation, but it looked like it'd be an endeavor. I can file a ticket for that.
It looks like only one line changed. It's probably worth a comment above that saying why 1 is the correct choice.
Yes, this was my fault. I thought that numpy.std used 1/(n-1) and would return NaN for n=1. But I did not test this implicit assumption.
I suggest we require 2 values and then return n/(n-1) * np.std(...) to correct the bias.
DM-18751 to do this and will implement later today.