calamari.plot.chi_map_grid#
- calamari.plot.chi_map_grid(measurements, *, component='real', units='emu_per_oe', sample=None, source='auto', frequency=None, family='auto', family_values=None, scan_axis=None, n_scan=None, gridding='bin', max_gap=None, outliers='warn', outlier_threshold=20.0)#
Build a chi(T, H)
PlotGridfrom a family of sweeps.Input is EITHER a set of field sweeps each at fixed temperature OR a set of temperature sweeps each at fixed field (auto-detected per sweep, unanimity required); the result lives on the same T-H plane either way. Each sweep’s 1-D data comes from
chi_series(), so units, the explicit AC/DC source, housekeeping exclusion and NaN dropping behave exactly as in the 1-D plots – and every sweep must resolve to the same quantity, or the family is refused by name (a grid mixing chi’ rows with M/H rows under one colourbar is the lie this check exists for).gridding='bin'(default) makes each cell the unweighted mean of the real points falling in it; empty cells are NaN and stay visible. It never asserts a value where nothing was measured, which is why it is the default: interior gaps, dropped-NaN samples, repeat rows and the M/H zero-field hole all come out as honest holes or honest averages with no tuning constant.countsrecords how many points each cell holds;errors(when every sweep carries per-point errors) is the standard error of the cell mean – note this is an unweighted reduction, not the Birge-weighted combination ofcalamari.repeats; aggregate repeats upstream first when that treatment matters.gridding='interp'linearly interpolates each sweep onto the axis instead and requiresmax_gap(scan-axis units): how far apart two samples may be before the space between them is a hole rather than a line is a judgement about your sampling, and there is no evidence from which calamari could default it.Refused by name: fewer than two sweeps; mixed scan kinds (a single file of stacked isotherms splits with
calamari.sweeps.split_isotherms()); a sweep whose fixed parameter drifts (seeplot_family()); two sweeps at the same identical finite fixed value (distinct close coordinates are accepted); a non-monotonic scan axis (a hysteresis loop – take a branch first); more than one AC frequency withoutfrequency=.Parameters largely mirror
chi_series()(component,units,sample,source) andplot_family()(family,family_values);scan_axisgives explicit common axis centres (finite, strictly increasing, at least two),n_scanan integer count of at least two for the automatic axis (default: the median sweep point count – the densest sweep would maximise invented cells).frequencyselects one frequency from multi-frequency data and is recorded on the grid. An explicit request must be finite and positive and match exactly one recorded cluster within 0.1% of its representative, with no absolute tolerance. Missing or ambiguous matches raise.Glitches. One bad reading – an AC point that came back at minus four times its neighbours – owns a cell and, through it, the whole min-max colour range, and the map renders flat. Every point is therefore scored against its neighbours along its own sweep (
_map_outlier_scores(); the score is the departure from a straight line through the neighbours, in units of the neighbours’ own disorder about that line – the same score asMeasurement.quality()– which is what keeps a sharp physical cusp or step from being flagged while still catching a glitch on a steep flank).outlierssays what to do with a point scoring aboveoutlier_threshold(MAP_OUTLIER_THRESHOLD):'warn'(default) keeps it and warns, naming the file, the coordinates and the value so you can go and look;'drop'excludes it from the grid and the sample overlay;'ignore'keeps it silently. The flagged points are recorded ongrid.outliersin every mode, with whether they were dropped, so a figure stays auditable. Dropping is never the default: discarding a measured point changes what the figure shows, and that is your call to make with the point in front of you.- Return type: