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


Python Flags.get_ice方法代碼示例

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


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

示例1: _get_integrater

# 需要導入模塊: from xia2.Handlers.Flags import Flags [as 別名]
# 或者: from xia2.Handlers.Flags.Flags import get_ice [as 別名]
  def _get_integrater(self):
    '''Get my integrater, and if it is not set, create one.'''

    if self._integrater == None:

      # set the working directory for this, based on the hierarchy
      # defined herein...

      # that would be CRYSTAL_ID/WAVELENGTH/SWEEP/index &c.

      if not self.get_wavelength():
        wavelength_id = "default"
        crystal_id = "default"
        project_id = "default"

      else:
        wavelength_id = self.get_wavelength().get_name()
        crystal_id = self.get_wavelength().get_crystal().get_name()
        project_id = self.get_wavelength().get_crystal().get_project().get_name()

      working_directory = Environment.generate_directory(
        [crystal_id, wavelength_id, self.get_name(), 'integrate'])

      json_file = os.path.join(working_directory, 'xia2.json')
      if (Flags.get_serialize_state() and
          os.path.isdir(working_directory) and
          os.path.isfile(json_file)):
        self._integrater = IntegraterFactory.IntegraterForXSweep(
          self, json_file=json_file)

      else:
        self._integrater = IntegraterFactory.IntegraterForXSweep(self)

        # configure the integrater with the indexer - unless
        # we don't want to...

        self._integrater.set_integrater_refiner(self._get_refiner())

        Debug.write('Integrater / refiner / indexer for sweep %s: %s/%s/%s' % \
                    (self._name, self._integrater.__class__.__name__,
                     self._get_refiner().__class__.__name__,
                     self._get_indexer().__class__.__name__))

        # or if we have been told this on the command-line -
        # N.B. should really add a mechanism to specify the ice
        # rings we want removing, #1317.

        if Flags.get_ice():
          self._integrater.set_integrater_ice(Flags.get_ice())

        # or if we were told about ice or specific excluded resolution
        # ranges via the xinfo file
        if self._ice:
          self._integrater.set_integrater_ice(self._ice)

        if len(self._excluded_regions) > 0:
          self._integrater.set_integrater_excluded_regions(
              self._excluded_regions)

        self._integrater.set_integrater_project_info(
          project_id, crystal_id, wavelength_id)

        self._integrater.set_integrater_sweep_name(self._name)

        # copy across anomalous flags in case it's useful - #871

        self._integrater.set_integrater_anomalous(
            self.get_wavelength().get_crystal().get_anomalous())

        # see if we have any useful detector parameters to pass on

        if self.get_gain():
          self._integrater.set_gain(self.get_gain())

        if self.get_polarization():
          self._integrater.set_polarization(self.get_polarization())

        # look to see if there are any global integration parameters
        # we can set...

        if global_integration_parameters.get_parameters(crystal_id):
          Debug.write('Using integration parameters for crystal %s' \
                      % crystal_id)
          self._integrater.set_integrater_parameters(
              global_integration_parameters.get_parameters(crystal_id))

        # frames to process...

        if self._frames_to_process:
          frames = self._frames_to_process
          self._integrater.set_integrater_wedge(frames[0],
                                                frames[1])
          self._integrater.set_frame_wedge(frames[0],
                                           frames[1])
          self._integrater.set_integrater_epoch(
            self.get_epoch(self._frames_to_process[0]))

        self._integrater.set_working_directory(working_directory)

    return self._integrater
開發者ID:hainm,項目名稱:xia2,代碼行數:102,代碼來源:XSweep.py


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