Esempio n. 1
0
    def start_live(self,
                   exp_time=None,
                   buffer_frame_count=16,
                   stream_to_disk_path=None):
        """Calls the pvc.start_live function to setup a circular buffer acquisition.

        Parameter:
            exp_time (int): The exposure time (optional).
        Returns:
            None
        """
        self._set_dtype()

        if not isinstance(exp_time, int):
            exp_time = self.exp_time

        if isinstance(stream_to_disk_path, str):
            stream_to_disk_path_abs = os.path.abspath(stream_to_disk_path)
            directory, filename = os.path.split(stream_to_disk_path_abs)
            if os.path.exists(directory):
                try:
                    os.remove(filename)
                except OSError:
                    pass
            else:
                raise ValueError('Invalid directory for stream to disk: ' +
                                 directory)

        self.__acquisition_mode = 'Live'
        self.__exposure_bytes = pvc.start_live(self.__handle, self.__rois,
                                               exp_time, self.__mode,
                                               buffer_frame_count,
                                               stream_to_disk_path)
Esempio n. 2
0
    def start_live(self, exp_time=None):
        """Calls the pvc.start_live function to setup a circular buffer acquisition.

        Parameter:
            exp_time (int): The exposure time (optional).
        Returns:
            None
        """
        x_start, x_end, y_start, y_end = self.__roi

        if not isinstance(exp_time, int):
            exp_time = self.exp_time

        self.__exposure_bytes = pvc.start_live(self.__handle, x_start, x_end - 1,
                                               self.bin_x, y_start, y_end - 1,
                                               self.bin_x, exp_time, self.__mode)