def understand(image_file):
    '''Check to see if this looks like a ALS 4.2.2 NOIR SMV format image,
    i.e. we can make sense of it. Essentially that will be if it contains
    all of the keys we are looking for.'''

    size, header = FormatSMVRigaku.get_smv_header(image_file)

    wanted_header_items = [
        'DETECTOR_NUMBER', 'DETECTOR_NAMES',
        'CRYSTAL_GONIO_NUM_VALUES', 'CRYSTAL_GONIO_NAMES',
        'CRYSTAL_GONIO_UNITS', 'CRYSTAL_GONIO_VALUES',
        'NOIR1_CREATED',
        'ROTATION', 'ROTATION_AXIS_NAME', 'ROTATION_VECTOR',
        'SOURCE_VECTORS', 'SOURCE_WAVELENGTH',
        'SOURCE_POLARZ', 'DIM', 'SIZE1', 'SIZE2',
        ]

    for header_item in wanted_header_items:
      if not header_item in header:
        return False

    detector_prefix = header['DETECTOR_NAMES'].split()[0].strip()

    more_wanted_header_items = [
        'DETECTOR_DIMENSIONS', 'DETECTOR_SIZE', 'DETECTOR_VECTORS',
        'GONIO_NAMES', 'GONIO_UNITS', 'GONIO_VALUES', 'GONIO_VECTORS',
        'SPATIAL_BEAM_POSITION'
        ]

    for header_item in more_wanted_header_items:
      if not '%s%s' % (detector_prefix, header_item) in header:
        return False

    return True
    def understand(image_file):
        """Check to see if this looks like a Rigaku A200 SMV format image,
        i.e. we can make sense of it. Essentially that will be if it contains
        all of the keys we are looking for."""

        size, header = FormatSMVRigaku.get_smv_header(image_file)

        wanted_header_items = [
            "DETECTOR_NUMBER",
            "DETECTOR_NAMES",
            "CRYSTAL_GONIO_NUM_VALUES",
            "CRYSTAL_GONIO_NAMES",
            "CRYSTAL_GONIO_UNITS",
            "CRYSTAL_GONIO_VALUES",
            "ROTATION",
            "ROTATION_AXIS_NAME",
            "ROTATION_VECTOR",
            "SOURCE_VECTORS",
            "SOURCE_WAVELENGTH",
            "SOURCE_POLARZ",
            "DIM",
            "SIZE1",
            "SIZE2",
        ]

        if any(item not in header for item in wanted_header_items):
            return False

        detector_prefix = header["DETECTOR_NAMES"].split()[0].strip()

        more_wanted_header_items = [
            "DETECTOR_DIMENSIONS",
            "DETECTOR_SIZE",
            "DETECTOR_VECTORS",
            "GONIO_NAMES",
            "GONIO_UNITS",
            "GONIO_VALUES",
            "GONIO_VECTORS",
            "SPATIAL_BEAM_POSITION",
            "SPATIAL_DISTORTION_VECTORS",
        ]

        if any(
            "%s%s" % (detector_prefix, item) not in header
            for item in more_wanted_header_items
        ):
            return False

        descriptive_items = ["DETECTOR_IDENTIFICATION", "DETECTOR_DESCRIPTION"]

        for header_item in descriptive_items:
            test = "%s%s" % (detector_prefix, header_item)
            if test in header and (
                "raxis" in header[test].lower() or "a200" in header[test].lower()
            ):
                return True

        return False
示例#3
0
    def understand(image_file):
        '''Check to see if this looks like a Rigaku Saturn SMV format image,
    i.e. we can make sense of it. Essentially that will be if it contains
    all of the keys we are looking for.'''

        size, header = FormatSMVRigaku.get_smv_header(image_file)

        if 'DTREK_DATE_TIME' in header:
            return False

        wanted_header_items = [
            'DETECTOR_NUMBER',
            'DETECTOR_NAMES',
            'CRYSTAL_GONIO_NUM_VALUES',
            'CRYSTAL_GONIO_NAMES',
            'CRYSTAL_GONIO_UNITS',
            'CRYSTAL_GONIO_VALUES',
            'ROTATION',
            'ROTATION_AXIS_NAME',
            'ROTATION_VECTOR',
            'SOURCE_VECTORS',
            'SOURCE_WAVELENGTH',
            'SOURCE_POLARZ',
            'DIM',
            'SIZE1',
            'SIZE2',
        ]

        for header_item in wanted_header_items:
            if not header_item in header:
                return False

        detector_prefix = header['DETECTOR_NAMES'].split()[0].strip()

        more_wanted_header_items = [
            'DETECTOR_DIMENSIONS', 'DETECTOR_SIZE', 'DETECTOR_VECTORS',
            'GONIO_NAMES', 'GONIO_UNITS', 'GONIO_VALUES', 'GONIO_VECTORS',
            'SPATIAL_BEAM_POSITION'
        ]

        for header_item in more_wanted_header_items:
            if not '%s%s' % (detector_prefix, header_item) in header:
                return False

        descriptive_items = ['DETECTOR_IDENTIFICATION', 'DETECTOR_DESCRIPTION']

        for header_item in descriptive_items:
            test = '%s%s' % (detector_prefix, header_item)
            if test in header and 'saturn' in header[test].lower():
                return True

        return False
示例#4
0
    def understand(image_file):
        '''Check to see if this looks like a Rigaku d*TREK SMVRigaku format image,
    i.e. we can make sense of it. Essentially that will be if it contains
    all of the keys we are looking for.'''

        size, header = FormatSMVRigaku.get_smv_header(image_file)

        if not 'DETECTOR_TYPE' in header:
            return False

        if header['DETECTOR_TYPE'] != 'Pilatus 300K':
            return False

        return True
示例#5
0
    def understand(image_file):
        """Check to see if this looks like a Rigaku d*TREK SMVRigaku format image,
        i.e. we can make sense of it. Essentially that will be if it contains
        all of the keys we are looking for."""

        size, header = FormatSMVRigaku.get_smv_header(image_file)

        if "DETECTOR_TYPE" not in header:
            return False

        if header["DETECTOR_TYPE"] not in ["Pilatus 200K", "Pilatus 300K"]:
            return False

        return True
  def understand(image_file):
    '''Check to see if this looks like a Rigaku d*TREK SMVRigaku format image,
    i.e. we can make sense of it. Essentially that will be if it contains
    all of the keys we are looking for.'''

    size, header = FormatSMVRigaku.get_smv_header(image_file)

    if not 'DETECTOR_TYPE' in header:
      return False

    if header['DETECTOR_TYPE'] != 'Pilatus 300K':
      return False

    return True
示例#7
0
    def understand(image_file):
        """Check to see if this looks like a ALS 4.2.2 NOIR SMV format image,
        i.e. we can make sense of it. Essentially that will be if it contains
        all of the keys we are looking for."""

        size, header = FormatSMVRigaku.get_smv_header(image_file)

        wanted_header_items = [
            "DETECTOR_NUMBER",
            "DETECTOR_NAMES",
            "CRYSTAL_GONIO_NUM_VALUES",
            "CRYSTAL_GONIO_NAMES",
            "CRYSTAL_GONIO_UNITS",
            "CRYSTAL_GONIO_VALUES",
            "NOIR1_CREATED",
            "ROTATION",
            "ROTATION_AXIS_NAME",
            "ROTATION_VECTOR",
            "SOURCE_VECTORS",
            "SOURCE_WAVELENGTH",
            "SOURCE_POLARZ",
            "DIM",
            "SIZE1",
            "SIZE2",
        ]

        for header_item in wanted_header_items:
            if not header_item in header:
                return False

        detector_prefix = header["DETECTOR_NAMES"].split()[0].strip()

        more_wanted_header_items = [
            "DETECTOR_DIMENSIONS",
            "DETECTOR_SIZE",
            "DETECTOR_VECTORS",
            "GONIO_NAMES",
            "GONIO_UNITS",
            "GONIO_VALUES",
            "GONIO_VECTORS",
            "SPATIAL_BEAM_POSITION",
        ]

        for header_item in more_wanted_header_items:
            if not "%s%s" % (detector_prefix, header_item) in header:
                return False

        return True
  def understand(image_file):
    '''Check to see if this looks like a Rigaku d*TREK SMVRigaku format image,
    i.e. we can make sense of it. Essentially that will be if it contains
    all of the keys we are looking for.'''

    size, header = FormatSMVRigaku.get_smv_header(image_file)

    if not 'DETECTOR_NAMES' in header:
      return False

    name = header['DETECTOR_NAMES']

    if not '%sDETECTOR_DESCRIPTION' % name in header:
      return False

    return 'Eiger1M' in header['%sDETECTOR_DESCRIPTION' % name]
示例#9
0
    def understand(image_file):
        """Check to see if this looks like a Rigaku d*TREK SMVRigaku format image,
        i.e. we can make sense of it. Essentially that will be if it contains
        all of the keys we are looking for."""

        size, header = FormatSMVRigaku.get_smv_header(image_file)

        if "DETECTOR_NAMES" not in header:
            return False

        name = header["DETECTOR_NAMES"]

        if "%sDETECTOR_DESCRIPTION" % name not in header:
            return False

        return "Eiger" in header["%sDETECTOR_DESCRIPTION" % name]
  def understand(image_file):
    '''Check to see if this looks like a Rigaku d*TREK SMVRigaku format image,
    i.e. we can make sense of it. Essentially that will be if it contains
    all of the keys we are looking for.'''

    size, header = FormatSMVRigaku.get_smv_header(image_file)

    if not 'DETECTOR_NAMES' in header:
      return False

    name = header['DETECTOR_NAMES']

    if not '%sDETECTOR_DESCRIPTION' % name in header:
      return False

    return 'Eiger1M' in header['%sDETECTOR_DESCRIPTION' % name]
  def understand(image_file):
    '''Check to see if this looks like a Rigaku Saturn SMV format image,
    i.e. we can make sense of it. Essentially that will be if it contains
    all of the keys we are looking for.'''

    size, header = FormatSMVRigaku.get_smv_header(image_file)

    if 'DTREK_DATE_TIME' in header:
      return False

    wanted_header_items = [
        'DETECTOR_NUMBER', 'DETECTOR_NAMES',
        'CRYSTAL_GONIO_NUM_VALUES', 'CRYSTAL_GONIO_NAMES',
        'CRYSTAL_GONIO_UNITS', 'CRYSTAL_GONIO_VALUES',
        'ROTATION', 'ROTATION_AXIS_NAME', 'ROTATION_VECTOR',
        'SOURCE_VECTORS', 'SOURCE_WAVELENGTH',
        'SOURCE_POLARZ', 'DIM', 'SIZE1', 'SIZE2',
        ]

    for header_item in wanted_header_items:
      if not header_item in header:
        return False

    detector_prefix = header['DETECTOR_NAMES'].split()[0].strip()

    more_wanted_header_items = [
        'DETECTOR_DIMENSIONS', 'DETECTOR_SIZE', 'DETECTOR_VECTORS',
        'GONIO_NAMES', 'GONIO_UNITS', 'GONIO_VALUES', 'GONIO_VECTORS',
        'SPATIAL_BEAM_POSITION'
        ]

    for header_item in more_wanted_header_items:
      if not '%s%s' % (detector_prefix, header_item) in header:
        return False

    descriptive_items = [
        'DETECTOR_IDENTIFICATION', 'DETECTOR_DESCRIPTION'
    ]

    for header_item in descriptive_items:
      test = '%s%s' % (detector_prefix, header_item)
      if test in header and 'saturn' in header[test].lower():
        return True

    return False
示例#12
0
    def understand(image_file):
        '''Check to see if this looks like a ALS 4.2.2 NOIR SMV format image,
    i.e. we can make sense of it. Essentially that will be if it contains
    all of the keys we are looking for.'''

        size, header = FormatSMVRigaku.get_smv_header(image_file)

        wanted_header_items = [
            'DETECTOR_NUMBER',
            'DETECTOR_NAMES',
            'CRYSTAL_GONIO_NUM_VALUES',
            'CRYSTAL_GONIO_NAMES',
            'CRYSTAL_GONIO_UNITS',
            'CRYSTAL_GONIO_VALUES',
            'NOIR1_CREATED',
            'ROTATION',
            'ROTATION_AXIS_NAME',
            'ROTATION_VECTOR',
            'SOURCE_VECTORS',
            'SOURCE_WAVELENGTH',
            'SOURCE_POLARZ',
            'DIM',
            'SIZE1',
            'SIZE2',
        ]

        for header_item in wanted_header_items:
            if not header_item in header:
                return False

        detector_prefix = header['DETECTOR_NAMES'].split()[0].strip()

        more_wanted_header_items = [
            'DETECTOR_DIMENSIONS', 'DETECTOR_SIZE', 'DETECTOR_VECTORS',
            'GONIO_NAMES', 'GONIO_UNITS', 'GONIO_VALUES', 'GONIO_VECTORS',
            'SPATIAL_BEAM_POSITION'
        ]

        for header_item in more_wanted_header_items:
            if not '%s%s' % (detector_prefix, header_item) in header:
                return False

        return True