Electron Microscopy Studio · Methods
Methods and their references
Applies to Electron Microscopy Studio 2.6 and later
Each function the app computes itself, the reference it is checked against and how closely. 184 functions in 24 groups, from the app's parity table at 2.6.0.
The rule is the same for every row: the app matches the pinned version of the Python package within the tolerance that package's own tests use, never stricter. Readers, indices and metadata match exactly. Where a method has a paper, the reference names it. The numbers of the kits the app is built on are listed on the kits page, each with its own parity table.
Generated from docs/parity.md at v2.6.0, which also gives each row's test and notes. The page's tables leave those out.
Readers (exact)
| Function | Reference | Tolerance |
|---|---|---|
EBSDH5Reader.read (kikuchipy h5ebsd) | kikuchipy.io.plugins.kikuchipy_h5ebsd.file_reader | header fields, static background and patterns exact; PCs exact |
EBSDH5Reader.read (Bruker h5ebsd) | kikuchipy.io.plugins.bruker_h5ebsd.file_reader | exact |
EBSDH5Reader.read (EDAX h5ebsd) | kikuchipy.io.plugins.edax_h5ebsd.file_reader | exact; PC converted TSL to Bruker |
EBSDH5Reader.read (Oxford H5OINA 6.0 and 7.0) | kikuchipy.io.plugins.oxford_h5ebsd.file_reader | fields exact; tilts exact (the file's float32 radians converted as numpy's float32 rad2deg, x * 180 / pi, then - 90 in float32 for the detector tilt); PC converted Oxford to Bruker |
EBSDDetectorGeometry.brukerCenter / center | EBSDDetector._get_pc_in_bruker_convention, _get_pc_in_convention | 1e-12 |
EDAXBinaryReader.read, pattern, allPatterns (EDAX .up1/.up2) | kikuchipy.io.plugins.edax_binary.file_reader | header fields and patterns exact |
ANGReader.read (.ang maps: EDAX TSL, EMsoft, ASTAR, orix) | orix.io.plugins.ang.file_reader | columns bit-exact (sha256 of the float64 columns); header fields exact; shape and step exact |
OxfordBinaryReader.read, metadata (Oxford .ebsp) | kikuchipy.io.plugins.oxford_binary.file_reader | version, shapes, steps, positions, file order exact; every pixel bit-exact (EBSDDataset.allPatterns, EBSDPatternReader.row, pattern) |
CTFReader.read (.ctf maps: Oxford, Bruker, ASTAR, EMsoft, MTEX; headerless orientation tables) | orix.io.plugins.ctf.file_reader; orix.data.ti_orientations | phases, Laue group, phase ids exact; coordinates, Euler angles (radians of the file's degrees) and columns at 1e-12; shape and steps exact |
EBSDH5Reader.readOxfordMap (Oxford H5OINA without patterns: AZtec's map export) | the H5OINA specification (oinanoanalysis/h5oina, H5OINAFile.md); MTEX's hdf5 config (grid from the header's cells and steps, row by row); DREAM3D EbsdLib H5OINAReader (Laue ids as the .ctf's, points placed by X and Y); kikuchipy 0.13.1 and orix 0.15.0 read no H5OINA map | exact (every planted value exact in float32) |
EBSDH5Reader.readOrixMap (orix's own HDF5 map file, orix.io.save; kikuchipy's dictionary indexing saves its maps so) | orix.io.plugins.orix_hdf5.file_reader (orix 0.15.0, dict2crystalmap) | exact: points in data, phase ids, x, y, the stored Euler angles, properties, phases, unit; the cell within 1e-12 relative (diffpy recomputes it from its base, the file stores it as given) |
EBSDH5Reader.readVendorMap (Bruker Esprit h5ebsd saved without patterns, and the map beside Bruker patterns) | orix.io.plugins.bruker_h5ebsd.file_reader (orix 0.15.0) | exact: phase ids, x, y, Euler angles (np.deg2rad of the float32 columns, in float32), the thirteen properties, phases, unit; the cell within 1e-12 relative (diffpy) |
EBSDH5Reader.readVendorMap (EDAX OIM h5ebsd saved without patterns, and the map beside EDAX patterns) | orix.io.plugins.ang.file_reader (orix 0.15.0) on the .ang OIM writes for the same scan; no Python reader reads the .h5 map (MTEX and DREAM3D's EbsdLib do) | exact |
EBSDH5Reader.readVendorMap (EMsoft dictionary indexing file, EMEBSDDI) | orix.io.plugins.emsoft_h5ebsd.file_reader (orix 0.15.0, refined=False, its default) | exact |
EBSDH5Reader.read (Oxford H5OINA: the patterns kikuchipy does not read, the map beside them) | kikuchipy.io.plugins.oxford_h5ebsd.file_reader with processed=False; readOxfordMap | exact (pixels, map) |
EDAXOpening.open, OxfordOpening.open (the doors) | EDAXOpening and OxfordOpening door tests | exact |
ANGReader.quaternion(fromBungeEuler:) | orix.quaternion._conversions.eu2qu (Rowenhorst et al. 2015, A.5-6) | 1e-12 relative |
NORDIFSettings.read (Setting.txt) | kikuchipy.io.plugins.nordif._get_settings_from_file | exact |
NORDIFScan.read (Pattern.dat, Background acquisition pattern.bmp) | kikuchipy.load("Pattern.dat") | patterns bit-exact (SHA-256 of the uint8 block in map order), background bit-exact |
NORDIFCalibrationPatterns.read (Calibration (x,y).bmp, positions, area, ROI, scaled to steps) | kikuchipy.load("Setting.txt") (nordif_calibration_patterns) | positions and shapes exact; patterns bit-exact |
NORDIFBitmap.decode (8-bit greyscale BMP) | matplotlib.pyplot.imread (Pillow mode L) | bit-exact |
NORDIFOpening.open (Pattern.dat as an EBSDDataset, read by record) | kikuchipy.load("Pattern.dat") through NORDIFScan | patterns bit-exact against NORDIFScan |
HyperSpySpectrumFile.header, read (.hspy: one spectrum in HyperSpy's own HDF5 layout) | rsciio.hspy.file_reader (RosettaSciIO 0.15.0, rsciio/hspy/_api.py: Experiments/<title>/data, the axis-<i> groups, the metadata tree as groups of attributes) | exact |
Pictures (PNG and JPEG)
| Function | Reference | Tolerance |
|---|---|---|
PictureImageReader.read (ImageIO's decoded samples, no drawing; grey by the brightest channel) | RosettaSciIO 0.14.0 rsciio.image.file_reader, which is imageio 2.37.4 over Pillow 12.3.0; truth written by tools/parity/picture-parity/make_fixtures.py | PNG exact per pixel (I1: grey 8 and 16 bit, RGB, RGBA, palette, Adam7, gAMA, iCCP); JPEG grey within 1 level, colour 4:4:4 within 2 (I2; two decoders, the largest difference is printed by the test); EXIF orientation 1 to 8 as Pillow's ImageOps.exif_transpose (I3) |
SEM images (TIFF)
| Function | Reference | Tolerance |
|---|---|---|
SEMImageMetadata.read (Thermo/FEI tags 34680/34682) | RosettaSciIO 0.15.0 _axes_fei, mapping_fei; tifffile 2026.10.15 read_fei_metadata | axes rtol 1e-4 (RosettaSciIO's test_read_FEI_navcam_metadata); metadata numbers 1e-9 relative, texts exact (its tests: 7 places) |
SEMImageMetadata.read (Zeiss tag 34118) | RosettaSciIO _axes_zeiss, mapping_cz_sem; tifffile read_cz_sem | the same |
SEMImageMetadata.read (Tescan tag 50431) | NexusLIMS tescan_tif (_extract_embedded_hdr pipeline, field units; transcribed in tools/parity/sem/sem-image/tescan_reference.py); no RosettaSciIO branch | exact (every section and key; values as stored, converted by NexusLIMS's factors) |
Databar rows (Thermo DatabarHeight, Tescan ImageStripSize) | tifffile's parse of the same bytes; no reader maps it | exact |
| Spot, chamber pressure, Thermo detector | tifffile's parse; RosettaSciIO does not map them | exact |
Pattern processing
| Function | Reference | Tolerance |
|---|---|---|
PatternProcessing.rescale | pattern._pattern._rescale_with_min_max | values 1e-5 relative |
PatternProcessing.removeStaticBackground / ...Values (subtract, divide, scaleBackground) | _remove_static_background_subtract / _divide | values 1e-5 relative; uint8 within one grey level on at most 1 % of a pattern's pixels (measured 22 of 3600 at worst), 0.2 % of a whole set |
PatternProcessing.meanBackground | patterns.mean(axis=0).astype(dtype) | exact |
PatternProcessing.dynamicBackground (frequency) | get_dynamic_background / filters.fft_barnes._fft_filter with _dynamic_background_frequency_space_setup | 1e-5 relative (measured 4.9e-7) |
PatternProcessing.dynamicBackground (spatial) | scipy.ndimage.gaussian_filter(sigma=std, truncate=truncate) | 1e-5 relative (measured 6.7e-8) |
PatternProcessing.removeDynamicBackground / ...Values (subtract, divide; frequency, spatial; std, truncate) | _remove_dynamic_background | as the static rows |
PatternProcessing.percentile | numpy.nanpercentile (method linear) | exact |
PatternProcessing.rescaleIntensity / ...Values (percentiles) | kikuchipy.pattern.rescale_intensity (EBSD.rescale_intensity) | uint8 within one grey level (the bundle's); measured exact on all 2 × 9 patterns |
PatternProcessing.normalizeIntensity (numStd, divideBySquareRoot) | _normalize_intensity (EBSD.normalize_intensity on float32) | rtol 1e-5, atol 1e-6 (1e-8 with the square root); measured 4.8e-7 |
PatternProcessing.downsample / bin | _downsample2d / _bin2d (EBSD.downsample) | uint8 within one grey level; measured exact for factors 2 and 3 |
NLPAR.autoMask | NLPAR.makeautomask | exact |
NLPAR.tiles | NLPAR._calcchunks | exact |
NLPAR.estimateNoise | NLPAR.calcsigma_cpu(nn=1) / sigma_numba | σ rtol 1e-5; distances rtol 1e-5, atol 1e-5 |
NLPAR.optimiseLambda | NLPAR.opt_lambda_cpu | rtol 1e-4 |
NLPAR.denoise, NLPAR.run | NLPAR.calcnlpar_cpu / nlpar_nb | rtol 1e-5, atol 1e-4 |
Orientation maths
| Function | Reference | Tolerance |
|---|---|---|
RotationConversions (eu2qu, qu2eu, om2qu, qu2om, ax2qu, qu2ax, qu2ho, ho2ax, ax2ro, ro2ax, ho2ro, cu2ho, cu2ro, pyramid) | orix.quaternion._conversions (Rowenhorst et al. 2015; cubochoric: Roşca et al. 2014) | atol 1e-7 |
Rotation (*, inverse, angle, axis, angle(with:), absDot, angleOuter, outer, unique, fromEuler/fromMatrix/fromAxisAngle/fromHomochoric/fromRodrigues and back) | orix.quaternion.Rotation, Quaternion | atol 1e-7; unique indices exact |
PointGroup (the 38 groups and 2, m, 32; fromGenerators, subgroups, properSubgroup, laue, laueProperSubgroup, system, eulerFundamentalRegion, fundamentalSectorNormals, fundamentalZoneNormals) | orix.quaternion.symmetry | elements and normals 1e-10, in orix's order; names exact |
OrientationRegion.fromSymmetry, contains, vertices | orix.quaternion.OrientationRegion | normals 1e-10 |
Orientations (reduced, angles(with:), misorientations(from:), anglesOuter, distanceMatrix), Misorientations (reduced, angles, distanceMatrix) | Orientation.reduce, angle_with, __sub__, angle_with_outer/get_distance_matrix (numba kernels), Misorientation.reduce, get_distance_matrix(lazy=False) | atol 1e-7 |
Vector3.azimuth, polar, circle(about:); StereographicProjection (vectorToXY, vectorToXYSplit, xyToVector) | Vector3d.azimuth/polar/get_circle, orix.projections.StereographicProjection, InverseStereographicProjection | atol 1e-7 |
CrystalLattice, Miller (hkl, uvw, hkil, UVTW, length, rounded, roundIndices) | orix.crystal_map.Phase structure alignment (x ∥ a, z ∥ c*), orix.vector.Miller, _round_indices (MTEX) | bases 1e-10; vectors 1e-7; rounded indices exact |
FundamentalSector (vertices, center, edges, stereographicExtent), PointGroup.projectToFundamentalSector | orix.vector.FundamentalSector, Vector3d.in_fundamental_sector (MTEX project2FundamentalRegion) | vertices and centres 1e-10; edges 1e-9; projections 1e-7 |
DirectionColorKeyTSL (color(of:), keyImage), IPFColorKeyTSL, EulerColorKey | DirectionColorKeyTSL.direction2color (Nolze & Hielscher 2016 via MTEX), IPFColorKeyTSL.orientation2color, EulerColorKey.orientation2color, Orientation.in_euler_fundamental_region | RGB 1e-6 |
OrientationSampling (semiEdgeSteps, cubochoricGrid, fundamental, local) | orix.sampling.get_sample_fundamental, get_sample_local, _cubochoric_sampling (cubochoric grid: Roşca, Morawiec and De Graef 2014; resolution to N: Singh and De Graef 2016, eq. 9) | counts and N exact; rotations atol 1e-7 in orix's order |
Crystal map
| Function | Reference | Tolerance |
|---|---|---|
CrystalMap (init with orix's phase-list matching and not_indexed, shape, dx, dy, size, ids, row, col, isIndexed, phasesInData, points(ofPhases:)/[phase:], masked, sliced(rows:columns:), mapData, orientations), PhaseList, CrystalPhase | orix.crystal_map.CrystalMap, PhaseList, Phase | exact; orientations atol 1e-7 |
OrientationMaps (raster of IPF-X, IPF-Y, IPF-Z and phase layers on the map's grid, gridShape, pointIndexGrid, readout, keyImage, unitCellEdges), the Maps room (P3-04) | CrystalMap.get_map_data of IPFColorKeyTSL.orientation2color per phase along the sample direction, and of phases.colors_rgb, as CrystalMap.plot draws them | IPF atol 1e-6; phase colours exact |
MapAnalysis (run: grain map, KAM, GOS, GND, grain table, mean lineal intercept and ASTM number, boundaryEdges, outline, slip), MapTexture (compute), the Maps room complete (P5-04, Segment) | DefDAP 1.3.1 EbsdMap.find_grains, calc_kam, calc_nye, Grain.calc_average_ori, calc_grod, calc_average_schmid_factors, calc_slip_traces; orix 0.15.0 pole_density_function, MTEX-style ODF sections (Hielscher and Schaeben 2008); ASTM E112 | grain map and sizes exact; KAM and GOS atol 1e-6 (the bundle's); slip, GND and texture the ported functions' own (exact wiring) |
NeighbourMisorientation (misorientations(of:), anglesDegrees(of:)), AngleHistogram | Orientation.__sub__ of O[:, 1:], O[:, :-1] and O[1:, :], O[:-1, :]; Misorientation.angle; numpy.histogram | misorientations and angles atol 1e-7; counts and edges exact |
IndexingComparison (the Indexing room's Compare: per-point disorientation of two results, its histogram, median and share over 2°), PointGroup.disorientationBinsTop | orix 0.15.0 Orientation.angle_with per (A phase, B phase) group (equal to Misorientation.angle for one group); numpy.rad2deg, histogram on arange(0, top + 1), median, mean(angle > 2); the bins top from OrientationRegion.from_symmetry(G, G).vertices() | outcomes, edges, counts and the share exact; angles atol 1e-7 rad (-1 in the bundle where not compared); the median atol 5.8e-6° (1e-7 rad) |
Crystal map writers
| Function | Reference | Tolerance |
|---|---|---|
ANGWriter (text(of:options:), write; Options: the four columns' properties, extra columns, the OPERATOR: line) | orix.io.plugins.ang.file_writer | bytes exact; read back within the written precision |
CTFWriter (text(of:project:author:), write) | tools/parity/sem/ctf_writer.py (no writer in the pinned stack), read back by orix.io.plugins.ctf.file_reader | bytes exact; read back within the written precision |
CrystalMapExtent | create_coordinate_arrays and get_map_data as orix's writer uses them | exact |
Grains, KAM and GOS
| Function | Reference | Tolerance |
|---|---|---|
GrainMap (init(map:) from a CrystalMap, init(euler:)), DefDAPCrystalStructure (cubic, hexagonal, init(pointGroup:), operators(for:)), DefDAPQuat (fromEuler, symmetricEquivalents, absDot), shared with the slip analysis | Quat.create_many_quats, Quat.calc_sym_eqvs, crystal.crystalStructures | quaternions atol 1e-10; tables exact |
GrainBoundaries.find (misorientation with the right and lower neighbour, grain and phase boundary images) | ebsd.Map.find_boundaries (Humphreys 2001) | images exact; angles atol 1e-7 |
GrainSegmentation.find (flood fill, minimum size, sizes, areas, equivalentCircleDiameters), neighbourNetwork | ebsd.Map.find_grains, _accelerated.flood_fill, build_neighbour_network | grain map, points in flood order, sizes, phases and network exact |
KernelAverageMisorientation.map(.defdap) | ebsd.Map.calc_kam (3 x 3 kernel, no symmetry) | atol 1e-6 rad |
KernelAverageMisorientation.map(.symmetric(thresholdDegrees:)) (the default, 5°) | the port's own definition (Wright, Nowell and Field 2011): DefDAP's four first neighbours, find_boundaries' symmetric angle, same phase only, threshold, mean of the angles; reference in grain_cases._symmetric_kam | atol 1e-6 rad |
GrainOrientationStatistics.compute (averageOrientations, grod, grodAxis, gos, averageCosine, gosMap) | Grain.calc_average_ori (Quat.calc_average_ori), calcMisOri, build_mis_ori_list, calc_grod (Wright et al. 2011) | average orientation atol 1e-10; GROD, axis, GOS atol 1e-6 rad |
GrainSegmentation.meanLinealIntercept, astmGrainSizeNumber | ASTM E112-13 (Heyn intercept; G = −6.643856 log10 ℓ − 3.288, ℓ in mm) | hand numbers, 1e-12 |
Pole figures, inverse pole figures and the ODF
| Function | Reference | Tolerance |
|---|---|---|
EqualAreaGrid (edges, centres, stereographic nodes, numpy's histogramdd bin rule) | _sample_S2_equal_area_coordinates (Rohrer et al. 2004), the x, y pole_density_function returns | atol 1e-10 |
PoleDensityFunction.counts | numpy.histogram2d of to_polar on that grid (half resolution, after in_fundamental_sector, with a symmetry) | exact, except that each vector the bundle finds within 1e-12 rad of an edge may sit one bin over (16 of 2000 {0001} poles, 5 IPF vectors; 1197 and 393 on the full map) |
PoleDensityFunction.density(counts:) (gaussian smoothing, fold into the sector, mask, mrd, log) | the rest of pole_density_function; scipy's gaussian_filter (truncate 4, wrap in azimuth, reflect in polar) | atol 1e-7 (catalogue section 5), measured 4e-14 in a Python mirror |
PoleFigures.poles / symmetrise, sampleDirections, crystalDirections | Miller.symmetrise(unique=True).unit, (~O).outer(m), O * Vector3d.zvector() | poles atol 1e-10 (as a set: orix sorts) |
OrientationDensity.values / section (kernel density on SO(3), φ2 sections) | the closed form of Hielscher and Schaeben (2008) with MTEX's de la Vallee Poussin kernel, on orix's rotations and proper symmetry elements (texture_cases.odf_values); orix has no ODF | rtol 1e-4 (brief P5-02) |
TextureRaster.stereographic, .section | none (drawing) | each pixel the value of its bin |
Slip analysis and GND density
| Function | Reference | Tolerance |
|---|---|---|
SlipSystemSet.load/parse, SlipPhase (files, plane grouping, colours, hexagonal orthonormalisation in the Oxford convention) | defdap.crystal.SlipSystem.load, group, Phase; crystal_utils.create_l_matrix, create_q_matrix, convert_idc | indices exact; unit vectors 1e-12 |
DefDAPQuat.fromEuler, averageOrientation | Quat.create_many_quats, Quat.calc_sym_eqvs, Quat.calc_average_ori | 1e-12; grain averages 1e-10 |
SlipTraceAnalysis.schmidFactors, traces | Grain.calc_average_schmid_factors, calc_slip_traces (Schmid & Boas 1935) | atol 1e-6 |
NyeTensor.compute (.separate, .defdap131) | defdap.ebsd.Map.calc_nye (Pantleon 2008; L1 norm of the nine components, Ruggles & Fullwood 2013) | rtol 1e-5, atol 1e6 m⁻² |
Patterns room
| Function | Reference | Tolerance |
|---|---|---|
EBSDBrowsing.meanIntensityMap (the navigation map) | EBSD.mean(axis=(2, 3)) (numpy's float64 mean over the two pattern axes) | rtol 1e-7 (the bundle's); exact to the map's Float rounding on the planted scan |
VirtualBSEGrid.edges / rect(of:) (the detector grid) | VirtualBSEImager.grid_rows / grid_cols / roi_from_grid sliced by HyperSpy's UniformDataAxis.value2index | exact |
VirtualBSEImaging.images (one image per detector rectangle: the tiles, an explicit ROI, the whole detector) | VirtualBSEImager.get_images_from_grid, EBSD.get_virtual_bse_intensity | exact (float64 sums of integer counts) |
VirtualBSEImaging.rgb (the colour mix) | VirtualBSEImager.get_rgb_image(normalize=True): _normalize_image then rescale_intensity | within 1 count (the bundle's atol) |
Master patterns and their projection
| Function | Reference | Tolerance |
|---|---|---|
EMsoftMasterPatternReader.read (EBSD, TKD, ECP; Lambert, stereographic; upper, lower, both; all, nearest, range of energies) | kikuchipy.io.plugins.emsoft_{ebsd,tkd,ecp}_master_pattern.file_reader | exact (values, shapes, axes, phase) |
SpaceGroupPointGroup.pointGroup | orix.quaternion.symmetry.get_point_group(n, proper=False), contains_inversion | exact, all 230 |
EBSDMasterPattern.EnergyAxis.index | hyperspy.axes.UniformDataAxis.value2index (round) | exact |
MasterPatternProjection.sampleToDetector | detectors._ebsd_detector._sample_to_detector_matrix | rtol 1e-7 |
MasterPatternProjection.gnomonicBounds | EBSDDetector.gnomonic_bounds (Britton et al. 2016) | rtol 1e-7 |
MasterPatternProjection.directionCosines | _get_direction_cosines_for_fixed_pc / _varying_pc | rtol 1e-7 |
MasterPatternProjection.project (float32, float64, uint8, uint16) | EBSDMasterPattern.get_patterns (_project_single_pattern_from_master_pattern, _vector2lambert, _get_lambert_interpolation_parameters, _rescale_with_min_max) | float: rtol 1e-5, atol 1e-8; integer: 1 count |
MasterPatternProjectionMetal.project (float32 GPU) | MasterPatternProjection.project (float64 CPU) | 1e-3 absolute on the -1 to 1 scale |
MasterPatternProjectionMetal.Projector (a dictionary chunk by chunk) | MasterPatternProjectionMetal.project in one go | exact |
MasterPatternProjectionMetal.project on a float32 master pattern (EMsoft's type) | MasterPatternProjection.project (float64 CPU), which keeps a float32 master pattern's intensities (get_patterns: rescale = dtype_out != self.data.dtype) | 1e-3 of the pattern's half range |
Dictionary indexing
| Function | Reference | Tolerance |
|---|---|---|
DictionaryIndexing.prepare (NCC: centre, unit norm; NDP: unit norm) | NormalizedCrossCorrelationMetric / NormalizedDotProductMetric.prepare_experimental, prepare_dictionary | — |
DictionaryIndexing.index (dictionary in memory; CPU float64) | EBSD.dictionary_indexing (_dictionary_indexing, _match_chunk) | scores rtol 1e-4 (float32 runs), 1e-5 (float64); indices exact where scores do not tie |
DictionaryIndexing.index (master pattern, chunk by chunk) | get_patterns(dtype_out=float32) then dictionary_indexing | equal to the in-memory dictionary; F9 as below |
DictionaryIndexing.Result.crystalMap | the returned CrystalMap (rotations, prop, create_coordinate_arrays) | quaternions atol 1e-7, Euler 1e-6, coordinates exact |
DictionaryIndexingMetal (float32 GPU product, MPSMatrixMultiplication since #624) | the CPU float64 product | 1e-5 absolute on scores; against kikuchipy rtol 1e-4, with the GPU-projected dictionary 1e-3 |
| F9 whole scan | m4/dictionary-indexing-nickel-ebsd-large | best match ≥ 99.5 % equal, best scores rtol 1e-2; block rtol 1e-4 |
OrientationSimilarityMap.compute, DictionaryIndexing.Result.orientationSimilarityMap (Marquardt et al. 2017, Microsc. Microanal. 23, 1144) | kikuchipy.indexing.orientation_similarity_map (scipy generic_filter, origin at size // 2, outside −1) | exact (float32) |
DictionaryMapMerge.merge, Merged.crystalMap | kikuchipy.indexing.merge_crystal_maps (with simulation_indices_prop) | exact; rotations atol 1e-15 (orix normalises them again) |
F9 through the Indexing room's plan: DictionaryIndexingPlan.indexBlock (the room's per-pattern source, the shipped master pattern as the room opens it, orix's 4° sample of the file phase's point group, the file's detector with F9's PC) | m4/dictionary-indexing-nickel-ebsd-large | as F9: best match ≥ 99.5 % equal, best scores rtol 1e-2 |
Dictionary indexing through the Indexing room: IndexingSession.index with Method · Dictionary (block by block, chunk progress, Stop, the map, the readout, the exports) | the run's own DictionaryIndexing.Result and dictionary | solutions equal the result's best rotations and scores exactly, each the dictionary's rotation at its best simulation index; the crystal map's scores and simulation_indices exact; the .ang's CI within its five decimals |
The Indexing room's OSM layer: IndexingResult.similarity as dictionary blocks land (Marquardt et al. 2017) | m4/orientation-similarity-map (F9's map), kikuchipy's map of the rows kept | exact |
Dictionary indexing against several phases in the Indexing room: IndexingResult.land(_:rows:) with one result per phase (DictionaryMapMerge.chosenMaps, picked), its OSM layer, its crystal map | m4/merge-crystal-maps (two, renamed, best and their _osm, whole maps); after each block, the port's merge and OSM of the rows landed | exact: each point's phase, its matches, the merged crystal map's ids, rotations, scores, simulation_indices and phase list, the OSM after each block; the tied run's matches equal the one-phase run's and its OSM twice that run's |
Kikuchi simulation
| Function | Reference | Tolerance |
|---|---|---|
CrystalLattice.diffpy (base, recbase, volume, rnorm, orixAligned) | diffpy.structure Lattice (setLatPar, cosd); orix Phase.structure re-alignment | rtol 1e-7, atol 1e-12; the closed-form orix base within 1e-12 of the re-aligned one |
KikuchiScatteringTables | diffsims ATOMIC_SCATTERING_PARAMS, ATOMIC_SCATTERING_PARAMETERS_DOYLETURNER | exact |
KikuchiReflectors.symmetrised | ReciprocalLatticeVector.symmetrise (orix Miller.symmetrise(unique=True)) | exact (indices, order, multiplicity) |
KikuchiReflectors.minDSpacing, allowed(centering:) | from_min_dspacing, allowed | exact |
KikuchiReflectors.dSpacing, structureFactors(cell:), braggAngles | dspacing, calculate_structure_factor("xtables"), calculate_theta | rtol 1e-7 |
KikuchiWavelength.refractionCorrected | diffsims.utils.sim_utils.get_refraction_corrected_wavelength | rtol 1e-7 |
GeometricalKikuchiSimulation.simulate | KikuchiPatternSimulator.on_detector (lines_coordinates, zone_axes_coordinates, _zone_axes_labels) | hkl, [uvw], labels exact; pixels rtol 1e-7, atol 1e-6 px; gnomonic rtol 1e-7 |
GeometricalKikuchiSimulation.roundIndices | orix Miller.round (_round_indices, max index 20) | exact |
GeometricalKikuchiSimulation.Line.edges (band edges) | KikuchiPatternSimulator.plot(mode="bands"): orix Vector3d.get_circle at π/2 ∓ θ about vector_detector, put on the detector by on_detector's formula | rtol 1e-5, atol 1e-8 (orix's own get_circle tests, np.allclose defaults), visibility exact |
KinematicMasterPattern.lambert, lambertVector (the Kinematical overlay) | kikuchipy get_pattern on _lambert2vector directions (normalised; the lower hemisphere with z negated), then EBSDMasterPattern.get_patterns | master pattern rtol 1e-5, atol 1e-8; patterns rtol 1e-6, atol 1e-5 (float32) |
KinematicMasterPattern.calculate | KikuchiPatternSimulator.calculate_master_pattern (stereographic, _get_pattern) | rtol 1e-5, atol 1e-8 |
Pattern quality
| Function | Reference | Tolerance |
|---|---|---|
PatternQuality.frequencyVectors | pattern._pattern.fft_frequency_vectors | exact |
PatternQuality.ImageQuality / imageQuality / imageQualityMap (normalize on, off) | get_image_quality, _get_image_quality, EBSD.get_image_quality (Krieger Lassen 1994) | 1e-5 relative (measured 8.5e-8; 2.6e-6 unnormalised) |
PatternQuality.averageNeighbourDotProductMap (window rectangular or circular of any size, zeroMean, normalize) | EBSD.get_average_neighbour_dot_product_map, _map_helper._neighbour_dot_products (Brewick, Wright & Rowenhorst 2019) | 1e-5 relative (measured 5.6e-7) |
| F3 end to end (the app's background removal, then both maps) | kikuchipy's docs chain, whole scan | IQ 1e-2 relative, ADP 5e-3 relative |
Detector geometry and projection-centre calibration
| Function | Reference | Tolerance |
|---|---|---|
EBSDDetectorGeometry.Convention(kikuchipyName:), init(…, convention:), brukerCenter, center(_:in:), centers(in:) | EBSDDetector(pc, convention), pc_tsl, pc_oxford, pc_emsoft(4/5) | rtol 1e-7, atol 1e-12; round trip 1e-12 |
height, width, binnedPixelSize, unbinnedShape, specimenScintillatorDistance | same names | rtol 1e-7 |
gnomonicBounds, gnomonicScale, rMax | gnomonic_bounds, x_scale/y_scale, r_max (Britton et al. 2016) | rtol 1e-7 |
gnomonic(pixel:pc:), pixel(gnomonic:pc:) | to_gnomonic_coords, to_pixel_coords | rtol 1e-7, atol 1e-12 |
sampleToDetector, detectorToSample, FrameRotation | sample_to_detector (_sample_to_detector_matrix) | rtol 1e-7, atol 1e-12 |
| TKD set-ups | EBSDDetector with TKD angles | rtol 1e-7, atol 1e-12 |
PCCalibrationMovingScreen (Hjelen et al. 1991) | PCCalibrationMovingScreen | rtol 1e-5 |
SEM-EDS map readers (exact)
| Function | Reference | Tolerance |
|---|---|---|
BrukerEDSReader.read (.bcf: SFS container, header XML, images, hypermap; .spx) | rsciio.bruker.file_reader with unbcf_fast (RosettaSciIO 0.15.0) | counts, axes, metadata, image pixels exact |
EDAXEDSReader.read (.spd with .spc and .ipr, .lsd with .csv, .spc) | rsciio.edax.file_reader | exact |
JEOLEDSReader.read (.pts, .eds, .img, .map, .asw) | rsciio.jeol.file_reader with SI_dtype=uint32, read_em_image=True | exact |
CSRSpectrumImage.sum, windowSums | numpy sums over the dense cube | exact (UInt64) |
SEM-EDS (exspy's window path)
| Function | Reference | Tolerance |
|---|---|---|
XrayLineDatabase | exspy._misc.elements.elements | exact |
SEMEDSLines.lines(forElements:) | EDSSpectrum._get_lines_from_elements (add_lines()) | exact |
fwhm(atKeV:) | get_FWHM_at_Energy | rtol 1e-7 |
integrationWindows, backgroundWindows | estimate_integration_windows, estimate_background_windows | rtol 1e-7 |
index(of:), channels(from:to:) | HyperSpy UniformDataAxis.value2index, _get_array_slices | exact |
intensities | get_lines_intensity | rtol 1e-7 (measured bit-equal) |
cliffLorimer, weightToAtomic, quantify | quantification_cliff_lorimer (× 100), material.weight_to_atomic | rtol 1e-7 |
Conditions.takeOffAngleDeg | get_take_off_angle / take_off_angle | rtol 1e-7 |
Pattern filters (FFT filter, CLAHE, neighbour averaging)
| Function | Reference | Tolerance |
|---|---|---|
PatternWindow.lowpass, .highpass, * | filters.window.lowpass_fft_filter, highpass_fft_filter, Window * Window | rtol 1e-12 |
PatternWindow.gaussian, .modifiedHann, .rectangular, .circular, custom | scipy.signal.windows.gaussian / boxcar (symmetric, fftbins=False), filters.window.modified_hann, Window.make_circular | rtol 1e-12; circular exact |
PatternFilters.fftFilter / ...Values, frequency (shift on and off) | EBSD.fft_filter(function_domain="frequency"), pattern._pattern.fft_filter | values 1e-5 relative or 1e-3 grey levels (measured 7.4e-6 relative); uint8 within one grey level on at most 1 % of the pixels's rule (measured 0.005 % of all 4125 patterns with the guide's filter, pattern (0, 0) exact; at most 0.22 % with the asymmetric spatial kernel) |
PatternFilters.fftFilter / ...Values, spatial | EBSD.fft_filter(function_domain="spatial"), filters.fft_barnes._fft_filter (Barnes et al. 2016) | as frequency (measured 0.004 % of all patterns with the 5 x 5 Gaussian) |
AdaptiveHistogramEqualization.equalize / equalizedUnit | EBSD.adaptive_histogram_equalization, skimage.exposure.equalize_adapthist (Zuiderveld 1994) | exact (uint8) |
NeighbourAveraging.average / averageValues, windowSums | EBSD.average_neighbour_patterns, pattern.chunk._average_neighbour_patterns (Wright et al. 2015) | window sums exact; values 1e-5 relative or 1e-4 grey levels; uint8 within one grey level on at most 0.2 % (Gaussian) or 2 % (integer-weight windows) of the pixels (measured on all patterns: 0.002 %, 0.14 %) |
Hough indexing
| Function | Reference | Tolerance |
|---|---|---|
HoughReflectorLibrary (pole families, variants, Cartesian normals, angle table, family pairs, triplet table; Laue codes and rotations) | tripletvote.addphase, BandIndexer.build_trip_lib, crystal_sym, crystallometry.Crystal | indices exact; poles and normals rtol 1e-7 (poles atol 1e-12); angles atol 1e-5° |
HoughBandDetector plan, mask, kernel, radon, convolve | radon_fast.Radon.radon_plan_setup, radon_faster; band_detect.BandDetect.band_detect_setup, rdn_conv | counts, bins, mask exact; Radon rtol 1e-5 (atol 1e-4), convolution rtol 1e-5 (atol 2e-3); a flipped plan pixel (below) may move up to 6 lines and 1 % of the convolution, each within 5 grey levels |
HoughBandDetector.detect, normals | find_bands, rdn_local_max, band_label_numba, Radon.radon2pole ("KIKUCHIPY") | peak cells exact; sub-pixel peaks and rho 1e-3 px; theta and normals 1e-4; peak values rtol 1e-5; the bands of a pattern with a flipped plan pixel within 1 px and 1° |
HoughIndexer.tripletVote | BandIndexer._tripvote_numba | counts and families exact; weighted votes and ranks rtol 1e-5 (atol 1e-3) |
HoughIndexer.index (assignBands, quest, confidence) | bandindex, _assign_bands_nb2, _calc_quest_weights, _orientation_quest_nb, _calc_cm, EBSDIndexer._indexbandsphase | matched bands, phase, total votes exact; fit atol 2e-3° (float32 arccos near 1), CM, PQ rtol 1e-5, IQ 1e-4 (one flipped-pixel pattern within 0.01 / 1 / 0.01); orientation < 0.01° (m-3m) |
HoughIndexer.crystalMap | kikuchipy _hough_indexing.xmap_from_hough_indexing_data | grid, steps, unit, phase list, property names exact; rotations and properties at the bundle's tolerances |
F8 end to end: HoughIndexer.indexMap on the app's corrected demo scan | EBSD.hough_indexing on kikuchipy's corrected scan | indexed count within 1; 99 % of points under 1°; matched-band count equal on 95 % |
F8 through the Indexing room: IndexingSession.index (the file's phase, the Patterns room's default stages applied per pattern as each is read, the file's mean PC, row by row) | EBSD.hough_indexing on kikuchipy's corrected scan | as F8 end to end: indexed count within 1; 99 % of points under 1°; matched-band count equal on 95 % |
IndexedBand.segment (a detected band's centre line on the pattern, for the overlay) | Radon.radon2pole's frame ("KIKUCHIPY": the line x cos θ + y sin θ = ρ about the pattern centre, y up) | analytic lines 1e-9 px; a detected 3 px stripe within 0.75 px of its middle |
Refinement of orientations and projection centres
| Function | Reference | Tolerance |
|---|---|---|
NelderMead.minimize | scipy.optimize._optimize._minimize_neldermead | x, fun, final simplex rtol 1e-12; nfev, nit, status exact |
EBSDRefinement.refineOrientations (trust region, none, signal mask, pseudo-symmetry operators) | EBSD.refine_orientation | every point within 0.1° (m-3m); scores rtol 1e-4; operator index exact; operator starts atol 1e-10 |
EBSDRefinement.refineProjectionCenters | EBSD.refine_projection_center | scores rtol 1e-4; PCs rtol 1e-4 on 95 % of values, all within 1e-3 |
EBSDRefinement.refineOrientationsAndProjectionCenters | EBSD.refine_orientation_projection_center | 90 % of points within 0.1°, all within 1°; 90 % of scores rtol 1e-4, all 1e-2, mean 1e-4; 90 % of PC values rtol 2e-3, all 5e-2 |
EBSDRefinement.refineOrientations(map:) and the PC twin | compute_refine_*_results | grid, unit, phase list, −1 and identity at points not indexed, scores and num_evals |
refineOrientations(map:) on a dictionary-indexed map (DictionaryIndexing.Result.crystalMap) | dictionary_indexing then refine_orientation (from rotations[:, 0], the best match) | under 0.1° (m-3m), scores rtol 1e-4; is_in_data and phase ids exact |
IndexingRefinement.refine (the Indexing room's row blocks) and a refinement's IndexingResult.crystalMap | refine_orientation on the run's map | exact to one refineOrientations call over every indexed point; the map within the row above's bounds |
TEM rooms (the app's own numbers)
| Function | Reference | Tolerance |
|---|---|---|
PatternIndexing.findSpots, .q, .index (the Diffraction room's Index) | DiffractoKit's PatternSpots.find (py4DSTEM find_Bragg_disks / get_maxima_2D, the kit's P41) and PatternOrientation.index (template match, zone-axis solver and tilt refinement, the kit's P45 against py4DSTEM 0.14.19 match_single_pattern); the room maps each spot to q (qx down the rows, \|q\| the readout's q of its radius, the inverse of the overlay's map), drops the direct beam (nearer than half the crystal's shortest g, at least 5 px) and indexes the spots within 1.5 Å⁻¹. Found spots become the room's spot marks; with spots marked, Index reads those, and a clicked spot among them (no intensity) sends the marks to ZoneAxisSolver.solve(clicked: true) (the kit's P43): the zone axis and turn only, no tilt. The Spots table and its CSV list each spot's R (px from the centre Index ran about), q, d = 1/q, its hkl's d in the cell (UnitCell.d) and Δd/d, and R in mm as R px times the camera's pixel pitch, the kit's numbers unrounded in the CSV (%.9g). A Simulation document's Spots table lists the simulated spots instead, with R in mm = λ L \|g\| (λ DiffractoKit's RingCalibration.wavelengthAngstroms, L the Microscope section's camera length; SimulationSpotsTableTests, 1e-9) | 0.5° (the kit's own bound is its P45 regression, medians about 0.1°); the q map 1e-12 |
ZoneAxisOverlay.spots (the Diffraction room's simulated spots of a typed zone axis) | DiffractoKit's SpotPatternSimulator at CrystalOrientation(zoneAxis:inPlaneAngle:cell:) (py4DSTEM's zone-axis frame and kinematical spot pattern, the kit's P42); placed by the room's scale and centre: row = centre + qx/Δq, column = centre + qy/Δq (py4DSTEM's qx down the rows), the radius the inverse of the readout's q (RingScale.radius) | 1e-9 px |
ZoneAxisOverlay.tilted, .turned, DiffractionAnalysis.flip, .tilt(down:across:), PatternIndexing.solverSettings(fitScale:) (#787: the Tilt tool, ⌥ drag and its keys, Flip, Fit scale, the solutions) | DiffractoKit's CrystalOrientation.tilted(by:) and rotatedInPlane(by:); ZoneAxisSolver.Settings(scaleWindow:) (0.03 on, 0 off) | 1e-6 px, 1e-6° |
ZoneAxisOverlay.spots with Double diffraction and the excitation error | DiffractoKit's DoubleDiffraction.spots(simulator:orientation:volts:settings:) (g₁ + g₂ within one crystal on a forbidden reflection: Gjønnes and Moodie, Acta Cryst. 19 (1965) 65; Williams and Carter 2009) and SpotPatternSimulator.Settings(sigmaExcitationError:) (py4DSTEM's envelope, | ≤ 3σ kept) |
EELSCompositionSigma.percentSigmas, sigmas (1σ on at% and wt%) | SpectroKit's EDXQuantification.quantifyWithSigma, the same first-order propagation of independent amounts (Ku 1966, J. Res. Natl. Bur. Stand. 70C, 263) | rtol 1e-6 against the kit on hand amounts, 1e-5 on a fitted room |
EELSFitQuality.pearsonReduced, of (RSS and reduced χ²) | the kit's residual sum of squares (EELSModelResult.residualSumOfSquares, EELSMLLSPixel.residualSumOfSquares); Pearson's χ² (Pearson 1900, Philos. Mag. 50, 157) over the fitted channels, divided by the degrees of freedom | 1e-15 on a hand case; RSS equal to the kit's; χ² 1e-12 relative |
HRTEM simulation (2.5)
| Function | Reference | Tolerance |
|---|---|---|
SimulationSpecimen.cell(of:), build | SimulatoKit SlabBuilder.slab(of:zoneAxis:…) (abTEM orthogonalize_cell) on the phase's cell (ASE cellpar_to_cell) and every site | 1e-9 Å; counts exact |
SimulationSpecimen.inPlaneAngle | DiffractoKit CrystalOrientation(zoneAxis:inPlaneAngle:cell:) against the slab's orientation | 1e-12 on every matrix element |
HRTEMImage.grid, thermalGrid, squareGrid, planePeriods, exitWaves | SimulatoKit SimulationPlan.sampling(largestAngle:energy:) (abTEM's min(0.05 Å, λ / 3β)); abTEM 1.0.10's grid rule, gpts = ⌈extent / sampling⌉ per axis on its own (abtem.core.grid.Grid), so its pixels are square within one point in a length; Potential(...).build().tiled(repetitionsZ:) of one period | grid exact; pixel sides within 0.5 %; one period repeated equals the whole slab's run within 1e-12 |
HRTEMImage.image | SimulatoKit ContrastTransferFunction.images(of:defocus:tile:) (abTEM Waves.apply_ctf(...).intensity()), tiled to the field of view | pixels 1e-6 of the largest; calibration 1e-15 nm |
HRTEMOptics.scherzerDefocusNM, HRTEMPreset | SimulatoKit ContrastTransferFunction.scherzerDefocus(Cs:energy:), √(3/2 Cs λ) | 1e-12 relative; presets exact |
HRTEMTransferCurve.of | SimulatoKit ContrastTransferFunction.profiles(energy:points:) and pointResolution(energy:) | 1e-12 relative |
HRTEMImage.table | HRTEMImage.image at each defocus and stored thickness, 2 nm cells | exact (the same function) |
HRTEMImage.configuration, addingConfiguration, the ensemble mean | SimulatoKit FrozenPhonons(structure:sigmas:configurations:seed:) (abTEM FrozenPhonons, Einstein model, σ per element, seeded per configuration) | positions exact; a continued run's image bit-equal to an uninterrupted one |
HRTEMImage.convergence | the app's own readout: RMS(mean of n − mean of n − 1) / RMS(mean of n) | 1e-12 (0 for a repeated configuration) |
AbTEMScript.text | abTEM 1.0.10 and ASE 3.29.0: Potential(gpts, slice_thickness, parametrization="lobato", projection="infinite", exit_planes), PlaneWave, CTF, FrozenPhonons | every number written in Swift's round-trip form (exact) |
SlabDrawing.drawn, SlabDrawing.columns | SimulatoKit SlabBuilder positions (abTEM orthogonalize_cell), projected along the beam; no computation of their own | positions 1e-9 Å; marks on the pixel of their position, 1e-9 px |
CBED, STEM and atom models (2.6)
| Function | Reference | Tolerance |
|---|---|---|
DynamicalSpots, DynamicalBeams | SimulatoKit BeamIntensities(exitWaves:of:exitPlanes:) (abTEM 1.0.10 index_diffraction_spots) of the HRTEM run's exit waves at whole periods | exact (the kit's numbers, renamed by hkl) |
CBEDRun.run, CBEDPattern | SimulatoKit Probe(semiangleCutoff:) at the box's middle through the tiled one-period potential, diffractionPattern(maxAngle: .cutoff) (abTEM 1.0.10 Probe(...).multislice(...).diffraction_patterns(max_angle="cutoff")), cropped to the edge | the kit's numbers (its CBED pins); Σ of a pattern 1 ± 0.05 inside the edge |
CBEDTilt, CBEDRun.run(tiltMrad:) | SimulatoKit Probe(…, tilt:) (abTEM 1.0.10 Probe(semiangle_cutoff, tilt=(tx, ty)): e^{−2πi (kx tan tx + ky tan ty) Δz} on every propagator); the tilt is the beam of the orientation drawn by hand written in the slab's box, tan t = −(b_x, b_y) / b_z (b toward the source; the kit's slab mirrors crystal and beam to depth) | each disc's share of the probe within 1 % (plus 1e−4 of the probe); the tilt read back to 1e−9 mrad; the brightest diffracted disc is abTEM's and the one on the overlay's Laue circle |
CBEDThickness.measure | DiffractoKit TwoBeamThickness.fit (Kelly et al. 1975 whole-profile fit, Allen 1981 fringe line; DiffractoKit's own pins, no Python reference package) on the profile the app reads across the diffracted disc | 3 % on a synthetic Si 2 2 0 disc of 250 nm, and on the app's own tilted multislice CBED of Si [1 1 0] (2 2̄ 0 two-beam, 250 nm stored, Metal) |
STEMImage.prepare, STEMScan.image, radialProfile | SimulatoKit STEMRun with FlexibleAnnularDetector (abTEM 1.0.10 Probe(...).scan(..., detectors=FlexibleAnnularDetector())) and ScanMeasurement.integrateRadial (abTEM integrate_radial) | the kit's numbers (its STEM and flexible annular pins); bands add to 1e-12; a sliced run equals one run exactly on the CPU |
AtomModelSpecimen | DiffractoKit AtomModel.read (ASE 3.29.0's extxyz, xyz and vasp readers) and CrystalLoading; SimulatoKit SlabBuilder.slab(ofModel:beamAlong:…) (abTEM orthogonalize_cell on the model's cell, ASE center(vacuum=5) for a model without one) | 1e-9 Å; counts exact |