From 958642e25a56b84a28e4b6390c5550948794a747 Mon Sep 17 00:00:00 2001 From: alex-rakowski Date: Fri, 27 Oct 2023 15:05:18 -0700 Subject: [PATCH] adding assert statement --- py4DSTEM/process/diffraction/crystal_ACOM.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/py4DSTEM/process/diffraction/crystal_ACOM.py b/py4DSTEM/process/diffraction/crystal_ACOM.py index 60c284263..0c01dc70d 100644 --- a/py4DSTEM/process/diffraction/crystal_ACOM.py +++ b/py4DSTEM/process/diffraction/crystal_ACOM.py @@ -900,9 +900,13 @@ def match_single_pattern( Orientation class containing all outputs fig, ax: handles Figure handles for the plotting output - """ + """ + + # adding assert statement for checking self.orientation_ref is present + assert hasattr( + self, "orientation_ref" + ), "orientation_plan must be run with 'calculate_correlation_array=True'" - # init orientation output orientation = Orientation(num_matches=num_matches_return) if bragg_peaks.data.shape[0] < min_number_peaks: return orientation