atomicds.results.rheed_image

Classes

RHEEDImageCollection(rheed_images[, ...])

Collection of RHEED images

RHEEDImageResult(data_id, processed_data_id, ...)

RHEED image result

class atomicds.results.rheed_image.RHEEDImageResult(data_id: UUID | str, processed_data_id: UUID | str, processed_image: Image, mask: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None, pattern_graph: Graph | None, metadata: dict | None = None)[source]

Bases: MSONable

RHEED image result

Parameters:
  • data_id (UUID | str) – Data ID for the entry in the data catalogue.

  • processed_data_id (UUID | str) – Processed data ID for the entry in the catalogue.

  • processed_image (Image) – Processed image data in a PIL Image format.

  • mask (NDArray | None) – Array containing binary segmentation mask.

  • pattern_graph (Graph | None) – NetworkX Graph object for the extracted diffraction pattern.

  • metadata (dict) – Generic metadata (e.g. timestamp, cluster_id, etc…).

get_plot(show_mask: bool = True, show_spot_nodes: bool = True, symmetrize: bool = False, alpha: float = 0.2) Image[source]

Get diffraction pattern image with optional overlays

Parameters:
  • show_mask (bool) – Whether to show mask overlay of identified pattern. Defaults to True.

  • show_spot_nodes (bool) – Whether to show identified diffraction node overlays. Defaults to True.

  • symmetrize (bool)

  • alpha (float)

Returns:

PIL Image object with optional overlays

Return type:

(Image)

get_laue_zero_radius() tuple[float, tuple[float, float]][source]

Get the radius of the zeroth order Laue zone. Note that the data is symmetrized across the vertical axis before the Laue zone is searched for.

Returns:

Tuple containing the best fit radius and center point.

Return type:

(tuple[float, tuple[float, float]])

get_pattern_dataframe(extra_data: dict | None = None, symmetrize: bool = False, return_as_features: bool = False) DataFrame[source]

Featurize the RHEED image collection into a dataframe of node features and edge features.

Parameters:
  • extra_data (dict | None) – Dictionary containing field names and values of extra data to be included in the DataFrame object. Defaults to None.

  • symmetrize (bool) – Whether to symmetrize the data across the vertical axis. Defaults to False.

  • return_as_features (bool) – Whether to return a feature-foward version of the DataFrame. Defaults to False.

Returns:

Pandas DataFrame object of RHEED node and edge features.

Return type:

(DataFrame)

class atomicds.results.rheed_image.RHEEDImageCollection(rheed_images: list[RHEEDImageResult], extra_data: list[dict] | None = None, sort_key: str | None = None)[source]

Bases: MSONable

Collection of RHEED images

Parameters:
  • rheed_images (list[RHEEDImageResult]) – List of RHEEDImageResult objects.

  • extra_data (list[dict] | None) – List of dictionaries containing field names and values of extra data to be included in the DataFrame object. Defaults to None.

  • sort_key (str | None) – Key used to sort the data with.

align_fingerprints(node_df: DataFrame | None = None, inplace: bool = False, search_range=0.2) RHEEDImageCollection[source]

Align a collection of RHEED fingerprints by relabeling the nodes to connect the same scattering features across RHEED patterns, based on relative position to the center feature.

Returns:

Pandas DataFrame object with aligned RHEED fingerprint data

Return type:

(tuple[DataFrame, list[RHEEDImageResult])

Parameters:
  • node_df (DataFrame | None)

  • inplace (bool)

get_pattern_dataframe(streamline: bool = True, normalize: bool = True, symmetrize: bool = False, return_as_features: bool = True) tuple[DataFrame, DataFrame][source]

Featurize the RHEED image collection into a dataframe of node features and edge features.

Parameters:
  • streamline (bool) – Whether to streamline the DataFrame object and remove null values. Defaults to True.

  • normalize (bool) – Whether to min/max normalize the feature data across all images. Defaults to True.

  • symmetrize (bool) – Whether to symmetrize the RHEEED images and segmented patterns about the vertical axis before obtaining the DataFrame representation. Defaults to False.

  • return_as_features (bool) – Whether to return the final feature-forward DataFrame. Defaults to True.

Returns:

Pandas DataFrame object of RHEED node and edge features.

Return type:

(DataFrame)