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


Python Flags.get_xparallel方法代碼示例

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


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

示例1: run

# 需要導入模塊: from xia2.Handlers.Flags import Flags [as 別名]
# 或者: from xia2.Handlers.Flags.Flags import get_xparallel [as 別名]
    def run(self):
      '''Run integrate.'''

      #image_header = self.get_header()

      ## crank through the header dictionary and replace incorrect
      ## information with updated values through the indexer
      ## interface if available...

      ## need to add distance, wavelength - that should be enough...

      #if self.get_distance():
        #image_header['distance'] = self.get_distance()

      #if self.get_wavelength():
        #image_header['wavelength'] = self.get_wavelength()

      #if self.get_two_theta():
        #image_header['two_theta'] = self.get_two_theta()

      header = imageset_to_xds(self.get_imageset())

      xds_inp = open(os.path.join(self.get_working_directory(),
                                  'XDS.INP'), 'w')

      # what are we doing?
      xds_inp.write('JOB=INTEGRATE\n')
      xds_inp.write('MAXIMUM_NUMBER_OF_PROCESSORS=%d\n' % \
                    self._parallel)

      from xia2.Handlers.Phil import PhilIndex
      xds_params = PhilIndex.params.xds
      if xds_params.profile_grid_size:
        ab, c = xds_params.profile_grid_size
        assert(ab > 0 and ab < 22 and (ab % 2) == 1)
        assert(c > 0 and c < 22 and (c % 2) == 1)
        xds_inp.write(
            'NUMBER_OF_PROFILE_GRID_POINTS_ALONG_ALPHA/BETA= %d\n' % ab)
        xds_inp.write(
            'NUMBER_OF_PROFILE_GRID_POINTS_ALONG_GAMMA= %d\n' % c)

      if Flags.get_xparallel() > 1:
        xds_inp.write('MAXIMUM_NUMBER_OF_JOBS=%d\n' % \
                      Flags.get_xparallel())

      elif Flags.get_xparallel() == -1:
        chunk_width = 30.0
        phi_width = self.get_phi_width()
        nchunks = int(
            (self._data_range[1] - self._data_range[0] + 1) * \
            phi_width / chunk_width)

        Debug.write('Xparallel: -1 using %d chunks' % nchunks)

        xds_inp.write('MAXIMUM_NUMBER_OF_JOBS=%d\n' % nchunks)

      profile_fitting = PhilIndex.params.xds.integrate.profile_fitting
      if not profile_fitting:
        xds_inp.write('PROFILE_FITTING=FALSE\n')

      # write out lots of output
      xds_inp.write('TEST=2\n')

      if self._params.delphi:
        xds_inp.write('DELPHI=%.1f\n' % self._params.delphi)
      elif Flags.get_small_molecule():
        xds_inp.write('DELPHI=%.1f\n' % \
                      xds_params.delphi_small)
      else:
        xds_inp.write('DELPHI=%.1f\n' % \
                      xds_params.delphi)

      if self._refined_xparm:
        xds_inp.write('REFINE(INTEGRATE)=%s\n' %
                      ' '.join(self._params.refine_final))
      else:
        xds_inp.write('REFINE(INTEGRATE)=%s\n' %
                      ' '.join(self._params.refine))

      if self._params.fix_scale:
        if _running_xds_version() >= 20130330:
          xds_inp.write('DATA_RANGE_FIXED_SCALE_FACTOR= %d %d 1\n' %
                        self._data_range)
        else:
          xds_inp.write('FIXED_SCALE_FACTOR=TRUE\n')

      # check for updated input parameters or ones from phil

      if self._updates.has_key('BEAM_DIVERGENCE') and \
             self._updates.has_key('BEAM_DIVERGENCE_E.S.D.'):
        xds_inp.write(
            'BEAM_DIVERGENCE=%f BEAM_DIVERGENCE_E.S.D.=%f\n' % \
            (self._updates['BEAM_DIVERGENCE'],
             self._updates['BEAM_DIVERGENCE_E.S.D.']))
      elif self._params.beam_divergence and self._params.beam_divergence_esd:
        xds_inp.write(
            'BEAM_DIVERGENCE=%f BEAM_DIVERGENCE_E.S.D.=%f\n' % \
            (self._params.beam_divergence,
             self._params.beam_divergence_esd))

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


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