calamari.quality.continuity_scores#
- calamari.quality.continuity_scores(ys, xs=None)#
Continuity score for every point of every series.
Each point is compared with a straight line through its
CONTINUITY_WINDOWneighbours on either side, itself excluded (so the point under test cannot drag its own reference), fitted against the matching entry ofxs– the swept quantity – or against position along the series wherexs(or its entry) is None. The departure from that line is normalised by the larger of the neighbours’ own disorder about it and a robust noise level (_MAD_TO_SIGMAx MAD of every departure, pooled across all the series passed together) – see_departures()for why a line and not a median, andCONTINUITY_THRESHOLDfor the threshold rationale. Points with fewer than two finite neighbours score NaN, and so does a NaN point.Pass the series of one family together (the map glitch check passes every sweep of a map) so the noise floor is estimated from all of them; pass one series alone to score it on its own terms.
A point that does not depart scores 0, even where the disorder and the pooled noise are both zero (“no departure, no score” rather than NaN from 0/0); one that departs from a noiseless, perfectly regular series scores inf.