graintrace.experiment_rotation_helper#
Rotate/register raw far-field experiment CSVs into the simulation frame.
- graintrace.experiment_rotation_helper.update_experiments(input_files, output_root, bounding_box, dim=3, weighted=False, auto_fix_bbox=False, bbox_fix_mode=None, bbox_tolerance=0.0, auto_rotate=False, rotate_angles=(0, 0, 0), rotate_convention='xyz', angle_identifier=None, orientation_descriptor='euler-bunge', orientation_active_convention=False, unit='deg', elastic_strain_identifier=None, strain_unit='microstrain', env=None, neper_path=None, auto_install=False)[source]#
Rotate each input CSV into the simulation frame via a Voronoi build, saving under output_root.
For each input file this runs a
VoronoiMeshBuilderbuild (option="voronoi", no mesh) to apply the bounding-box filter and the sample rotation, and writes<output_root>/<basename>holding the filtered grain table with the ROTATED Euler angles (degrees, standard Bunge triplet ofR' = Q R, viaeuler()) and rotated positions/strains. Euler is the primary orientation input ofMaterialCalibration, so noO11..O33columns are written; any pre-existing (unrotated)O*columns are dropped so a stale matrix cannot disagree with the rotated Euler. Withstrain_unit="microstrain"theelastic_strain_identifiercolumns are scaled by1e6on the way out.This is the preparation step for a physically registered
MaterialCalibrationfit: the output is the FF calibration CSV schema described in File formats.Note
orientation_active_conventionis deprecated and ignored. For a frame change without a reconstruction useapply_ff_csv().Important
The NEPER cells (
reconstruction.ori) and the grain table correspond by row position – no grain id participates. A count mismatch would pair orientations with the wrong grains, so this function raisesValueErrorwhen NEPER returns a different number of cells than the filtered grain table has rows, naming both counts and the file. The usual cause is the bounding-box filter dropping points underbbox_fix_mode="remove_points".- Raises:
ValueError – if
reconstruction.oriand the filtered grain table disagree on row count.- Parameters:
output_root (str)
dim (int)
weighted (bool)
auto_fix_bbox (bool)
bbox_fix_mode (str | None)
bbox_tolerance (float)
auto_rotate (bool)
rotate_convention (str)
orientation_descriptor (str)
orientation_active_convention (bool)
unit (str)
strain_unit (str)
env (dict | None)
neper_path (str | None)
auto_install (bool)
- Return type:
None