def _run_test(transmission_workspace, direct_workspace, state, is_sample=True):
        data_type = "Sample" if is_sample else "Can"

        workspace, unfitted =\
            calculate_transmission(transmission_ws=transmission_workspace,
                                   direct_ws=direct_workspace, data_type_str=data_type,
                                   state_adjustment_calculate_transmission=state.adjustment.calculate_transmission)
        return workspace, unfitted
    def _run_test(transmission_workspace,
                  direct_workspace,
                  state,
                  is_sample=True):
        data_type = "Sample" if is_sample else "Can"
        wav_range = state.adjustment.calculate_transmission.wavelength_interval.wavelength_full_range

        workspace, unfitted =\
            calculate_transmission(transmission_ws=transmission_workspace, wav_range=wav_range,
                                   direct_ws=direct_workspace, data_type_str=data_type,
                                   state_adjustment_calculate_transmission=state.adjustment.calculate_transmission)
        return workspace, unfitted
    def _get_calculated_transmission_workspace(self, transmission_ws, direct_ws):
        """
        Creates the fitted transmission workspace.
        Note that this step is not mandatory. If no transmission and direct workspaces are provided, then we
        don't have to do anything here.
        """

        fitted_data, unfitted_data = None, None

        if transmission_ws and direct_ws:
            data_type = self._data_type
            calc_trans_state = self._state.calculate_transmission

            fitted_data, unfitted_data = calculate_transmission(
                data_type_str=data_type, state_adjustment_calculate_transmission=calc_trans_state,
                transmission_ws=transmission_ws, direct_ws=direct_ws)
        return fitted_data, unfitted_data
示例#4
0
    def _get_calculated_transmission_workspace(self, state):
        """
        Creates the fitted transmission workspace.

        Note that this step is not mandatory. If no transmission and direct workspaces are provided, then we
        don't have to do anything here.
        :param state: a SANSState object.
        :return: a fitted transmission workspace and the unfitted data.
        """
        transmission_workspace = self.getProperty("TransmissionWorkspace").value
        direct_workspace = self.getProperty("DirectWorkspace").value
        if transmission_workspace and direct_workspace:
            data_type = self.getProperty("DataType").value

            fitted_data, unfitted_data = \
                calculate_transmission(direct_ws=direct_workspace, data_type_str=data_type,
                                       transmission_ws=transmission_workspace,
                                       state_adjustment_calculate_transmission=state.adjustment.calculate_transmission)

        else:
            fitted_data = None
            unfitted_data = None
        return fitted_data, unfitted_data