def get_versions():
  from dials.util.version import dials_version
  from i19.util.version import i19_version
  import xia2.XIA2Version
  versions = {
    'xia2': xia2.XIA2Version.Version,
    'dials': dials_version(),
    'i19': i19_version(),
    'aimless': 'AIMLESS, CCP4' }
  with open(find_aimless_log(), 'r') as aimlesslog:
    pattern = re.compile(" +#+ *CCP4.*#+")
    for line in aimlesslog:
      if pattern.search(line):
        versions['aimless'] = re.sub('\s\s+', ', ', line.strip("\t\n #"))
        break
  return versions
Esempio n. 2
0
from __future__ import division

try:
  import i19.util.version as version
  print version.i19_version()
except ImportError:
  pass
Esempio n. 3
0
File: screen.py Progetto: xia2/i19
  def run(self, args):
    from dials.util.version import dials_version
    from i19.util.version import i19_version
    version_information = "%s using %s (%s)" % (i19_version(), dials_version(), time.strftime("%Y-%m-%d %H:%M:%S"))
    start = timeit.default_timer()

    if len(args) == 0:
      print help_message
      print version_information
      return

    # Configure the logging
    from dials.util import log
    log.config(1, info='i19.screen.log', debug='i19.screen.debug.log')

    info(version_information)
    debug('Run with %s' % str(args))

    # FIXME use proper optionparser here. This works for now
    nproc = None
    if len(args) >= 1 and args[0].startswith('nproc='):
      nproc = args[0][6:]
      args = args[1:]
    self._count_processors(nproc=nproc)
    debug('Using %s processors' % self.nproc)

    if len(args) == 1 and args[0].endswith('.json'):
      self.json_file = args[0]
    else:
      self._import(args)
      self.json_file = 'datablock.json'

    self._find_spots()
    if not self._index():
      info("\nRetrying for stronger spots only...")
      os.rename("strong.pickle", "all_spots.pickle")
      self._find_spots(['sigma_strong=15'])
      if not self._index():
        warn("Giving up.")
        info("""
Could not find an indexing solution. You may want to have a look
at the reciprocal space by running:

  dials.reciprocal_lattice_viewer datablock.json all_spots.pickle

or, to only include stronger spots:

  dials.reciprocal_lattice_viewer datablock.json strong.pickle
""")
        sys.exit(1)

    if not self._create_profile_model():
      info("\nRefining model to attempt to increase number of valid spots...")
      self._refine()
      if not self._create_profile_model():
        warn("Giving up.")
        info("""
The identified indexing solution may not be correct. You may want to have a look
at the reciprocal space by running:

  dials.reciprocal_lattice_viewer experiments.json indexed.pickle
""")
        sys.exit(1)
    self._report()
    self._predict()
    self._check_intensities()
    self._refine_bravais()

    i19screen_runtime = timeit.default_timer() - start
    debug("Finished at %s, total runtime: %.1f" % (time.strftime("%Y-%m-%d %H:%M:%S"), i19screen_runtime))
    info("i19.screen successfully completed (%.1f sec)" % i19screen_runtime)