OOF2: The Manual

Name

Generic (GenericReader) — Generic EBSD data reader.

Synopsis

GenericReader(comment_character, separator, angle_column, angle_type, angle_units, angle_offset, xy_column, scale_factor, flip_x, flip_y, groups)

Details

  • Base class: OrientMapReader
  • Parameters:

    comment_character
    Skip input lines beginning with this character. Type: A character string.
    separator
    How columns are divided in the input file. Type: An object of the InputSeparator class.
    angle_column
    First column of angle data. Type: A positive integer.
    angle_type
    The way in which orientations are specified in the input file. Type: A subclass of the Orientation class.
    angle_units
    The units used for angles in the input file. Type: An object from the AngleUnits enumerated class.
    angle_offset
    An xy-plane rotation to apply to all input orientations, in degrees. In the Abg format, the angle is added to gamma. In Bunge, it's subtracted from phi1. Type: A real number.
    xy_column
    First column of position data. Type: A positive integer.
    scale_factor
    All x and y values will be multiplied by this factor. Type: A real number.
    flip_x
    Flip data in the x direction. Type: Boolean: True or False.
    flip_y
    Flip data in the y direction. Type: Boolean: True or False.
    groups
    Templates for creating pixel groups from column data. Pixels with different values in the column will be put into different pixel groups. A '%s' in the groupname will be replaced by the contents of the column. Type: A list of tuples, each containing a string and an integer.

Description

The generic reader is meant to read orientation maps that cannot be read by the more specific readers.

It assumes that the data file is ASCII and contains lines which are numbers separated from one another by blanks and the specified separator character. Any lines that can't be read in that format at the top of the file are assumed to be a header, and are discarded. Any lines beginning with the given comment_character are also discarded, wherever they occur.

Each line of data in the file must contain the position of a point and the measured orientation at that point. OOF2 requires that data is on a rectangular grid. If the file uses a triangular grid, you need to delete every other line to turn it into a rectangular before loading it into OOF2.

The crystal orientations in the file are in the form of angle_type angles, which can be any of the Orientations that OOF2 supports. The data are assumed to be in consecutive columns starting with column angle_column. (The left hand column is column 1.) angle_units determines if the angles are interpreted as degrees or radians.

All angles are understood as differences from some reference zero angle, and the definition of "zero" is a matter of convention. The software that created the data file may be using a different convention. OOF2 assumes that the z direction (out of the screen toward the viewer) is the usual one. The angle_offset parameter rotates the axes by the given amount in the given units in the xy plane. If using Abg format, the offset is added to gamma. If using Bunge, it's subtracted from phi1.

[Warning] Warning

The definitions of the orientation angles also depend on how the crystal structure is assumed to be oriented in the reference configuration. If OOF2 is making different assumptions than the program that generated the the data file, it may be necessary to rotate the angles further. OOF2 currently does not do this for you. You should create a simple data file for an anisotropic structure that you understand, load it into OOF2 and check that its anistropic response is what you expect.

OOF2 assumes that the x and y coordinates of the position are in adjacent columns numbered xy_column and xy_column+1. If the x and y axes used by the file do not agree with the axes used by OOF2, set either flip_x or flip_y or both to True. (In OOF2, x increases from left to right and y increases from bottom to top on the screen.) If necessary, all of the position data can be scaled by the specified scale_factor.

OOF2 can automatically create pixel groups based on data in the orientation map file. The groups parameter can contain a list of tuples, each of which contains a group name template and an integer. The integer indicates which column of the data file contains the group information. All pixels in the data file containing the same value in the given column will be put into a single group. The name of the group is the given name plus the value in the column. For example, If groups is [(1, "%s-group"), (3, "froop")] and if all pixels have values abc or def in column 1, then OOF2 will assign pixels with abc in column 1 to a group named abc-group, and pixels with def in column 1 to a group named def-group. Since the template for column 3 doesn't contain %s the contents of column 3 will simply be appended to the template, creating groups named froopX for each X in column 3.