upxo.pxtal.twinned_simple_3d.steps.steps_ebsd_analysis_1 module
EBSD Analysis-1 – Part B of the Twinned FCC walkthrough.
Subsample -> import -> detect grains -> crop -> clean & characterize, in that order. The optional “Step size effect” study (exploring how EBSD step size distorts downstream measurements) is not wrapped here – see stride_study.py directly if you want to explore that.
- upxo.pxtal.twinned_simple_3d.steps.steps_ebsd_analysis_1.subsample_and_load(ctf_file=None, subsample=True, stride_x=5, stride_y=5, reuse_subsampled=False)[source]
Step 1 – optionally subsample (recommended for large maps), then load the map (grain detection is a separate step, matching EBSDReader.load’s own docstring on why load()/detect_grains() are split).
- Parameters:
ctf_file (str or Path) – Path to the source .ctf file. Required – there is no default, since it is necessarily specific to your own EBSD dataset.
- Return type:
- upxo.pxtal.twinned_simple_3d.steps.steps_ebsd_analysis_1.detect_grains(rdr, min_grain_size=10, misori_tol=10.0)[source]
Step 2 – (re-)detects grains on the already-loaded map in place; does not re-read the file from disk. Returns rdr for convenient chaining.
- upxo.pxtal.twinned_simple_3d.steps.steps_ebsd_analysis_1.crop(rdr, xstart_pct=1.0, ystart_pct=1.0, xend_pct=99.0, yend_pct=99.0)[source]
Step 3 – crops to a percentage sub-region of the full map (default trims a 1% border all round, avoiding edge artefacts). Returns a NEW EBSDReader (crop is never in-place).
- upxo.pxtal.twinned_simple_3d.steps.steps_ebsd_analysis_1.clean_and_characterize(rdr, ctf_file=None, connectivity=4, min_grain_size=0, verbose=True)[source]
Step 4 – builds the repgen2d object the rest of the pipeline works with (rg), re-characterizing the cropped/detected map.
- Parameters:
ctf_file (str or Path) – Path to the source .ctf file. Required – there is no default, since it is necessarily specific to your own EBSD dataset.
- Return type:
- upxo.pxtal.twinned_simple_3d.steps.steps_ebsd_analysis_1.import_and_clean(ctf_file=None, subsample=True, stride_x=5, stride_y=5, reuse_subsampled=False, min_grain_size_detect=10, misori_tol=10.0, xstart_pct=1.0, ystart_pct=1.0, xend_pct=99.0, yend_pct=99.0, connectivity=4, min_grain_size_clean=0, verbose=True)[source]
Convenience one-shot: runs Steps 1-4 in sequence. Prefer the individual functions above in the notebook itself (one cell per step, so each step’s result/log is visible before the next runs); this is here for completeness and for the other steps_*.py modules’ own tests.
- Parameters:
ctf_file (str or Path) – Path to the source .ctf file. Required – there is no default, since it is necessarily specific to your own EBSD dataset.
- Returns:
(rdr, rg)
- Return type:
the final cropped EBSDReader and the built repgen2d object.