graintrace.experiment_postprocessing#

Load and query experimental (FF/NF/EBSD) field data (ExperimentResults).

class graintrace.experiment_postprocessing.FieldFileNaming(prefix, index_width=None, sep='_', suffix='.csv')[source]#

Bases: object

Naming convention for per-step CSVs (identifier is between sep and suffix).

Parameters:
  • prefix (str)

  • index_width (Optional[int])

  • sep (str)

  • suffix (str)

class graintrace.experiment_postprocessing.ExperimentResults(exp_dir, exp_naming, step_to_time=None)[source]#

Bases: object

Far-field HEDM experiment results (one CSV per load/time step).

Parameters:
  • exp_dir (Union[str, Path])

  • exp_naming (FieldFileNaming)

  • step_to_time (Optional[Union[Dict, Callable]])

check_input()[source]#

Discover experiment CSVs, order the step ids, and derive times.

Return type:

None

load_data(grain_id)[source]#

Read and return the field CSV for the given step/grain id.

Parameters:

grain_id (str)

Return type:

DataFrame

get_tensor_block(tensor_prefix, order, sample, grain_id=None, block_id=None, return_comp_names=False)[source]#

sample=’id’ -> requires block_id (step index), returns (n_grains_in_step, 1|3|9) sample=’time’ -> requires grain_id, returns (n_steps, 1|3|9) using tracking map

Parameters:
  • tensor_prefix (str)

  • order (int)

  • sample (str)

  • grain_id (int | None)

  • block_id (int | None)

  • return_comp_names (bool)

Return type:

ndarray | Tuple[ndarray, List[str]]

get_tensor_element(*args, **kwargs)[source]#

Not implemented: near-field experiment tensor access.

Parameters:
Return type:

None