Пример #1
0
    def update(self):
        """
            Update data members according to reduction results
        """
        if IS_IN_MANTIDPLOT:
            from mantid.api import PropertyManagerDataService
            from reduction_workflow.command_interface import ReductionSingleton
            property_manager_name = ReductionSingleton().get_reduction_table_name()
            property_manager = PropertyManagerDataService.retrieve(property_manager_name)
            if property_manager.existsProperty("LatestBeamCenterX"):
                self.x_position = property_manager.getProperty("LatestBeamCenterX").value
            if property_manager.existsProperty("LatestBeamCenterY"):
                self.y_position = property_manager.getProperty("LatestBeamCenterY").value

            if self.use_sample_beam_center:
                self.flood_x_position = self.x_position
                self.flood_y_position = self.y_position
            elif self.sensitivity_corr:
                if property_manager.existsProperty("SensitivityBeamCenterXUsed"):
                    self.flood_x_position = property_manager.getProperty("SensitivityBeamCenterXUsed").value
                else:
                    self.flood_x_position = self.x_position
                if property_manager.existsProperty("SensitivityBeamCenterYUsed"):
                    self.flood_y_position = property_manager.getProperty("SensitivityBeamCenterYUsed").value
                else:
                    self.flood_y_position = self.y_position
    def update(self):
        """
            Update data members according to reduction results
        """
        if IS_IN_MANTIDPLOT:
            from mantid.api import PropertyManagerDataService
            from reduction_workflow.command_interface import ReductionSingleton
            property_manager_name = ReductionSingleton(
            ).get_reduction_table_name()
            property_manager = PropertyManagerDataService.retrieve(
                property_manager_name)
            if property_manager.existsProperty("LatestBeamCenterX"):
                self.x_position = property_manager.getProperty(
                    "LatestBeamCenterX").value
            if property_manager.existsProperty("LatestBeamCenterY"):
                self.y_position = property_manager.getProperty(
                    "LatestBeamCenterY").value

            if self.use_sample_beam_center:
                self.flood_x_position = self.x_position
                self.flood_y_position = self.y_position
            elif self.sensitivity_corr:
                if property_manager.existsProperty(
                        "SensitivityBeamCenterXUsed"):
                    self.flood_x_position = property_manager.getProperty(
                        "SensitivityBeamCenterXUsed").value
                else:
                    self.flood_x_position = self.x_position
                if property_manager.existsProperty(
                        "SensitivityBeamCenterYUsed"):
                    self.flood_y_position = property_manager.getProperty(
                        "SensitivityBeamCenterYUsed").value
                else:
                    self.flood_y_position = self.y_position
Пример #3
0
 def update(self):
     """
         Update data member from reduction output
     """
     if IS_IN_MANTIDPLOT:
         from mantid.api import PropertyManagerDataService
         from reduction_workflow.command_interface import ReductionSingleton
         property_manager_name = ReductionSingleton().get_reduction_table_name()
         property_manager = PropertyManagerDataService.retrieve(property_manager_name)
         if property_manager.existsProperty("MeasuredBckTransmissionValue"):
             self.bck_transmission = property_manager.getProperty("MeasuredBckTransmissionValue").value
         if property_manager.existsProperty("MeasuredBckTransmissionError"):
             self.bck_transmission_spread = property_manager.getProperty("MeasuredBckTransmissionError").value
Пример #4
0
 def update(self):
     """
         Update transmission from reduction output
     """
     if IS_IN_MANTIDPLOT:
         from mantid.api import PropertyManagerDataService
         from reduction_workflow.command_interface import ReductionSingleton
         property_manager_name = ReductionSingleton().get_reduction_table_name()
         property_manager = PropertyManagerDataService.retrieve(property_manager_name)
         if property_manager.existsProperty("MeasuredTransmissionValue"):
             self.transmission = property_manager.getProperty("MeasuredTransmissionValue").value
         if property_manager.existsProperty("MeasuredTransmissionError"):
             self.transmission_spread = property_manager.getProperty("MeasuredTransmissionError").value
Пример #5
0
    def update(self):
        """
            Update data members according to reduction results
        """
        if IS_IN_MANTIDPLOT:
            # Allow the use of the old reducer code, which uses
            # the Python API v1
            if self.PYTHON_API==1:
                from reduction.command_interface import ReductionSingleton
                if ReductionSingleton()._beam_finder is not None:
                    pos = ReductionSingleton()._beam_finder.get_beam_center()
                    self.x_position = pos[0]
                    self.y_position = pos[1]
                    
                    if self.use_sample_beam_center:
                        self.flood_x_position = self.x_position
                        self.flood_y_position = self.y_position
                    elif self.sensitivity_corr:
                        pos_flood = ReductionSingleton()._sensitivity_correcter.get_beam_center()
                        self.flood_x_position = pos_flood[0]
                        self.flood_y_position = pos_flood[1]
            else:
                from mantid.api import PropertyManagerDataService
                from reduction_workflow.command_interface import ReductionSingleton
                property_manager_name = ReductionSingleton().get_reduction_table_name()
                property_manager = PropertyManagerDataService.retrieve(property_manager_name)
                if property_manager.existsProperty("LatestBeamCenterX"):
                    self.x_position = property_manager.getProperty("LatestBeamCenterX").value
                if property_manager.existsProperty("LatestBeamCenterY"):
                    self.y_position = property_manager.getProperty("LatestBeamCenterY").value

                if self.use_sample_beam_center:
                    self.flood_x_position = self.x_position
                    self.flood_y_position = self.y_position
                elif self.sensitivity_corr:
                    if property_manager.existsProperty("SensitivityBeamCenterXUsed"):
                        self.flood_x_position = property_manager.getProperty("SensitivityBeamCenterXUsed").value
                    else:
                        self.flood_x_position = self.x_position
                    if property_manager.existsProperty("SensitivityBeamCenterYUsed"):
                        self.flood_y_position = property_manager.getProperty("SensitivityBeamCenterYUsed").value
                    else:
                        self.flood_y_position = self.y_position
Пример #6
0
 def update(self):
     """
         Update transmission from reduction output
     """
     if IS_IN_MANTIDPLOT:
         # Allow the use of the old reducer code, which 
         # uses the Python API v1
         if self.PYTHON_API==1:
             from reduction.command_interface import ReductionSingleton
             if ReductionSingleton()._transmission_calculator is not None:
                 trans = ReductionSingleton()._transmission_calculator.get_transmission()
                 self.transmission = trans[0]
                 self.transmission_spread = trans[1]
         else:
             from mantid.api import PropertyManagerDataService
             from reduction_workflow.command_interface import ReductionSingleton
             property_manager_name = ReductionSingleton().get_reduction_table_name()
             property_manager = PropertyManagerDataService.retrieve(property_manager_name)
             if property_manager.existsProperty("MeasuredTransmissionValue"):
                 self.transmission = property_manager.getProperty("MeasuredTransmissionValue").value
             if property_manager.existsProperty("MeasuredTransmissionError"):
                 self.transmission_spread = property_manager.getProperty("MeasuredTransmissionError").value
Пример #7
0
 def update(self):
     """
         Update data member from reduction output
     """
     if IS_IN_MANTIDPLOT:
         # Allow for the old reducer code to work.
         # The old reducer code uses the Python API v1.
         if self.PYTHON_API==1:
             from reduction.command_interface import ReductionSingleton
             if ReductionSingleton()._background_subtracter is not None:
                 trans = ReductionSingleton()._background_subtracter.get_transmission()
                 if trans is not None:
                     self.bck_transmission = trans[0]
                     self.bck_transmission_spread = trans[1]
         else:
             from mantid.api import PropertyManagerDataService
             from reduction_workflow.command_interface import ReductionSingleton
             property_manager_name = ReductionSingleton().get_reduction_table_name()
             property_manager = PropertyManagerDataService.retrieve(property_manager_name)
             if property_manager.existsProperty("MeasuredBckTransmissionValue"):
                 self.bck_transmission = property_manager.getProperty("MeasuredBckTransmissionValue").value
             if property_manager.existsProperty("MeasuredBckTransmissionError"):
                 self.bck_transmission_spread = property_manager.getProperty("MeasuredBckTransmissionError").value