def get_state(self): """ Returns an object with the state of the interface """ m = ReductionOptions() m.instrument_name = self._summary.instr_name_label.text() # Absolute scaling m.scaling_factor = util._check_and_get_float_line_edit( self._summary.scale_edit) m.calculate_scale = self._summary.scale_chk.isChecked() m.scaling_direct_file = unicode(self._summary.scale_data_edit.text()) m.scaling_att_trans = util._check_and_get_float_line_edit( self._summary.scale_att_trans_edit) m.scaling_beam_diam = util._check_and_get_float_line_edit( self._summary.scale_beam_radius_edit, min=0.0) m.manual_beam_diam = self._summary.beamstop_chk.isChecked() # Detector offset input if self._summary.detector_offset_chk.isChecked(): m.detector_offset = util._check_and_get_float_line_edit( self._summary.detector_offset_edit) # Sample-detector distance if self._summary.sample_dist_chk.isChecked(): m.sample_detector_distance = util._check_and_get_float_line_edit( self._summary.sample_dist_edit) # Solid angle correction m.solid_angle_corr = self._summary.solid_angle_chk.isChecked() # Dark current m.dark_current_corr = self._summary.dark_current_check.isChecked() m.dark_current_data = unicode(self._summary.dark_file_edit.text()) # Q range m.n_q_bins = util._check_and_get_int_line_edit( self._summary.n_q_bins_edit) m.log_binning = self._summary.log_binning_radio.isChecked() # TOF cuts m.use_config_cutoff = self._summary.tof_cut_chk.isChecked() m.low_TOF_cut = util._check_and_get_float_line_edit( self._summary.low_tof_edit) m.high_TOF_cut = util._check_and_get_float_line_edit( self._summary.high_tof_edit) # Config Mask m.use_config_mask = self._summary.config_mask_chk.isChecked() # Mask detector IDs m.use_mask_file = self._summary.mask_check.isChecked() m.mask_file = unicode(self._summary.mask_edit.text()) m.detector_ids = self._masked_detectors if self._in_mantidplot: from mantid.api import AnalysisDataService import mantid.simpleapi as api if AnalysisDataService.doesExist(self.mask_ws): ws, masked_detectors = api.ExtractMask( InputWorkspace=self.mask_ws, OutputWorkspace="__edited_mask") m.detector_ids = [int(i) for i in masked_detectors] # Resolution parameters m.compute_resolution = self._summary.resolution_chk.isChecked() m.sample_aperture_diameter = util._check_and_get_float_line_edit( self._summary.sample_apert_edit) m.perform_TOF_correction = self._summary.tof_correction_chk.isChecked() m.use_beam_monitor = self._summary.beam_monitor_chk.isChecked() m.beam_monitor_reference = unicode( self._summary.beam_monitor_edit.text()) # Output directory m.use_data_directory = self._summary.use_data_dir_radio.isChecked() m.output_directory = str(self._summary.output_dir_edit.text()) self._settings.data_output_dir = m.output_directory self._settings.emit_key_value("DARK_CURRENT", str(self._summary.dark_file_edit.text())) return m
def get_state(self): """ Returns an object with the state of the interface """ m = ReductionOptions() m.instrument_name = self._summary.instr_name_label.text() # Absolute scaling m.scaling_factor = util._check_and_get_float_line_edit(self._summary.scale_edit) m.calculate_scale = self._summary.scale_chk.isChecked() m.scaling_direct_file = unicode(self._summary.scale_data_edit.text()) m.scaling_att_trans = util._check_and_get_float_line_edit(self._summary.scale_att_trans_edit) m.scaling_beam_diam = util._check_and_get_float_line_edit(self._summary.scale_beam_radius_edit, min=0.0) m.manual_beam_diam = self._summary.beamstop_chk.isChecked() # Detector offset input if self._summary.detector_offset_chk.isChecked(): m.detector_offset = util._check_and_get_float_line_edit(self._summary.detector_offset_edit) # Sample-detector distance if self._summary.sample_dist_chk.isChecked(): m.sample_detector_distance = util._check_and_get_float_line_edit(self._summary.sample_dist_edit) # Solid angle correction m.solid_angle_corr = self._summary.solid_angle_chk.isChecked() # Dark current m.dark_current_corr = self._summary.dark_current_check.isChecked() m.dark_current_data = unicode(self._summary.dark_file_edit.text()) # Q range m.n_q_bins = util._check_and_get_int_line_edit(self._summary.n_q_bins_edit) m.log_binning = self._summary.log_binning_radio.isChecked() # TOF cuts m.use_config_cutoff = self._summary.tof_cut_chk.isChecked() m.low_TOF_cut = util._check_and_get_float_line_edit(self._summary.low_tof_edit) m.high_TOF_cut = util._check_and_get_float_line_edit(self._summary.high_tof_edit) # Config Mask m.use_config_mask = self._summary.config_mask_chk.isChecked() # Mask detector IDs m.use_mask_file = self._summary.mask_check.isChecked() m.mask_file = unicode(self._summary.mask_edit.text()) m.detector_ids = self._masked_detectors if AnalysisDataService.doesExist(self.mask_ws): ws, masked_detectors = ExtractMask(InputWorkspace=self.mask_ws, OutputWorkspace="__edited_mask") m.detector_ids = [int(i) for i in masked_detectors] # Resolution parameters m.compute_resolution = self._summary.resolution_chk.isChecked() m.sample_aperture_diameter = util._check_and_get_float_line_edit(self._summary.sample_apert_edit) m.perform_TOF_correction = self._summary.tof_correction_chk.isChecked() m.use_beam_monitor = self._summary.beam_monitor_chk.isChecked() m.beam_monitor_reference = unicode(self._summary.beam_monitor_edit.text()) # Output directory m.use_data_directory = self._summary.use_data_dir_radio.isChecked() m.output_directory = str(self._summary.output_dir_edit.text()) self._settings.data_output_dir = m.output_directory self._settings.emit_key_value("DARK_CURRENT", str(self._summary.dark_file_edit.text())) self._settings.emit_key_value("OUTPUT_DIR", m.output_directory) return m
def get_state(self): """ Returns an object with the state of the interface """ m = ReductionOptions() m.instrument_name = self._summary.instr_name_label.text() # Absolute scaling m.scaling_factor = util._check_and_get_float_line_edit(self._summary.scale_edit) m.calculate_scale = self._summary.scale_chk.isChecked() m.scaling_direct_file = unicode(self._summary.scale_data_edit.text()) m.scaling_att_trans = util._check_and_get_float_line_edit(self._summary.scale_att_trans_edit) m.scaling_beam_diam = util._check_and_get_float_line_edit(self._summary.scale_beam_radius_edit, min=0.0) m.manual_beam_diam = self._summary.beamstop_chk.isChecked() # Detector offset input if self._summary.detector_offset_chk.isChecked(): m.detector_offset = util._check_and_get_float_line_edit(self._summary.detector_offset_edit) # Sample-detector distance if self._summary.sample_dist_chk.isChecked(): m.sample_detector_distance = util._check_and_get_float_line_edit(self._summary.sample_dist_edit) # Solid angle correction m.solid_angle_corr = self._summary.solid_angle_chk.isChecked() # Dark current m.dark_current_corr = self._summary.dark_current_check.isChecked() m.dark_current_data = unicode(self._summary.dark_file_edit.text()) # Q range m.n_q_bins = util._check_and_get_int_line_edit(self._summary.n_q_bins_edit) m.log_binning = self._summary.log_binning_radio.isChecked() # TOF cuts m.use_config_cutoff = self._summary.tof_cut_chk.isChecked() m.low_TOF_cut = util._check_and_get_float_line_edit(self._summary.low_tof_edit) m.high_TOF_cut = util._check_and_get_float_line_edit(self._summary.high_tof_edit) # Config Mask m.use_config_mask = self._summary.config_mask_chk.isChecked() # Mask detector IDs m.use_mask_file = self._summary.mask_check.isChecked() m.mask_file = unicode(self._summary.mask_edit.text()) m.detector_ids = self._masked_detectors if self._in_mantidplot: if mtd.workspaceExists(self.mask_ws): masked_detectors = GetMaskedDetectors(self.mask_ws) ids_str = masked_detectors.getPropertyValue("DetectorList") m.detector_ids = map(int, ids_str.split(',')) # Resolution parameters m.compute_resolution = self._summary.resolution_chk.isChecked() m.sample_aperture_diameter = util._check_and_get_float_line_edit(self._summary.sample_apert_edit) # Output directory m.use_data_directory = self._summary.use_data_dir_radio.isChecked() m.output_directory = str(self._summary.output_dir_edit.text()) return m