示例#1
0
文件: XDSScalerA.py 项目: hainm/xia2
  def __init__(self):
    super(XDSScalerA, self).__init__()

    self._sweep_information = { }

    self._reference = None

    # spacegroup and unit cell information - these will be
    # derived from an average of all of the sweeps which are
    # passed in

    self._xds_spacegroup = None
    self._factory = CCP4Factory()

    self._chef_analysis_groups = { }
    self._chef_analysis_times = { }
    self._chef_analysis_resolutions = { }

    self._user_resolution_limits = { }

    # scaling correction choices - may be set one on the command line...

    if Flags.get_scale_model():
      self._scalr_correct_absorption = Flags.get_scale_model_absorption()
      self._scalr_correct_modulation = Flags.get_scale_model_modulation()
      self._scalr_correct_decay = Flags.get_scale_model_decay()

      self._scalr_corrections = True

    else:

      self._scalr_correct_decay = True
      self._scalr_correct_modulation = True
      self._scalr_correct_absorption = True
      self._scalr_corrections = True

    return
示例#2
0
文件: CCP4ScalerA.py 项目: hainm/xia2
  def _determine_best_scale_model_8way(self):
    '''Determine the best set of corrections to apply to the data,
    testing all eight permutations.'''

    # if we have already defined the best scaling model just return

    if self._scalr_corrections:
      return

    # or see if we set one on the command line...

    if Flags.get_scale_model():
      self._scalr_correct_absorption = Flags.get_scale_model_absorption()
      self._scalr_correct_partiality = Flags.get_scale_model_partiality()
      self._scalr_correct_decay = Flags.get_scale_model_decay()

      self._scalr_corrections = True

      return

    Debug.write('Optimising scaling corrections...')

    rmerge_def = self._assess_scaling_model(
        tails = False, bfactor = False, secondary = False)

    results = { }

    consider = []

    log_results = []

    for partiality in True, False:
      for decay in True, False:
        for absorption in True, False:
          if partiality or decay or absorption:
            r = self._assess_scaling_model(
                tails = partiality, bfactor = decay,
                secondary = absorption)
          else:
            r = rmerge_def

          results[(partiality, decay, absorption)] = r

          log_results.append((partiality, decay, absorption, r))

          consider.append(
              (r, partiality, decay, absorption))


    Debug.write('. Tails Decay  Abs  R(%s)' % \
                Flags.get_rmerge_target())

    for result in log_results:
      Debug.write('. %5s %5s %5s %.3f' % result)

    consider.sort()
    rmerge, partiality, decay, absorption = consider[0]

    if absorption:
      Debug.write('Absorption correction: on')
    else:
      Debug.write('Absorption correction: off')

    if partiality:
      Debug.write('Partiality correction: on')
    else:
      Debug.write('Partiality correction: off')

    if decay:
      Debug.write('Decay correction: on')
    else:
      Debug.write('Decay correction: off')

    self._scalr_correct_absorption = absorption
    self._scalr_correct_partiality = partiality
    self._scalr_correct_decay = decay

    self._scalr_corrections = True

    return