當前位置: 首頁>>代碼示例>>Python>>正文


Python Flags.get_lattice方法代碼示例

本文整理匯總了Python中xia2.Handlers.Flags.Flags.get_lattice方法的典型用法代碼示例。如果您正苦於以下問題:Python Flags.get_lattice方法的具體用法?Python Flags.get_lattice怎麽用?Python Flags.get_lattice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在xia2.Handlers.Flags.Flags的用法示例。


在下文中一共展示了Flags.get_lattice方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setup_from_xinfo_file

# 需要導入模塊: from xia2.Handlers.Flags import Flags [as 別名]
# 或者: from xia2.Handlers.Flags.Flags import get_lattice [as 別名]
  def setup_from_xinfo_file(self, xinfo_file):
    '''Set up this object & all subobjects based on the .xinfo
    file contents.'''

    settings = PhilIndex.params.xia2.settings

    sweep_ids = [sweep.id for sweep in settings.sweep]
    sweep_ranges = [sweep.range for sweep in settings.sweep]

    if len(sweep_ids) == 0:
      sweep_ids = None
      sweep_ranges = None

    xinfo = XInfo(xinfo_file, sweep_ids=sweep_ids, sweep_ranges=sweep_ranges)

    self._name = xinfo.get_project()
    crystals = xinfo.get_crystals()

    for crystal in crystals.keys():
      xc = XCrystal(crystal, self)
      if crystals[crystal].has_key('sequence'):
        xc.set_aa_sequence(crystals[crystal]['sequence'])
      if crystals[crystal].has_key('ha_info'):
        if crystals[crystal]['ha_info'] != { }:
          xc.set_ha_info(crystals[crystal]['ha_info'])

      if crystals[crystal].has_key('scaled_merged_reflection_file'):
        xc.set_scaled_merged_reflections(
          crystals[crystal]['scaled_merged_reflections'])

      if crystals[crystal].has_key('reference_reflection_file'):
        xc.set_reference_reflection_file(
          crystals[crystal]['reference_reflection_file'])
      if crystals[crystal].has_key('freer_file'):
        xc.set_freer_file(crystals[crystal]['freer_file'])

      # user assigned spacegroup
      if crystals[crystal].has_key('user_spacegroup'):
        xc.set_user_spacegroup(crystals[crystal]['user_spacegroup'])
      elif settings.space_group is not None:
        # XXX do we ever actually get here?
        xc.set_user_spacegroup(settings.space_group.type().lookup_symbol())

      # add a default sample if none present in xinfo file
      if len(crystals[crystal]['samples']) == 0:
        crystals[crystal]['samples']['X1'] = {}

      for sample in crystals[crystal]['samples'].keys():
        sample_info = crystals[crystal]['samples'][sample]

        xsample = XSample(sample, xc)
        xc.add_sample(xsample)

      for wavelength in crystals[crystal]['wavelengths'].keys():
        # FIXME 29/NOV/06 in here need to be able to cope with
        # no wavelength information - this should default to the
        # information in the image header (John Cowan pointed
        # out that this was untidy - requiring that it agrees
        # with the value in the header makes this almost
        # useless.)

        wave_info = crystals[crystal]['wavelengths'][wavelength]

        if not wave_info.has_key('wavelength'):
          Debug.write(
            'No wavelength value given for wavelength %s' % wavelength)
        else:
          Debug.write(
            'Overriding value for wavelength %s to %8.6f' % \
              (wavelength, float(wave_info['wavelength'])))

        # handle case where user writes f" in place of f''

        if wave_info.has_key('f"') and not \
              wave_info.has_key('f\'\''):
          wave_info['f\'\''] = wave_info['f"']

        xw = XWavelength(wavelength, xc,
                         wavelength = wave_info.get('wavelength', 0.0),
                         f_pr = wave_info.get('f\'', 0.0),
                         f_prpr = wave_info.get('f\'\'', 0.0),
                         dmin = wave_info.get('dmin', 0.0),
                         dmax = wave_info.get('dmax', 0.0))

        # in here I also need to look and see if we have
        # been given any scaled reflection files...

        # check to see if we have a user supplied lattice...
        if crystals[crystal].has_key('user_spacegroup'):
          lattice = Syminfo.get_lattice(
            crystals[crystal]['user_spacegroup'])
        elif settings.space_group is not None:
          # XXX do we ever actually get here?
          lattice = Syminfo.get_lattice(
            settings.space_group.type().lookup_symbol())
        elif Flags.get_lattice():
          lattice = Flags.get_lattice()
        else:
          lattice = None

#.........這裏部分代碼省略.........
開發者ID:hainm,項目名稱:xia2,代碼行數:103,代碼來源:XProject.py


注:本文中的xia2.Handlers.Flags.Flags.get_lattice方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。