Skip to content

Updating cluster module and ACOM for cluster based strain mapping - #732

Merged
smribet merged 6 commits into
py4dstem:diffractionfrom
serinlee1065:diffraction
Nov 3, 2025
Merged

Updating cluster module and ACOM for cluster based strain mapping#732
smribet merged 6 commits into
py4dstem:diffractionfrom
serinlee1065:diffraction

Conversation

@serinlee1065

Copy link
Copy Markdown
Contributor

updating cluster module and ACOM to use cluster dataset for strain mapping

Comment thread py4DSTEM/process/utils/cluster.py Outdated
return_similarity : if True, return the similarity array
"""
if self.r_space_mask is None:
self.set_mask(r_space_mask)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this function exists

Comment thread py4DSTEM/process/utils/cluster.py Outdated
sim_averaged = np.mean(self.similarity, axis=2)

# Assigning the background as 'counted'
sim_averaged[~self.r_space_mask] = -1.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing errors. I would add checking earlier that your r_space_mask is a boolean array. If it is None you'll need to handle this earlier too.

@smribet

smribet commented Sep 29, 2025

Copy link
Copy Markdown
Collaborator

Hi @serinlee1065, thanks for submitting this! I adjusted the doc strings and deleted old code that was commented out. I removed the bg_thresholding function, as the same logic elsewhere in the code. I think your real space mask needs to be edited. Let me know if you have any questions.

@smribet
smribet merged commit c3909f8 into py4dstem:diffraction Nov 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants