calamari.quality.QualityReport#

class calamari.quality.QualityReport(path, threshold, rows)#

Bases: object

What a file says about the trustworthiness of each of its points.

Returned by Measurement.quality(); see calamari.quality for what is a gate and what is evidence, and why.

path#

The file the report describes.

Type:

pathlib.Path or None

threshold#

The continuity score above which a point is flagged.

Type:

float

rows#

One row per scored point, indexed by the point’s row label in Measurement.data (so m.data.loc[report.flagged.index] is the raw rows). Columns are QUALITY_COLUMNS:

family, frequency_hz

The series the point was scored in: a measurement family ('VSM', 'DC', 'AC') and, for AC, one frequency. Each series is scored on its own, in file order. Scored together, a combined run’s interleaved rows would put the other family’s (or frequency’s) values among every point’s neighbours, and their offset would set the neighbours’ spread – hiding real glitches in either.

signal, value, error

The accessor scored ('moment_emu' or 'chi_real'), its value and paired standard error at this point.

continuity_score, flagged

The gate: continuity_scores(), and whether it exceeds threshold.

err_ratio

error over the median of its neighbours’ errors. Large on a glitch – and on the first point of every field scan.

T_spread_K, T_spread_ratio, H_spread_Oe

Max minus min temperature and field over the point (the MPMS3 Min./Max. columns), and the temperature spread relative to the neighbours’. In settled measurements the temperature spread is a stability figure, not ramp information.

fit_quality

The instrument’s own fit quality (0-1) for the moment column in use: DC Free Fit for the free-centre moment, DC Fixed Fit for the fixed-centre one. Follows with_moment(). NaN for VSM and AC, which have none.

status_departure

Status columns whose value at this point differs from the file’s usual value for this family, as "<column>=<value> (usual <value>)" joined by "; ", or "". Never read against a fixed “0 = OK”: on real files 1 is the normal value of several codes.

range_change

Whether the SQUID range differs from the previous point of the series.

Type:

pandas.DataFrame

property flagged: DataFrame#

The flagged points only – the rows worth a second look.

summary()#

Counts for a catalog row: how much of this file deserves a look.

Keys: n_scored, n_flagged, max_continuity_score, n_status_departures, n_range_changes, fit_quality_min, T_spread_max_K. A value the file cannot supply (no fit-quality column, no Min./Max. columns) is None, never 0 – “none recorded” and “none found” are different answers.

Return type:

dict