def __init__(self, dev_name, dev_class=None, cmd_list=None): TacoCcdAcq.__init__(self, dev_name, dev_class, cmd_list) res_pars = self.getResources(self.DefaultResources) espia_dev_nb = int(res_pars['espia_dev_nb']) self.m_acq = Frelon.FrelonAcq(espia_dev_nb) self.m_get_acq_frames = False
def __init__(self, **kws): self.__dict__.update(kws) self.acq = Frelon.FrelonAcq(self.espia_dev_nb) self.ct = self.acq.getGlobalControl() self.ct_acq = self.ct.acquisition() self.ct_saving = self.ct.saving() self.setupAcq() self.setupSaving()
def test_frelon_acc(enable_debug, espia_dev_nb, vert_bin, exp_time, acc_max_exp_time, nb_frames, acc_time_mode): if enable_debug: Core.DebParams.enableModuleFlags(Core.DebParams.AllFlags) Core.DebParams.enableTypeFlags(Core.DebParams.AllFlags) else: Core.DebParams.disableModuleFlags(Core.DebParams.AllFlags) deb.Always("Creating FrelonAcq") acq = Frelon.FrelonAcq(espia_dev_nb) deb.Trace("Done!") cam = acq.getFrelonCamera() ct = acq.getGlobalControl() ct_image = ct.image() ct_acq = ct.acquisition() acq_state = Core.AcqState() status_cb = ImageStatusCallback(ct, acq_state) ct.registerImageStatusCallback(status_cb) deb.Always("Setting Full Frame Mode - Speed - Chan 3&4") cam.setSPB2Config(Frelon.SPB2Speed) cam.setFrameTransferMode(Frelon.FFM) cam.setInputChan(Frelon.Chan34) deb.Trace("Done!") frame_dim = acq.getFrameDim(max_dim=True) bin = Core.Bin(1, vert_bin) deb.Always("Setting binning %s" % bin) ct_image.setBin(bin) deb.Trace("Done!") image_size = frame_dim.getSize() nb_cols = image_size.getWidth() nb_lines = image_size.getHeight() / vert_bin roi = Core.Roi(Core.Point(0, nb_lines - 2), Core.Size(nb_cols, 1)) deb.Always("Setting RoI %s" % roi) ct_image.setRoi(roi) deb.Trace("Done!") deb.Always("Setting Kinetic RoI mode") cam.setRoiMode(Frelon.Kinetic) deb.Trace("Done!") deb.Always("Setting Acc. mode") ct_acq.setAcqMode(Core.Accumulation) deb.Trace("Done!") deb.Always("Setting %s Acc. Time mode" % acc_time_mode) acc_mode = Core.CtAcquisition.Live \ if acc_time_mode == 'Live' \ else Core.CtAcquisition.Real ct_acq.setAccTimeMode(acc_mode) deb.Trace("Done!") deb.Always("Setting Acc. max. exp. time %s" % acc_max_exp_time) ct_acq.setAccMaxExpoTime(acc_max_exp_time) deb.Trace("Done!") deb.Always("Setting exp. time %s" % exp_time) ct_acq.setAcqExpoTime(exp_time) deb.Trace("Done!") deb.Always("Setting nb. frames %s" % nb_frames) ct_acq.setAcqNbFrames(nb_frames) deb.Trace("Done!") acc_nb_frames = ct_acq.getAccNbFrames() acc_dead_time = ct_acq.getAccDeadTime() acc_live_time = ct_acq.getAccLiveTime() deb.Always("AccNbFrames: %d, AccDeadTime: %.6f, AccLiveTime: %.6f" % (acc_nb_frames, acc_dead_time, acc_live_time)) deb.Always("Preparing acq.") ct.prepareAcq() deb.Trace("Done!") deb.Always("Starting acq.") status_cb.start() ct.startAcq() deb.Trace("Done!") state_mask = Core.AcqState.Acquiring acq_state.waitNot(state_mask) deb.Always("Finished!") dead_time = cam.getDeadTime() read_time = cam.getReadoutTime() xfer_time = cam.getTransferTime() deb.Always("Dead Time: %.6f, Readout Time: %.6f, Transfer Time: %.6f" % (dead_time, read_time, xfer_time))
def get_control(espia_dev_nb=0, **keys): global _FrelonAcq if _FrelonAcq is None: _FrelonAcq = FrelonAcq.FrelonAcq(int(espia_dev_nb)) return _FrelonAcq.getGlobalControl()
import time import signal from Lima import Core, GLDisplay, Frelon acq = Frelon.FrelonAcq(0) ct_control = acq.getGlobalControl() class FrelonCleanup(GLDisplay.GLForkCallback): def execInForked(self): global acq del acq frelon_cleanup = FrelonCleanup() gldisplay = GLDisplay.CtSPSGLDisplay(ct_control, []) gldisplay.addForkCallback(frelon_cleanup) gldisplay.setSpecArray('GLDisplayTest', 'Frelon') gldisplay.createWindow() signal.signal(signal.SIGCHLD, signal.SIG_IGN) ct_acq = ct_control.acquisition() ct_acq.setAcqNbFrames(10) ct_acq.setAcqExpoTime(0.1) gldisplay.setNorm(0, 200, 0) ct_control.prepareAcq() ct_control.startAcq() ct_status = ct_control.getStatus while ct_status().AcquisitionStatus == Core.AcqRunning: