Skip to main content
The similarity pipeline embeds RHEED data as vectors, then uses those vectors to answer two different questions: which other growths look like this one, and how this growth is evolving relative to a reference. All four accept a workflow name that defaults to rheed_stationary. See Similarity for how the workflow is computed.

Find similar growths

query_rheed_embeddings() runs a k-nearest-neighbour query over the embedding index using an item’s own vectors:
The result is sorted by descending similarity, where 1.0 means identical. Alongside data_id and similarity, each row carries locus columns that pin down where in each recording the match occurred: source_index, neighbor_index, real_time_seconds, and unix_time_ms.

Coarse and fine queries

The kind parameter trades precision for query count:
window_span must match a span the data was actually embedded at. The backend caps top_k at 30. An empty DataFrame means this item has no embeddings for the given workflow and window span.

Fetch embedding vectors

Use get_embeddings() when you want the vectors themselves, for clustering, dimensionality reduction, or a custom distance metric:
The two kinds carry different metadata: Metadata arrays that do not apply to the returned kind are None. Page through large results with offset and limit:
When no embeddings exist for the requested workflow and window span, the SDK emits a UserWarning and returns an empty result instead of raising, so loops over many data IDs keep running. Check len(result.vectors) before using the array.

Retrieve stored matches

get_similarity_matches() returns the top matches the platform has already computed, which is the same ranking shown in the web app:
source_id accepts either a data ID or a physical sample ID. Set live_comparison=True to include the source entry’s still-streaming data in the comparison, and limit to cap the number of rows.

Fetch a similarity trajectory

get_similarity_trajectory() returns similarity against reference growths over time in a single call, without polling:
The timeseries_data DataFrame is indexed by ("Reference ID", "Time") with columns Similarity, Reference Name, UNIX Timestamp, Active, and Averaged Count. Restrict the comparison to specific references with reference_ids:

Poll a trajectory during a growth

For a run in progress, poll instead of fetching once. The Client exposes wrappers for the four polling styles:
Each forwards extra keyword arguments (distinct_by, until, max_polls, fire_immediately, jitter, on_error) to the underlying function in atomscale.similarity. See Poll Similarity Trajectory for the full polling walkthrough.

Next steps

RHEED Features and Masks

Query low-level features and segmentation masks.

Poll Similarity Trajectory

Monitor trajectories during a live growth.