Lima-tango-python issueshttps://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues2021-01-08T20:56:21+01:00https://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/35Image events are never pushed.2021-01-08T20:56:21+01:00Damien NaudetImage events are never pushed.ImageStatusCallback never pushes events because of how the last event time is stored: it is always updated even when no events is sent, and the comparison is wrong anyway (current time < next time instead of current time >= next time).
A...ImageStatusCallback never pushes events because of how the last event time is stored: it is always updated even when no events is sent, and the comparison is wrong anyway (current time < next time instead of current time >= next time).
Also, the way it's done, you can miss the last frame, so I suggest sending it when:
- last_acquired == -1
- status changed (this way there's an even when the last frame of an acquisition is available, because the status is back to "AcqReady" when the callback is called)
- current time > last event time + delay
@claustre
@debionneDamien NaudetDamien Naudethttps://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/34write_acc_saturated_cblevel2021-01-14T11:41:44+01:00Laurent Claustrewrite_acc_saturated_cbleveldo not raise exceptiondo not raise exceptionLaurent ClaustreLaurent Claustrehttps://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/33`read_acc_saturated_cblevel` should return `-1` instead of throwing when not ...2020-10-07T12:09:28+02:00Samuel Debionne`read_acc_saturated_cblevel` should return `-1` instead of throwing when not callback is setEverything is in the title.
Related to https://gitlab.esrf.fr/bliss/bliss/-/merge_requests/2935Everything is in the title.
Related to https://gitlab.esrf.fr/bliss/bliss/-/merge_requests/2935Samuel DebionneSamuel Debionnehttps://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/32fix clean "Error: destroying non-empty Allocator" message2020-09-21T15:09:54+02:00Perceval Guilloufix clean "Error: destroying non-empty Allocator" messageI always see the message "Error: destroying non-empty Allocator" when tango-lima is closed
(stopped with ctrl-c or at the end of each pytest using a camera simulator).
I think @debionne told me it is not armful.
Could it be cleaned/f...I always see the message "Error: destroying non-empty Allocator" when tango-lima is closed
(stopped with ctrl-c or at the end of each pytest using a camera simulator).
I think @debionne told me it is not armful.
Could it be cleaned/fixed ?https://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/31allow the simulator to be loaded with a numpy array instead of a .edf file2020-09-08T16:38:55+02:00Perceval Guillouallow the simulator to be loaded with a numpy array instead of a .edf fileThe load prefetch mode is great and woks well with edf images (see file_pattern).
However it would be even better and more straightforward to be able to feed the prefetch mode directly with numpy arrays (in addition to the actual 'fill_...The load prefetch mode is great and woks well with edf images (see file_pattern).
However it would be even better and more straightforward to be able to feed the prefetch mode directly with numpy arrays (in addition to the actual 'fill_with_edf_files' thing)https://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/30background correction: take next image as dark image during acquisition2021-01-14T11:41:57+01:00Laurent Claustrebackground correction: take next image as dark image during acquisitionThe current plugin command cannot be use during a acquistion, idea is to allow to use any image during a scan as new background.The current plugin command cannot be use during a acquistion, idea is to allow to use any image during a scan as new background.Laurent ClaustreLaurent Claustrehttps://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/29[bpm] option for bayer decoding2020-09-04T14:23:41+02:00Stuart Fisher[bpm] option for bayer decoding@berruyer asked if its possible for the bpm-web viewer to show images in colour.
I think it should be possible to add an option to return colour image, for instance bayer decode.
I'm not quite sure how you get hold of the image mode an...@berruyer asked if its possible for the bpm-web viewer to show images in colour.
I think it should be possible to add an option to return colour image, for instance bayer decode.
I'm not quite sure how you get hold of the image mode and thus know if you need to bayer decode, somewhere here:
https://gitlab.esrf.fr/limagroup/Lima-tango-python/-/blob/master/plugins/Bpm.py#L657
In my video streamer i do something along the lines of
```
if cv2:
if image_mode >= 11 or image_mode <= 14:
data = cv2.cvtColor(data, cv2.COLOR_BAYER_RG2RGB)
```
where image_mode comes from the image headerStuart FisherStuart Fisherhttps://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/28"InvalidValue: Roi out of limits" when applying rotation with an image_roi al...2020-08-25T10:14:17+02:00Perceval Guillou"InvalidValue: Roi out of limits" when applying rotation with an image_roi already defined
If a rotation of 90deg is set while a roi is already defined, then Lima tries to recompute the roi but then it checks that the new roi is included in the fullframe rect but it forgets to rotate the fullframe sizes.
example: if rot = 0...
If a rotation of 90deg is set while a roi is already defined, then Lima tries to recompute the roi but then it checks that the new roi is included in the fullframe rect but it forgets to rotate the fullframe sizes.
example: if rot = 0 => camera fullsize: w=800, h=600
+ set a roi => proxy.image_roi = 300,50,450,300
then we apply a rotation: proxy.image_rotation = '90'
=> lima applies rotation and then compute a new_roi => 250,300,300,450
BUT it checks that new_roi is included in fullframe <800, 600> and fails because the new roi is off
It should have checked that the new_roi is in the rotated fullframe <600, 800> !
```
InvalidValue: Roi out of limitsm_max_roi=<0,0>-<800x600>, roi=<250,300>-<300x450>
```
if current rotation is 90 or 270, limitsm_max_roi should return <0,0>-<600x800> instead of <0,0>-<800x600>https://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/27Python3: plugin code still has references to removed itertools.izip2021-01-15T14:32:35+01:00Alejandro Homs PuronPython3: plugin code still has references to removed itertools.izip`itertools.izip` was removed in Python3. References to it remain in the code:
```
blissadm@lid02eiger2lima:~/Git/Lima/applications/tango/python$ git grep izip
plugins/Bpm.py: return itertools.izip(*[itertools.chain(iterable, itertool...`itertools.izip` was removed in Python3. References to it remain in the code:
```
blissadm@lid02eiger2lima:~/Git/Lima/applications/tango/python$ git grep izip
plugins/Bpm.py: return itertools.izip(*[itertools.chain(iterable, itertools.repeat(padvalue, n-1))]*n)
plugins/Memcached.py:# return itertools.izip(*[itertools.chain(iterable, itertools.repeat(padvalue, n-1))]*n)
plugins/PeakFinder.py: return itertools.izip(*[itertools.chain(iterable, itertools.repeat(padvalue, n-1))]*n)
plugins/Roi2Spectrum.py: return itertools.izip(*[itertools.chain(iterable, itertools.repeat(padvalue, n-1))]*n)
```
The suggested solution is to apply the patch in d9a29084:
``` diff
diff --git a/plugins/RoiCounter.py b/plugins/RoiCounter.py
index 4c0eb12..ad06573 100644
--- a/plugins/RoiCounter.py
+++ b/plugins/RoiCounter.py
@@ -30,7 +30,7 @@ from Lima import Core
from Lima.Server.plugins.Utils import getDataFromFile,BasePostProcess
def grouper(n, iterable, padvalue=None):
- return itertools.izip(*[itertools.chain(iterable, itertools.repeat(padvalue, n-1))]*n)
+ return zip(*[itertools.chain(iterable, itertools.repeat(padvalue, n-1))]*n)
RoiCounterTask = Core.Processlib.Tasks.RoiCounterTask
```
Another alternative, which allows still using `itertools.izip` in Python2 (probably not worth), was applied in Lima-camera-simulator@c6fa7a57:
``` diff
diff --git a/tango/Simulator.py b/tango/Simulator.py
index 0a08528..8220d57 100644
--- a/tango/Simulator.py
+++ b/tango/Simulator.py
@@ -26,13 +26,19 @@
import itertools
import PyTango
+# python3 compat
+try:
+ from itertools import izip as zip
+except ImportError:
+ pass
+
from Lima.Server import AttrHelper
from Lima import Core
from Lima import Simulator as SimuMod
def grouper(n, iterable, padvalue=None):
- return itertools.izip(*[itertools.chain(iterable, itertools.repeat(padvalue, n-1))]*n)
+ return zip(*[itertools.chain(iterable, itertools.repeat(padvalue, n-1))]*n)
class Simulator(PyTango.Device_4Impl):
```
In any case, the solution should be uniform inside the repository, that is, for the following files:
```
blissadm@lid02eiger2lima:~/Git/Lima/applications/tango/python$ git grep 'def grouper'
plugins/Bpm.py:def grouper(n, iterable, padvalue=None):
plugins/Memcached.py:# def grouper(n, iterable, padvalue=None):
plugins/PeakFinder.py:def grouper(n, iterable, padvalue=None):
plugins/Roi2Spectrum.py:def grouper(n, iterable, padvalue=None):
plugins/RoiCounter.py:def grouper(n, iterable, padvalue=None):
```https://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/25bpm.Stop() hangs if called to soon after the acquisition ends2020-07-03T15:46:38+02:00Perceval Guilloubpm.Stop() hangs if called to soon after the acquisition ends
test code:
```python
import tango
import time
bpm = tango.DeviceProxy('id00/bpm/samsim')
cam = tango.DeviceProxy('id00/limaccds/samsim')
cam.acq_expo_time = 1
sleep_time = 0.001
bpm_delay = 0.05
#-----start acquisition
bpm.Start()
...
test code:
```python
import tango
import time
bpm = tango.DeviceProxy('id00/bpm/samsim')
cam = tango.DeviceProxy('id00/limaccds/samsim')
cam.acq_expo_time = 1
sleep_time = 0.001
bpm_delay = 0.05
#-----start acquisition
bpm.Start()
cam.prepareAcq()
cam.startAcq()
#-----wait for image acquisition
while cam.last_image_ready == -1:
time.sleep(sleep_time)
#-----wait for bpm data
data = []
while len(data) == 0:
data = bpm.GetResults(0)
time.sleep(sleep_time)
#-----stop/clean
cam.stopAcq()
#time.sleep(bpm_delay) # <= introducing a delay >~ 0.02s avoids the error on next line (bpm.stop)
bpm.Stop() # <= hangs here and timeout after 3sec IF CALLED TOO SOON after end of acquisition
return data
```https://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/22add lima_version attr2020-02-11T15:14:51+01:00Laurent Claustreadd lima_version attrlima 1.9.2 will provide a new method CtControl::getVersion() to read the limacore version. Useful for client like BLISS to check some supported feature like the new HDF5 implementation available since 1.9.2lima 1.9.2 will provide a new method CtControl::getVersion() to read the limacore version. Useful for client like BLISS to check some supported feature like the new HDF5 implementation available since 1.9.2Laurent ClaustreLaurent Claustrehttps://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/21bpm: cross sections wrong when roi set?2020-01-30T18:27:25+01:00Stuart Fisherbpm: cross sections wrong when roi set?Looks like setting an roi does not give the correct cross sections for the current beam mark? (https://gitlab.esrf.fr/limagroup/Lima-bpm-web-server/issues/13)Looks like setting an roi does not give the correct cross sections for the current beam mark? (https://gitlab.esrf.fr/limagroup/Lima-bpm-web-server/issues/13)https://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/20bpm add min-max for manual scale mode2019-12-04T11:41:39+01:00Laurent Claustrebpm add min-max for manual scale modehttps://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/19bpm jpeg_quality control2019-11-15T17:14:10+01:00Laurent Claustrebpm jpeg_quality controladd property+attr for jpeg quality control
In addition add support for turbojpeg encoding if it is available(PyJpegTurbo nad libturbojpeg.so)add property+attr for jpeg quality control
In addition add support for turbojpeg encoding if it is available(PyJpegTurbo nad libturbojpeg.so)Laurent ClaustreLaurent Claustrehttps://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/18Logging polution2019-10-11T13:59:49+02:00Wout De NolfLogging polutionMany random `print` calls can be found throughout the code which pollutes the output logs at unexpected moments.
These are the ones I see when starting a lima simulator:
https://gitlab.esrf.fr/limagroup/Lima-tango-python/blob/master/Li...Many random `print` calls can be found throughout the code which pollutes the output logs at unexpected moments.
These are the ones I see when starting a lima simulator:
https://gitlab.esrf.fr/limagroup/Lima-tango-python/blob/master/LimaCCDs.py#L378
```python
class LimaCCDs(PyTango.Device_4Impl):
def __init__(self,*args) :
PyTango.Device_4Impl.__init__(self,*args)
...
print('YO')
```
https://gitlab.esrf.fr/limagroup/Lima-tango-python/blob/master/LimaCCDs.py#L2604
```python
def export_ct_control(ct_map):
...
print("Creating device {0}({1})...".format(tango_class_name, name))
util.create_device(tango_class_name, name)
print("Done")
```
https://gitlab.esrf.fr/limagroup/Lima-tango-python/blob/master/EnvHelper.py#L439
```python
def create_tango_objects(ct_control, name_template):
...
print("ctcontrol.{0}() = {1}".format(ct_func_name, getattr(tango_ct_control, ct_func_name)()))
```
https://gitlab.esrf.fr/limagroup/Lima-tango-python/blob/master/plugins/LiveViewer.py#L122
```python
class LiveViewer (PyTango.Device_4Impl):
def init_device(self):
...
print ("Warning: setFrameRate() not supported")
```
Then for a lima simulator (different project):
https://gitlab.esrf.fr/limagroup/Lima-camera-simulator/blob/stable/tango/Simulator.py#L126
```python
class Simulator(PyTango.Device_4Impl):
def __getattr__(self,name) :
print(name)
print(type(_SimuCamera.getFrameGetter()))
```https://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/17Eventing not working with Tango 9.3.22019-10-11T13:27:45+02:00Stuart FisherEventing not working with Tango 9.3.2Eventing was working fine with Tango 9.2.5a, however after upgrading to 9.3.2 from the tango-controls channel i no longer get events from lima devices.
I have tested that eventing in general is working in tango by building a test device...Eventing was working fine with Tango 9.2.5a, however after upgrading to 9.3.2 from the tango-controls channel i no longer get events from lima devices.
I have tested that eventing in general is working in tango by building a test device from this pytest:
https://github.com/tango-controls/pytango/blob/566c549eaa7b6b3cbb87152f1bdaec137e6c49a9/tests/test_event.py#L41
and can confirm that the following works:
```
test = PyTango.DeviceProxy('id00/event/test')
def cb(data):
print('cb', data)
test.subscribe_event('attr', PyTango.EventType.CHANGE_EVENT, cb)
test.send_event()
cb EventData[
attr_name = 'tango://el7.localdomain:10000/id00/event/test/attr'
attr_value = DeviceAttribute(data_format = tango._tango.AttrDataFormat.SCALAR, dim_x = 1, dim_y = 0, has_failed = False, is_empty = False, name = 'attr', nb_read = 1, nb_written = 0, quality = tango._tango.AttrQuality.ATTR_VALID, r_dimension = AttributeDimension(dim_x = 1, dim_y = 0), time = TimeVal(tv_nsec = 0, tv_sec = 1570024492, tv_usec = 219171), type = tango._tango.CmdArgType.DevDouble, value = 1.0, w_dim_x = 0, w_dim_y = 0, w_dimension = AttributeDimension(dim_x = 0, dim_y = 0), w_value = None)
device = EventDevice(id00/event/test)
err = False
errors = ()
event = 'change'
reception_date = TimeVal(tv_nsec = 0, tv_sec = 1570024492, tv_usec = 219427)]
```
Now to the problem in hand, the Bpm device no longer seems to send the bvdata event.
I have tried
* enabling TangoEvent on my LimaCCDs device, then subscribe to last_image. Run prepareAcq(), startAcq() -> no events
* With @claustre we have tested that the push is happening from the BVDataTask via print trace, however subscription to bvdata from the Bpm device -> no events
* have confirmed that `enable_tango_event` from https://gitlab.esrf.fr/limagroup/Lima-tango-python/blob/master/plugins/Bpm.py#L94 is True
Not sure what has caused this?https://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/15move camera plugin documentation to camera project2019-08-16T08:32:41+02:00Laurent Claustremove camera plugin documentation to camera projectRST files will be moved to <camera>/tango/doc and the index.rst updated to use relative path to camera submodulesRST files will be moved to <camera>/tango/doc and the index.rst updated to use relative path to camera submodulesLaurent ClaustreLaurent Claustrehttps://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/14LimaCCDs python 3.7 : xrange2019-05-06T08:10:42+02:00Damien NaudetLimaCCDs python 3.7 : xrangexrange is used in LimaCCDs, but it's not available in python 3+.xrange is used in LimaCCDs, but it's not available in python 3+.https://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/13Apps have no way of knowing if an acquisition has started2020-12-23T15:38:58+01:00Damien NaudetApps have no way of knowing if an acquisition has startedAFAIK, a GUI connected to the LimaCCDs server has no way of knowing if an acqusition was started/canceled/finished without enabling the image status events, or polling the acq_status attribute (but then changes can be missed if the acqui...AFAIK, a GUI connected to the LimaCCDs server has no way of knowing if an acqusition was started/canceled/finished without enabling the image status events, or polling the acq_status attribute (but then changes can be missed if the acquisition is shorter than the polling period).
It would be nice to have an event on the acq_status attribute.Damien NaudetDamien Naudethttps://gitlab.esrf.fr/limagroup/Lima-tango-python/-/issues/12update conda recipe to use tango-controls channel2019-08-16T11:01:51+02:00Laurent Claustreupdate conda recipe to use tango-controls channelNow PyTango/tango project deliver conda pacakage on anaconda/tango-controls channel
We Should no more use our home-made conda packages. Quiz of windows packages? tango-controls does not provide them yet.Now PyTango/tango project deliver conda pacakage on anaconda/tango-controls channel
We Should no more use our home-made conda packages. Quiz of windows packages? tango-controls does not provide them yet.Laurent ClaustreLaurent Claustre