From 686ad7f27ce90334dd7a8ef9d7cb9e64c64ee419 Mon Sep 17 00:00:00 2001 From: Patrick Avery Date: Wed, 3 Feb 2021 12:43:44 -0600 Subject: [PATCH] Use masked indices for active_hkls in indexing The "active_hkls" are supposed to use masked indices (indices for the hkl data list where the exclusions and tThMax have already been applied). Before, they were trying to use unmasked indices, which refer to the hkl data list where exclusions and tThMax have not been applied. It appears this convention is done nearly everywhere in hexrd, so we should do it too. Signed-off-by: Patrick Avery --- hexrd/ui/indexing/create_config.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/hexrd/ui/indexing/create_config.py b/hexrd/ui/indexing/create_config.py index 16406b547..93a106cdf 100644 --- a/hexrd/ui/indexing/create_config.py +++ b/hexrd/ui/indexing/create_config.py @@ -17,7 +17,7 @@ def create_indexing_config(): indexing_config = copy.deepcopy(HexrdConfig().indexing_config) material = HexrdConfig().active_material omaps = indexing_config['find_orientations']['orientation_maps'] - omaps['active_hkls'] = active_hkl_indices(material.planeData) + omaps['active_hkls'] = list(range(len(material.planeData.getHKLs()))) # Set the active material on the config tmp = indexing_config.setdefault('material', {}) @@ -57,17 +57,3 @@ def create_indexing_config(): config.image_series = ims_dict return config - - -def active_hkl_indices(plane_data): - # Return a list of active indices, taking into account exclusions and - # tTh limitations. - - # These need to be lists, or the `in` operator won't work properly - hkls = plane_data.getHKLs().tolist() - full_hkl_list = [x['hkl'].tolist() for x in plane_data.hklDataList] - - def hkl_is_active(i): - return full_hkl_list[i] in hkls - - return [i for i in range(len(full_hkl_list)) if hkl_is_active(i)]