defdap.experiment module

class defdap.experiment.Experiment[source]

Bases: object

add_increment(**kwargs)[source]
iter_over_maps(map_name)[source]
get_frame_transform(frame_1, frame_2)[source]
warp_image(map_data, frame_1, frame_2, crop=True, **kwargs)[source]

Warps a map to the DIC frame.

Parameters:
Returns:

Map (i.e. EBSD map data) warped to the DIC frame.

Return type:

numpy.ndarray

warp_lines(lines, frame_1, frame_2)[source]

Warp a set of lines to the DIC reference frame.

Parameters:

lines (list of tuples) – Lines to warp. Each line is represented as a tuple of start and end coordinates (x, y).

Returns:

List of warped lines with same representation as input.

Return type:

list of tuples

warp_points(points_img, frame_1, frame_2, **kwargs)[source]
class defdap.experiment.Increment(experiment, **kwargs)[source]

Bases: object

add_map(name, map_obj)[source]
class defdap.experiment.Frame[source]

Bases: object

set_homog_points(points)[source]
Parameters:

points (numpy.ndarray, optional) – Array of (x,y) homologous points to set explicitly.

set_homog_point(map_obj, map_name=None, **kwargs)[source]

Interactive tool to set homologous points. Right-click on a point then click ‘save point’ to append to the homologous points list.

Parameters:
  • map_name (str, optional) – Map data to plot for selecting points.

  • points (numpy.ndarray, optional) – Array of (x,y) homologous points to set explicitly.

  • kwargs (dict, optional) – Keyword arguments passed to defdap.base.Map.plotHomog()

static homog_click(event, plot)[source]

Event handler for capturing position when clicking on a map.

Parameters:
static homog_key(event, plot)[source]

Event handler for moving position using keyboard after clicking on a map.

Parameters:
homog_click_save(event, plot, binning)[source]

Append the selected point on the map to homogPoints.

Parameters:
  • event – Button click event.

  • plot (defdap.plotting.MapPlot) – Plot to monitor.

  • binning (int, optional) – Binning applied to image, if applicable.

update_homog_points(homog_idx, new_point=None, delta=None)[source]

Update a homog point by either over writing it with a new point or incrementing the current values.

Parameters:
  • homog_idx (int) – ID (place in list) of point to update or -1 for all.

  • new_point (tuple, optional) – (x, y) coordinates of new point.

  • delta (tuple, optional) – Increments to current point (dx, dy).