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 via a Voronoi build, appending Oij columns, 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, reads back the rotated orientation matrix NEPER wrote toreconstruction.ori, and writes<output_root>/<basename>holding the nineO11..``O33`` columns followed by the original columns. Any pre-existingO*columns are dropped so the rotated matrix replaces them rather than duplicating. 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.Warning
reconstruction.oriand the grain table are concatenated by row position, and the result is silently truncated tomin(len(df), len(ori_df)). Nothing checks that the two row counts agree, nothing logs it when they do not, and no grain id participates in the join. If the NEPER build ever returns a different number of cells than there are input grains, the output file silently loses rows and pairs the surviving orientations with the wrong grains. Compare the row count of each output file against its input before using the result.- 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