upxo.pxtal.twinned_simple_3d.steps.steps_repr_assessment_qualification module
Repr. assess. & qual. – Part F of the Twinned FCC walkthrough.
In order: Synthetic GS Assessment (rank every saved temporal slice), Candidate Selection (re-assess under different tolerances), Temporal Slice Shortlist (final, authoritative choice). Ranks every saved MC temporal slice against the EBSD parent-grain reference, then picks the best-matching one and calibrates its physical scale factor for everything downstream.
- upxo.pxtal.twinned_simple_3d.steps.steps_repr_assessment_qualification.rank_slices(pxt, parent_info=None, role_props=None, start=0, step=1, n_comparison_slices=5, comparison_axes=('x', 'y', 'z'), outlier_trim_sides=None, scale_check_tolerance_pct=5.0, score_function='exp')[source]
Synthetic GS Assessment – ranks every saved temporal slice (pxt.m[start::step]) by how closely its 2D cross-sectional grain count/properties match the EBSD parent-grain reference, pooling whichever properties were computed in Grain-Role Properties (EBSD Analysis-2) directly from the same cross-sections.
- Returns:
list of dict (one per ranked candidate (keys include ‘tslice_key’,)
’ratio’, ‘prop_compare’, ‘prop_stats’, ‘scale_calibration’, …).
- upxo.pxtal.twinned_simple_3d.steps.steps_repr_assessment_qualification.reassess_candidates(pxt, candidates, role_props, outlier_trim_sides=None, scale_check_tolerance_pct=5.0, score_function='exp')[source]
Candidate Selection’s re-assessment step – re-derives the trim/tolerance-dependent parts (scale calibration, EBSD comparisons) from each candidate’s already-cached raw property stats, without re-ranking from scratch. Call this again after changing outlier trimming or the scale-check tolerance.
Mutates candidates in place and returns it too, for convenient chaining.
- upxo.pxtal.twinned_simple_3d.steps.steps_repr_assessment_qualification.shortlist_and_select(candidates, role_props, config=None, selected_criteria=None)[source]
Temporal Slice Shortlist’s final selection – ranks candidates by Total Stars (descending) then Aggregate Score (tie-breaker) and picks the top one.
- Returns:
(rows, best_row) (rows is every candidate’s shortlist row (see)
mc_qualification.compute_shortlist_rows), best_row is rows[0] (the
coupled-rank #1 pick) or None if there were no candidates.
- upxo.pxtal.twinned_simple_3d.steps.steps_repr_assessment_qualification.apply_selected_scale_factor(pxt, best_row)[source]
Applies the chosen candidate’s calibrated physical scale factor to the live simulation object – every downstream consumer of pxt.vox_size (host allocation, property computation, mesh export, …) picks it up automatically. No-op (returns None) if the selected row has no scale calibration (e.g. ‘area’ wasn’t among the compared properties).
- Returns:
float or None
- Return type:
the applied scale factor (um/voxel).