parameters: (self, fit_method, min_=None, max_=None, override=True, selector='both')
docstring: Set how the transmission fraction fit is calculated, the range of wavelengths
              to use and the fit method
              @param min: minimum wavelength to use
              @param max: highest wavelength to use
              @param fit_method: the fit type to pass to CalculateTransmission ('Logarithmic' or 'Linear')or 'Off'
              @param override: if set to False this call won't override the settings set by a previous call (default True)
              @param selector: define if the given settings is valid for SAMPLE, CAN or BOTH transmissions.
docstring_summary: Set how the transmission fraction fit is calculated, the range of wavelengths
              to use and the fit method
docstring_tokens: Set how the transmission fraction fit is calculated the range of wavelengths to use and the fit method
function: def set_trans_fit(self, fit_method, min_=None, max_=None, override=True, selector='both'):
          """
              Set how the transmission fraction fit is calculated, the range of wavelengths
              to use and the fit method
              @param min: minimum wavelength to use
              @param max: highest wavelength to use
              @param fit_method: the fit type to pass to CalculateTransmission ('Logarithmic' or 'Linear')or 'Off'
              @param override: if set to False this call won't override the settings set by a previous call (default True)
              @param selector: define if the given settings is valid for SAMPLE, CAN or BOTH transmissions.
          """
          FITMETHOD = 'fit_method'
          LAMBDAMIN = 'lambda_min'
          LAMBDAMAX = 'lambda_max'
          ORDER = 'order'
          # processing the selector input
          select = selector.lower()
          if select not in ['both', 'can', 'sample']:
              _issueWarning('Invalid selector option (' + selector + '). Fit to transmission skipped')
              return
          select += "::"
  
          if not override and select + FITMETHOD in self.fit_settings and self.fit_settings[select + FITMETHOD]:
              # it was already configured and this request does not want to override
              return
  
          if not fit_method:
              # there is not point calling fit_method without fit_method argument
              return
  
          fit_method = fit_method.upper()
          if 'POLYNOMIAL' in fit_method:
              order_str = fit_method[10:]
              fit_method = 'POLYNOMIAL'
              self.fit_settings[select + ORDER] = int(order_str)
          if fit_method not in list(self.TRANS_FIT_OPTIONS.keys()):
              _issueWarning(
                  'ISISReductionStep.Transmission: Invalid fit mode passed to TransFit, using default method (%s)' % self.DEFAULT_FIT)
              fit_method = self.DEFAULT_FIT
  
          # get variables for this selector
          sel_settings = dict()
          for prop in self.fit_props:
              sel_settings[prop] = self.fit_settings[select + prop] if select + prop in self.fit_settings else \
                  self.fit_settings['both::' + prop]
  
          # copy fit_method
          sel_settings[FITMETHOD] = fit_method
  
          if min_:
              sel_settings[LAMBDAMIN] = float(min_) if fit_method not in ['OFF', 'CLEAR'] else None
          if max_:
              sel_settings[LAMBDAMAX] = float(max_) if fit_method not in ['OFF', 'CLEAR'] else None
  
          # apply the properties to self.fit_settings
          for prop in self.fit_props:
              self.fit_settings[select + prop] = sel_settings[prop]
  
          # When both is given, it is necessary to clean the specific settings for the individual selectors
          if select == 'both::':
              for selector_ in ['sample::', 'can::']:
                  for prop_ in self.fit_props:
                      prop_name = selector_ + prop_
                      if prop_name in self.fit_settings:
                          del self.fit_settings[prop_name]
function_tokens: def set_trans_fit ( self , fit_method , min_ = None , max_ = None , override = True , selector = 'both' ) : FITMETHOD = 'fit_method' LAMBDAMIN = 'lambda_min' LAMBDAMAX = 'lambda_max' ORDER = 'order' # processing the selector input select = selector . lower ( ) if select not in [ 'both' , 'can' , 'sample' ] : _issueWarning ( 'Invalid selector option (' + selector + '). Fit to transmission skipped' ) return select += "::" if not override and select + FITMETHOD in self . fit_settings and self . fit_settings [ select + FITMETHOD ] : # it was already configured and this request does not want to override return if not fit_method : # there is not point calling fit_method without fit_method argument return fit_method = fit_method . upper ( ) if 'POLYNOMIAL' in fit_method : order_str = fit_method [ 10 : ] fit_method = 'POLYNOMIAL' self . fit_settings [ select + ORDER ] = int ( order_str ) if fit_method not in list ( self . TRANS_FIT_OPTIONS . keys ( ) ) : _issueWarning ( 'ISISReductionStep.Transmission: Invalid fit mode passed to TransFit, using default method (%s)' % self . DEFAULT_FIT ) fit_method = self . DEFAULT_FIT # get variables for this selector sel_settings = dict ( ) for prop in self . fit_props : sel_settings [ prop ] = self . fit_settings [ select + prop ] if select + prop in self . fit_settings else self . fit_settings [ 'both::' + prop ] # copy fit_method sel_settings [ FITMETHOD ] = fit_method if min_ : sel_settings [ LAMBDAMIN ] = float ( min_ ) if fit_method not in [ 'OFF' , 'CLEAR' ] else None if max_ : sel_settings [ LAMBDAMAX ] = float ( max_ ) if fit_method not in [ 'OFF' , 'CLEAR' ] else None # apply the properties to self.fit_settings for prop in self . fit_props : self . fit_settings [ select + prop ] = sel_settings [ prop ] # When both is given, it is necessary to clean the specific settings for the individual selectors if select == 'both::' : for selector_ in [ 'sample::' , 'can::' ] : for prop_ in self . fit_props : prop_name = selector_ + prop_ if prop_name in self . fit_settings : del self . fit_settings [ prop_name ]