Beispiel #1
0
    def init(self):
        """
        Descript. :
        """
        AbstractDetector.init(self)

        # self.distance = 500
        self._temperature = 25
        self._humidity = 60
        self.actual_frame_rate = 50
        self._roi_modes_list = ("0", "C2", "C16")
        self._roi_mode = 0
        self._exposure_time_limits = [0.04, 60000]
        self.status = "ready"
        self.pv_status = epics.PV(self.getProperty("channel_status"))
        self.threshold = -1  # Starts with invalid value. To be set.
        self.wavelength = -1
        self.det_distance = -1
        self.beam_x = -1
        self.beam_y = -1
        self.default_beam_x = float(self.getProperty("default_beam_x"))
        self.default_beam_y = float(self.getProperty("default_beam_y"))

        self._distance_motor_hwobj = self.getObjectByRole("detector_distance")
        self.threshold = self.get_threshold_energy()
Beispiel #2
0
    def init(self):
        """
        Descript. :
        """
        AbstractDetector.init(self)

        self._temperature = 25
        self._humidity = 60
        self._actual_frame_rate = 50
        self._roi_modes_list = ("0", "C2", "C16")
        self._roi_mode = 0
        self._exposure_time_limits = [0.04, 60000]
        self.update_state(self.STATES.READY)
Beispiel #3
0
    def init(self):
        """
        Descript. :
        """
        AbstractDetector.init(self)

        # self.distance = 500
        self._temperature = 25
        self._humidity = 60
        self.actual_frame_rate = 50
        self._roi_modes_list = ("0", "C2", "C16")
        self._roi_mode = 0
        self._exposure_time_limits = [0.04, 60000]
        self.status = "ready"

        self._distance_motor_hwobj = self.getObjectByRole("detector_distance")
Beispiel #4
0
    def init(self):
        AbstractDetector.init(self)

        self.header = dict()

        lima_device = self.getProperty("lima_device")
        eiger_device = self.getProperty("eiger_device")

        for channel_name in (
                "acq_status",
                "acq_trigger_mode",
                "saving_mode",
                "acq_nb_frames",
                "acq_expo_time",
                "saving_directory",
                "saving_prefix",
                "saving_suffix",
                "saving_next_number",
                "saving_index_format",
                "saving_format",
                "saving_overwrite_policy",
                "last_image_saved",
                "saving_frame_per_file",
                "saving_managed_mode",
        ):
            self.add_channel(
                {
                    "type": "tango",
                    "name": channel_name,
                    "tangoname": lima_device
                },
                channel_name,
            )

        for channel_name in ("photon_energy", ):
            self.add_channel(
                {
                    "type": "tango",
                    "name": channel_name,
                    "tangoname": eiger_device
                },
                channel_name,
            )

        self.add_command(
            {
                "type": "tango",
                "name": "prepare_acq",
                "tangoname": lima_device
            },
            "prepareAcq",
        )
        self.add_command(
            {
                "type": "tango",
                "name": "start_acq",
                "tangoname": lima_device
            }, "startAcq")
        self.add_command(
            {
                "type": "tango",
                "name": "stop_acq",
                "tangoname": lima_device
            }, "stopAcq")
        self.add_command(
            {
                "type": "tango",
                "name": "reset",
                "tangoname": lima_device
            }, "reset")
        self.add_channel(
            {
                "type": "tango",
                "name": "set_image_header",
                "tangoname": lima_device
            },
            "saving_common_header",
        )

        self.get_command_object("prepare_acq").init_device()
        self.get_command_object("prepare_acq").device.set_timeout_millis(
            5 * 60 * 1000)
        self.get_channel_object("photon_energy").init_device()
    def init(self):
        AbstractDetector.init(self)

        lima_device = self.getProperty("lima_device")
        pilatus_device = self.getProperty("pilatus_device")

        if None in (lima_device, pilatus_device):
            return

        try:
            for channel_name in (
                "acq_status",
                "acq_trigger_mode",
                "saving_mode",
                "acq_nb_frames",
                "acq_expo_time",
                "saving_directory",
                "saving_prefix",
                "saving_suffix",
                "saving_next_number",
                "saving_index_format",
                "saving_format",
                "saving_overwrite_policy",
                "saving_header_delimiter",
                "last_image_saved",
                "image_roi",
            ):
                self.add_channel(
                    {"type": "tango", "name": channel_name, "tangoname": lima_device},
                    channel_name,
                )

            for channel_name in ("fill_mode", "threshold"):
                self.add_channel(
                    {
                        "type": "tango",
                        "name": channel_name,
                        "tangoname": pilatus_device,
                    },
                    channel_name,
                )

            pilatus_tg_device = DeviceProxy(pilatus_device)

            if hasattr(pilatus_tg_device, "working_energy"):
                self.add_channel(
                    {
                        "type": "tango",
                        "name": "energy_threshold",
                        "tangoname": pilatus_device,
                    },
                    "working_energy",
                )
            else:
                self.add_channel(
                    {
                        "type": "tango",
                        "name": "energy_threshold",
                        "tangoname": pilatus_device,
                    },
                    "energy_threshold",
                )

            self.add_command(
                {"type": "tango", "name": "prepare_acq", "tangoname": lima_device},
                "prepareAcq",
            )
            self.add_command(
                {"type": "tango", "name": "start_acq", "tangoname": lima_device},
                "startAcq",
            )
            self.add_command(
                {"type": "tango", "name": "stop_acq", "tangoname": lima_device},
                "stopAcq",
            )
            self.add_command(
                {"type": "tango", "name": "reset", "tangoname": lima_device}, "reset"
            )
            self.add_command(
                {"type": "tango", "name": "set_image_header", "tangoname": lima_device},
                "SetImageHeader",
            )

            self.get_channel_object("image_roi").connectSignal(
                "update", self.roi_mode_changed
            )

        except ConnectionError:
            logging.getLogger("HWR").error(
                "Could not connect to detector %s" % lima_device
            )