Skip to content

Conversation

@serinlee1065
Copy link
Contributor

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

return_similarity : if True, return the similarity array
"""
if self.r_space_mask is None:
self.set_mask(r_space_mask)
Copy link
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

sim_averaged = np.mean(self.similarity, axis=2)

# Assigning the background as 'counted'
sim_averaged[~self.r_space_mask] = -1.0
Copy link
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
Copy link
Collaborator

smribet commented Sep 29, 2025

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