Пример #1
0
    def do_execute(self, data_info, use_cached, publish_to_ads, progress,
                   parent_alg):
        # Get all entries from the state file
        file_infos, period_infos = get_file_and_period_information_from_data(
            data_info)

        # Several important remarks regarding the loading
        # 1. Scatter files are loaded as with monitors and the data in two separate workspaces.
        # 2. Transmission files are loaded entirely. If they are event mode then only the monitor is loaded as the data.
        # 3. Added data is handled differently because it is already processed data.

        workspaces = {}
        workspace_monitors = {}

        if data_info.calibration is not None:
            calibration_file = data_info.calibration
        else:
            calibration_file = ""

        for key, value in list(file_infos.items()):
            # Loading
            report_message = "Loading {0}".format(SANSDataType.to_string(key))
            progress.report(report_message)

            workspace_pack, workspace_monitors_pack = load_isis(
                key, value, period_infos[key], use_cached, calibration_file,
                parent_alg)

            # Add them to the already loaded workspaces
            workspaces.update(workspace_pack)
            if workspace_monitors_pack is not None:
                workspace_monitors.update(workspace_monitors_pack)

        # Apply the calibration if any exists.
        if data_info.calibration:
            report_message = "Applying calibration."
            progress.report(report_message)
            apply_calibration(calibration_file, workspaces, workspace_monitors,
                              use_cached, publish_to_ads, parent_alg)

        # Apply corrections for transmission workspaces
        transmission_correction = get_transmission_correction(data_info)
        transmission_correction.correct(workspaces, parent_alg)

        return workspaces, workspace_monitors
Пример #2
0
    def do_execute(self, data_info, use_cached, publish_to_ads, progress, parent_alg):
        # Get all entries from the state file
        file_infos, period_infos = get_file_and_period_information_from_data(data_info)

        # Several important remarks regarding the loading
        # 1. Scatter files are loaded as with monitors and the data in two separate workspaces.
        # 2. Transmission files are loaded entirely. If they are event mode then only the monitor is loaded as the data.
        # 3. Added data is handled differently because it is already processed data.

        workspaces = {}
        workspace_monitors = {}

        if data_info.calibration is not None:
            calibration_file = data_info.calibration
        else:
            calibration_file = ""

        for key, value in list(file_infos.items()):
            # Loading
            report_message = "Loading {0}".format(SANSDataType.to_string(key))
            progress.report(report_message)

            workspace_pack, workspace_monitors_pack = load_isis(key, value, period_infos[key],
                                                                use_cached, calibration_file,
                                                                parent_alg)

            # Add them to the already loaded workspaces
            workspaces.update(workspace_pack)
            if workspace_monitors_pack is not None:
                workspace_monitors.update(workspace_monitors_pack)

        # Apply the calibration if any exists.
        if data_info.calibration:
            report_message = "Applying calibration."
            progress.report(report_message)
            apply_calibration(calibration_file, workspaces, workspace_monitors, use_cached, publish_to_ads, parent_alg)

        # Apply corrections for transmission workspaces
        transmission_correction = get_transmission_correction(data_info)
        transmission_correction.correct(workspaces, parent_alg)

        return workspaces, workspace_monitors