当前位置: 首页>>代码示例>>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;未经允许,请勿转载。