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) PlotGrid from 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. counts records 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 of calamari.repeats; aggregate repeats upstream first when that treatment matters. gridding='interp' linearly interpolates each sweep onto the axis instead and requires max_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 (see plot_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 without frequency=.

Parameters largely mirror chi_series() (component, units, sample, source) and plot_family() (family, family_values); scan_axis gives explicit common axis centres (finite, strictly increasing, at least two), n_scan an integer count of at least two for the automatic axis (default: the median sweep point count – the densest sweep would maximise invented cells). frequency selects 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 as Measurement.quality() – which is what keeps a sharp physical cusp or step from being flagged while still catching a glitch on a steep flank). outliers says what to do with a point scoring above outlier_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 on grid.outliers in 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:

PlotGrid