From e23878c8fe25cb8fa6bbd7df72b3f26ab5781f63 Mon Sep 17 00:00:00 2001 From: alex-rakowski Date: Fri, 3 Nov 2023 16:31:40 -0700 Subject: [PATCH] adding to_strainmap method --- py4DSTEM/braggvectors/braggvector_methods.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/py4DSTEM/braggvectors/braggvector_methods.py b/py4DSTEM/braggvectors/braggvector_methods.py index 2bd6ee8c8..065eb7d75 100644 --- a/py4DSTEM/braggvectors/braggvector_methods.py +++ b/py4DSTEM/braggvectors/braggvector_methods.py @@ -792,6 +792,21 @@ def mask_in_R(self, mask, update_inplace=False, returncalc=True): else: return + def to_strainmap(self, name: str = None): + """ + Generate a StrainMap object from the BraggVectors + equivalent to py4DSTEM.StrainMap(braggvectors=braggvectors) + + Args: + name (str, optional): The name of the strainmap. Defaults to None which reverts to default name 'strainmap'. + + Returns: + py4DSTEM.StrainMap: A py4DSTEM StrainMap object generated from the BraggVectors + """ + from py4DSTEM.process.strain import StrainMap + + return StrainMap(self, name) if name else StrainMap(self) + ######### END BraggVectorMethods CLASS ########