Esempio n. 1
0
 def create_EAGroup(self, group_name, detector, run_number):
     # This method should be used to create EAGroups as it sets error notifier
     group = EAGroup(group_name=group_name,
                     detector=detector,
                     run_number=run_number)
     group.set_error_notifier(self.error_notifier)
     return group
Esempio n. 2
0
def get_default_grouping(loadedData, error_notifier=None):
    """this creates the first set of groups listed in the grouping table of the Elemental Analysis GUI
        For single workspace names the detector is found by taking everything after ; in the name
        For example : 2695; Detector 1 --> Detector 1
        For co-added workspaces the detector is found by taking everything before
        For example : Detector 1_2695-2686 --> Detector 1
    """
    groups = []
    run_list = loadedData.get_parameter("run")
    for run_item in run_list:
        for workspace in loadedData.get_data(run=run_item)["workspace"]:
            group_name = str(workspace)
            if not is_group_valid(group_name):
                continue
            detector_name = (group_name.split(';',
                                              1)[-1].lstrip()).split('_', 1)[0]
            run_number = str(run_item).replace('[', '').replace(']', '')
            group = EAGroup(group_name=group_name,
                            detector=detector_name,
                            run_number=run_number)
            if error_notifier is not None:
                group.set_error_notifier(error_notifier)
            groups += [group]
    return groups