コード例 #1
0
def spacegroup_number_operators(spacegroup):
    """From the spacegroup name (either the long or short version of the name)
    compute the number of symmetry operators. This will use the CCP4 symmetry
    library in "counting" mode."""

    if spacegroup.isdigit():
        spacegroup_number = int(spacegroup)
    else:
        # spacegroup was passed in as a name
        spacegroup_number = Syminfo.spacegroup_name_to_number(spacegroup.upper())

    return Syminfo.get_num_symops(spacegroup_number)
コード例 #2
0
ファイル: NMolLib.py プロジェクト: hainm/xia2
def spacegroup_number_operators(spacegroup):
  '''From the spacegroup name (either the long or short version of the name)
  compute the number of symmetry operators. This will use the CCP4 symmetry
  library in "counting" mode.'''

  # note slight (!) abuse of exception handling - however this works
  # well as a way of seeing if the input is something which can
  # be interpreted as a number

  try:
    spacegroup_number = int(spacegroup)
  except:
    # spacegroup was passed in as a name
    spacegroup_number = Syminfo.spacegroup_name_to_number(
        spacegroup.upper())

  return Syminfo.get_num_symops(spacegroup_number)
コード例 #3
0
def spacegroup_number_operators(spacegroup):
    '''From the spacegroup name (either the long or short version of the name)
  compute the number of symmetry operators. This will use the CCP4 symmetry
  library in "counting" mode.'''

    # note slight (!) abuse of exception handling - however this works
    # well as a way of seeing if the input is something which can
    # be interpreted as a number

    try:
        spacegroup_number = int(spacegroup)
    except:  # intentional
        # spacegroup was passed in as a name
        spacegroup_number = Syminfo.spacegroup_name_to_number(
            spacegroup.upper())

    return Syminfo.get_num_symops(spacegroup_number)