parameters: (self, exp_number, scan_number, peak_ws_name, md_ws_name)
return_statement: return True, self._myPeakInfoDict[(exp_number, scan_number)]
docstring: Add or modify a PeakInfo object for UB matrix calculation and etc.
          :param exp_number:
          :param scan_number:
          :param peak_ws_name:
          :param md_ws_name:
          :return: (boolean, PeakInfo/string)
docstring_summary: Add or modify a PeakInfo object for UB matrix calculation and etc.
          :param exp_number:
          :param scan_number:
          :param peak_ws_name:
          :param md_ws_name:
          :return: (boolean, PeakInfo/string)
docstring_tokens: Add or modify a PeakInfo object for UB matrix calculation and etc . : param exp_number : : param scan_number : : param peak_ws_name : : param md_ws_name : : return : ( boolean PeakInfo / string )
function: def _set_peak_info(self, exp_number, scan_number, peak_ws_name, md_ws_name):
          """ Add or modify a PeakInfo object for UB matrix calculation and etc.
          :param exp_number:
          :param scan_number:
          :param peak_ws_name:
          :param md_ws_name:
          :return: (boolean, PeakInfo/string)
          """
          # check
          assert isinstance(exp_number, int), 'Experiment number must be an integer.'
          assert isinstance(scan_number, int), 'Scan number must an be integer.'
          assert isinstance(peak_ws_name, str), 'PeaksWorkspace must be a string.'
          assert isinstance(md_ws_name, str), 'MDEventWorkspace name must be a string.'
  
          # check whether there is a redundant creation of PeakProcessRecord for the same (exp, scan) combination
          if (exp_number, scan_number) in self._myPeakInfoDict:
              peak_info = self._myPeakInfoDict[(exp_number, scan_number)]
              if self._debugPrintMode:
                  print('[ERROR] PeakProcessRecord for Exp {0} Scan {1} shall not '
                        'be created twice!'.format(exp_number, scan_number))
                  print('[CONTINUE] New PeaksWorkspace = {0} vs Existing '
                        'PeaksWorkspace = {1}.'.format(peak_ws_name, peak_info.peaks_workspace))
                  print('[CONTINUE] New MDEventWorkspace = {0} vs Existing '
                        'MDEventWorkspace = {1}.'.format(md_ws_name, peak_info.md_workspace))
              return False, peak_info
          # END-IF
  
          # create a PeakInfo instance if it does not exist
          two_theta = self.get_sample_log_value(exp_number, scan_number, 1, '2theta')
          self._2thetaLookupTable[two_theta] = exp_number, scan_number
          self._myPeakInfoDict[(exp_number, scan_number)] = PeakProcessRecord(exp_number, scan_number, peak_ws_name,
                                                                              two_theta)
  
          # set the other information
          self._myPeakInfoDict[(exp_number, scan_number)].set_data_ws_name(md_ws_name)
          err_msg = self._myPeakInfoDict[(exp_number, scan_number)].calculate_peak_center()
          if self._debugPrintMode and len(err_msg) > 0:
              print ('[Error] during calculating peak center:{0}'.format(err_msg))
  
          return True, self._myPeakInfoDict[(exp_number, scan_number)]
function_tokens: def _set_peak_info ( self , exp_number , scan_number , peak_ws_name , md_ws_name ) : # check assert isinstance ( exp_number , int ) , 'Experiment number must be an integer.' assert isinstance ( scan_number , int ) , 'Scan number must an be integer.' assert isinstance ( peak_ws_name , str ) , 'PeaksWorkspace must be a string.' assert isinstance ( md_ws_name , str ) , 'MDEventWorkspace name must be a string.' # check whether there is a redundant creation of PeakProcessRecord for the same (exp, scan) combination if ( exp_number , scan_number ) in self . _myPeakInfoDict : peak_info = self . _myPeakInfoDict [ ( exp_number , scan_number ) ] if self . _debugPrintMode : print ( '[ERROR] PeakProcessRecord for Exp {0} Scan {1} shall not ' 'be created twice!' . format ( exp_number , scan_number ) ) print ( '[CONTINUE] New PeaksWorkspace = {0} vs Existing ' 'PeaksWorkspace = {1}.' . format ( peak_ws_name , peak_info . peaks_workspace ) ) print ( '[CONTINUE] New MDEventWorkspace = {0} vs Existing ' 'MDEventWorkspace = {1}.' . format ( md_ws_name , peak_info . md_workspace ) ) return False , peak_info # END-IF # create a PeakInfo instance if it does not exist two_theta = self . get_sample_log_value ( exp_number , scan_number , 1 , '2theta' ) self . _2thetaLookupTable [ two_theta ] = exp_number , scan_number self . _myPeakInfoDict [ ( exp_number , scan_number ) ] = PeakProcessRecord ( exp_number , scan_number , peak_ws_name , two_theta ) # set the other information self . _myPeakInfoDict [ ( exp_number , scan_number ) ] . set_data_ws_name ( md_ws_name ) err_msg = self . _myPeakInfoDict [ ( exp_number , scan_number ) ] . calculate_peak_center ( ) if self . _debugPrintMode and len ( err_msg ) > 0 : print ( '[Error] during calculating peak center:{0}' . format ( err_msg ) ) return True , self . _myPeakInfoDict [ ( exp_number , scan_number ) ]