atomicds.results.rheed_image.RHEEDImageCollection

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.

__init__(rheed_images: list[RHEEDImageResult], extra_data: list[dict] | None = None, sort_key: str | None = None)[source]

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.

Methods

__init__(rheed_images[, extra_data, sort_key])

Collection of RHEED images

align_fingerprints([node_df, inplace, ...])

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.

as_dict()

A JSON serializable dict representation of an object.

from_dict(d)

get_partial_json([json_kwargs, pickle_kwargs])

get_pattern_dataframe([streamline, ...])

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

load(file_path)

Loads a class from a provided json file.

save(json_path[, mkdir, json_kwargs, ...])

Utility that uses the standard tools of MSONable to convert the class to json format, but also save it to disk.

to_json()

Returns a json string representation of the MSONable object.

unsafe_hash()

Returns an hash of the current object.

validate_monty_v1(_MSONable__input_value)

Pydantic validator with correct signature for pydantic v1.x

validate_monty_v2(_MSONable__input_value, _)

Pydantic validator with correct signature for pydantic v2.x

Attributes

REDIRECT

extra_data

rheed_images

sort_key

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])

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)

as_dict() dict

A JSON serializable dict representation of an object.

classmethod from_dict(d)
Parameters:

d – Dict representation.

Returns:

MSONable class.

get_partial_json(json_kwargs=None, pickle_kwargs=None)
Parameters:
  • json_kwargs (dict) – Keyword arguments to pass to the serializer.

  • pickle_kwargs (dict) – Keyword arguments to pass to pickle.dump.

Returns:

The json encoding of the class and the name-object map if one is required, otherwise None.

Return type:

str, dict

classmethod load(file_path)

Loads a class from a provided json file.

Parameters:

file_path (os.PathLike) – The json file to load from.

Returns:

An instance of the class being reloaded.

Return type:

MSONable

save(json_path, mkdir=True, json_kwargs=None, pickle_kwargs=None, strict=True)

Utility that uses the standard tools of MSONable to convert the class to json format, but also save it to disk. In addition, this method intelligently uses pickle to individually pickle class objects that are not serializable, saving them separately. This maximizes the readability of the saved class information while allowing _any_ class to be at least partially serializable to disk.

For a fully MSONable class, only a class.json file will be saved to the location {save_dir}/class.json. For a partially MSONable class, additional information will be saved to the save directory at {save_dir}. This includes a pickled object for each attribute that e serialized.

Parameters:
  • file_path (os.PathLike) – The file to which to save the json object. A pickled object of the same name but different extension might also be saved if the class is not entirely MSONable.

  • mkdir (bool) – If True, makes the provided directory, including all parent directories.

  • json_kwargs (dict) – Keyword arguments to pass to the serializer.

  • pickle_kwargs (dict) – Keyword arguments to pass to pickle.dump.

  • strict (bool) – If True, will not allow you to overwrite existing files.

to_json() str

Returns a json string representation of the MSONable object.

unsafe_hash()

Returns an hash of the current object. This uses a generic but low performance method of converting the object to a dictionary, flattening any nested keys, and then performing a hash on the resulting object

classmethod validate_monty_v1(_MSONable__input_value)

Pydantic validator with correct signature for pydantic v1.x

classmethod validate_monty_v2(_MSONable__input_value, _)

Pydantic validator with correct signature for pydantic v2.x