MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / set_map_keys

Method set_map_keys

pyxrf/model/draw_image.py:223–244  ·  view source on GitHub ↗

Create sorted list of map keys. The list starts with sorted sequence of emission lines, followed by the sorted list of scalers and other maps.

(self)

Source from the content-addressed store, hash-verified

221 return self.io_model.img_dict_keys[self.data_opt - 1]
222
223 def set_map_keys(self):
224 """
225 Create sorted list of map keys. The list starts with sorted sequence of emission lines,
226 followed by the sorted list of scalers and other maps.
227 """
228 self.map_keys.clear()
229 # The key to use with 'img_dict', the name of the current dataset.
230 plot_item = self._get_current_plot_item()
231 keys_unsorted = list(self.io_model.img_dict[plot_item].keys())
232 if len(keys_unsorted) != len(set(keys_unsorted)):
233 logger.warning(
234 f"DrawImageAdvanced:set_map_keys(): repeated keys in the dictionary 'img_dict': {keys_unsorted}"
235 )
236 keys_elines, keys_scalers = [], []
237 for key in keys_unsorted:
238 if check_if_eline_supported(key): # Check if 'key' is an emission line (such as "Ca_K")
239 keys_elines.append(key)
240 else:
241 keys_scalers.append(key)
242 keys_elines.sort()
243 keys_scalers.sort()
244 self.map_keys = keys_elines + keys_scalers
245
246 def select_dataset(self, dataset_index):
247 """

Callers 1

select_datasetMethod · 0.95

Calls 4

check_if_eline_supportedFunction · 0.85
clearMethod · 0.80
keysMethod · 0.80

Tested by

no test coverage detected