示例#1
0
    def start_helper(self, version_token):

        is_file = isinstance(self._image_file,
                             six.string_types) and os.path.isfile(
                                 self._image_file)

        if is_file:
            file_name = self._image_file
        else:
            file_name = "inmem"

        args = [
            file_name,
            version_token,
            "viewer.powder_arcs.show=False",
            "viewer.powder_arcs.code=3n9c",
        ]

        params = cxi_phil.cxi_versioned_extract(args)
        horizons_phil = params.persist.commands

        if is_file:
            image = NpyImage(file_name)
        else:
            print(
                "This is not a file; assume the data are in the defined dictionary format"
            )
            image = NpyImage(file_name, source_data=self._image_file)
        image.readHeader(horizons_phil)
        image.translate_tiles(horizons_phil)
        # necessary to keep the phil parameters for subsequent calls to get_tile_manager()
        image.horizons_phil_cache = copy.deepcopy(horizons_phil)
        self.detectorbase = image
示例#2
0
    def start_helper(self, version_token):

        from spotfinder.applications.xfel import cxi_phil
        from iotbx.detectors.npy import NpyImage
        import os, copy

        is_file = isinstance(self._image_file, basestring) and os.path.isfile(
            self._image_file)

        if is_file:
            file_name = self._image_file
        else:
            file_name = "inmem"

        args = [
            file_name,
            version_token,
            "viewer.powder_arcs.show=False",
            "viewer.powder_arcs.code=3n9c",
        ]

        params = cxi_phil.cxi_versioned_extract(args)
        horizons_phil = params.persist.commands

        if is_file:
            I = NpyImage(file_name)
        else:
            print "This is not a file; assume the data are in the defined dictionary format"
            I = NpyImage(file_name, source_data=self._image_file)
        I.readHeader(horizons_phil)
        I.translate_tiles(horizons_phil)
        # necessary to keep the phil parameters for subsequent calls to get_tile_manager()
        I.horizons_phil_cache = copy.deepcopy(horizons_phil)
        self.detectorbase = I