예제 #1
0
    def _publish_to_ADS(self, sample_quartiles):
        output_workspaces = []
        for key in sample_quartiles:
            output_workspaces.append(MaskingQuadrant.to_string(key))
            AnalysisDataService.addOrReplace(MaskingQuadrant.to_string(key), sample_quartiles[key])

        return output_workspaces
예제 #2
0
    def _publish_to_ADS(sample_quartiles):
        output_workspaces = []
        for key in sample_quartiles:
            assert isinstance(key, MaskingQuadrant)
            output_workspaces.append(key.value)
            AnalysisDataService.addOrReplace(key.value, sample_quartiles[key])

        return output_workspaces
    def PyExec(self):
        # Read the state
        state_property_manager = self.getProperty("SANSState").value
        state = create_deserialized_sans_state_from_property_manager(
            state_property_manager)

        # --------------------------------------
        # Get the monitor normalization workspace
        # --------------------------------------
        monitor_normalization_workspace = self._get_monitor_normalization_workspace(
            state)

        # --------------------------------------
        # Get the calculated transmission
        # --------------------------------------
        calculated_transmission_workspace, unfitted_transmission_workspace =\
            self._get_calculated_transmission_workspace(state)

        # --------------------------------------
        # Get the wide angle correction workspace
        # --------------------------------------
        wave_length_and_pixel_adjustment_workspace = self._get_wide_angle_correction_workspace(
            state, calculated_transmission_workspace)  # noqa

        # --------------------------------------------
        # Get the full wavelength and pixel adjustment
        # --------------------------------------------
        wave_length_adjustment_workspace, \
        pixel_length_adjustment_workspace = self._get_wavelength_and_pixel_adjustment_workspaces(state,
                                                                            monitor_normalization_workspace,  # noqa
                                                                            calculated_transmission_workspace)  # noqa

        if wave_length_adjustment_workspace:
            self.setProperty("OutputWorkspaceWavelengthAdjustment",
                             wave_length_adjustment_workspace)
        if pixel_length_adjustment_workspace:
            self.setProperty("OutputWorkspacePixelAdjustment",
                             pixel_length_adjustment_workspace)
        if wave_length_and_pixel_adjustment_workspace:
            self.setProperty("OutputWorkspaceWavelengthAndPixelAdjustment",
                             wave_length_and_pixel_adjustment_workspace)

        if calculated_transmission_workspace and unfitted_transmission_workspace and state.adjustment.show_transmission:
            data_type = self.getProperty("DataType").value
            output_workspace_name, output_workspace_base_name = get_standard_output_workspace_name(
                state,
                state.reduction.reduction_mode,
                transmission=True,
                data_type=data_type)
            AnalysisDataService.addOrReplace(
                output_workspace_base_name, calculated_transmission_workspace)
            AnalysisDataService.addOrReplace(
                output_workspace_base_name + '_unfitted',
                unfitted_transmission_workspace)
    def PyExec(self):
        # Read the state
        state_property_manager = self.getProperty("SANSState").value
        state = create_deserialized_sans_state_from_property_manager(state_property_manager)

        # --------------------------------------
        # Get the monitor normalization workspace
        # --------------------------------------
        monitor_normalization_workspace = self._get_monitor_normalization_workspace(state)

        # --------------------------------------
        # Get the calculated transmission
        # --------------------------------------
        calculated_transmission_workspace, unfitted_transmission_workspace =\
            self._get_calculated_transmission_workspace(state)

        # --------------------------------------
        # Get the wide angle correction workspace
        # --------------------------------------
        wave_length_and_pixel_adjustment_workspace = self._get_wide_angle_correction_workspace(state,
                                                                   calculated_transmission_workspace)  # noqa

        # --------------------------------------------
        # Get the full wavelength and pixel adjustment
        # --------------------------------------------
        wave_length_adjustment_workspace, \
        pixel_length_adjustment_workspace = self._get_wavelength_and_pixel_adjustment_workspaces(state,
                                                                            monitor_normalization_workspace,  # noqa
                                                                            calculated_transmission_workspace)  # noqa

        if wave_length_adjustment_workspace:
            self.setProperty("OutputWorkspaceWavelengthAdjustment", wave_length_adjustment_workspace)
        if pixel_length_adjustment_workspace:
            self.setProperty("OutputWorkspacePixelAdjustment", pixel_length_adjustment_workspace)
        if wave_length_and_pixel_adjustment_workspace:
            self.setProperty("OutputWorkspaceWavelengthAndPixelAdjustment", wave_length_and_pixel_adjustment_workspace)

        if calculated_transmission_workspace and unfitted_transmission_workspace and state.adjustment.show_transmission:
            data_type = self.getProperty("DataType").value
            output_workspace_name, output_workspace_base_name = get_standard_output_workspace_name(state,
                                                                                                   state.reduction.reduction_mode
                                                                                                   , transmission = True,
                                                                                                   data_type = data_type)
            AnalysisDataService.addOrReplace(output_workspace_base_name, calculated_transmission_workspace)
            AnalysisDataService.addOrReplace(output_workspace_base_name + '_unfitted', unfitted_transmission_workspace)