upxo.pxtal.fm_steel_3d.steps.steps_pag_clustering module

PAG Clustering – Part E of the FM Steel 3D walkthrough.

Groups grains into Prior Austenite Grains (PAGs), then assigns each PAG a crystal orientation. generate_pags wraps the same technique-selector entry point (pag_technique_selector_3d.generate_pags) used to generate PAGs – not the lower-level FMSteel3DBase.generate_pag_clusters, which is only ever reached internally, for technique A’s non-MIS levers.

upxo.pxtal.fm_steel_3d.steps.steps_pag_clustering.generate_pags(fm_base, technique='A', pag_size_distribution=None, max_packets_per_pag=4, lever='lever3', pag_grain_fraction=1.0, use_non_neigh_pag=True, random_seed=None)[source]

Groups fm_base’s grains into PAGs. technique: ‘A’ (grain clustering, uses lever) or ‘B’ (within-grain splitting).

Return type:

FMSteel3DWithPAGs

upxo.pxtal.fm_steel_3d.steps.steps_pag_clustering.assign_pag_orientations(fm_pag, pag_ori_mode='random', pag_ori_params=None, random_seed=None)[source]

Assigns a crystal orientation to every PAG. Modes: ‘random’, ‘hagb_constrained’, ‘textured’, ‘fixed’.

Mutates fm_pag IN PLACE (stores into fm_pag.pag_orientations) and returns None – unlike every other stage in this pipeline, which returns a new object. Call this as a bare statement, not an assignment.

upxo.pxtal.fm_steel_3d.steps.steps_pag_clustering.compare_techniques(fm_base, configs, random_seed=None)[source]

Trial-runs generate_pags once per config in configs (each a dict of kwargs accepted by generate_pags above, e.g. {‘technique’: ‘A’, ‘lever’: ‘lever1’}), for side-by-side comparison before committing to one. Does not mutate fm_base or keep any of the trial FMSteel3DWithPAGs objects.

Returns:

  • list[dict] (one summary per config, each)

  • `{‘config’ (config, ‘n_pags’: int, ‘n_isolated_grains’: int}`.)