From 5830a5432e363841df18d73876c88f838ff83cf9 Mon Sep 17 00:00:00 2001 From: minhuanli Date: Sat, 14 Dec 2024 21:32:53 -0500 Subject: [PATCH] take care of systematic absent incides --- SFC_Torch/Fmodel.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SFC_Torch/Fmodel.py b/SFC_Torch/Fmodel.py index fca911c..8b96797 100644 --- a/SFC_Torch/Fmodel.py +++ b/SFC_Torch/Fmodel.py @@ -337,6 +337,12 @@ def init_mtz(self, mtzdata, N_bins, expcolumns, set_experiment, freeflag, testse except: raise ValueError(f"{expcolumns} columns not included in the mtz file!") + # Make sure no systematic absent indices are included, and map to asu + if rs.utils.is_absent(mtz_reference.get_hkls(), mtz_reference.spacegroup).sum() > 0: + mtz_reference = mtz_reference[~rs.utils.is_absent(mtz_reference.get_hkls(), mtz_reference.spacegroup)] + print("Found systematic absent indices in the mtz, already dropped!", flush=True) + mtz_reference.hkl_to_asu(inplace=True, anomalous=self.anomalous) + if self.anomalous: # Try to get the wavelength from MTZ file try: