Commit a0941256 authored by Samuel Debionne's avatar Samuel Debionne

Minor text and formatting improvements

parent 320185fa
Pipeline #2834 passed with stages
in 1 minute and 18 seconds
......@@ -3,6 +3,8 @@
Build and Install
-----------------
Two methods are provided to build Lima from source.
Using scripts
^^^^^^^^^^^^^
The ``install`` scripts will run cmake, compile and install.
......@@ -91,11 +93,10 @@ Then compile and install:
cmake --build
sudo cmake --build --target install
May you need to update your environment?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Environment Setup
^^^^^^^^^^^^^^^^^
If you have changed the default destination path for both libraries and python modules you should update
your environment variables.
If you have changed the default destination path for both libraries and python modules you should update your environment variables.
For Linux:
......@@ -111,7 +112,7 @@ For Windows:
set PATH=%PATH%;<my-new-install-dir>\Lima\lib
set PYTHONPATH=%PYTHONPATH%;<my-new-install-dir>
or update the system wide variables PATH for the libraries and PYTHONPATH for python.
or update the system wide variables ``PATH`` for the libraries and ``PYTHONPATH`` for python.
.. _PyTango: http://github.com/tango-cs/pytango
......@@ -3,21 +3,109 @@ C++ API
Unfortunately very limited documentation is available from the source doc...
Hello, Lima!
````````````
Let's start with a simple example of an image acquisition function using the simulator camera.
.. code-block:: c++
// A camera instance
Simulator::Camera simu;
// A hardware interface and the control object
Simulator::Interface hw(simu);
CtControl ct = CtControl(&hw);
// Get the saving control and set some properties
CtSaving *save = ct.saving();
save->setDirectory("./data");
save->setPrefix("test_");
save->setSuffix(".edf");
save->setNextNumber(100);
save->setFormat(CtSaving::EDF);
save->setSavingMode(CtSaving::AutoFrame);
save->setFramesPerFile(100);
// Set the binning or any other processing
Bin bin(2, 2);
CtImage *image = ct.image();
image->setBin(bin);
// Get the acquistion control and set some properties
CtAcquisition *acq = ct.acquisition();
acq->setAcqMode(Single);
acq->setAcqExpoTime(expo);
acq->setAcqNbFrames(nframe);
// Prepare acquistion (transfer properties to the camera)
ct.prepareAcq();
// Start acquistion
ct.startAcq();
std::cout << "SIMUTEST: acq started" << std::endl;
//
long frame = -1;
while (frame < (nframe - 1))
{
using namespace std::chrono;
high_resolution_clock::time_point begin = high_resolution_clock::now();
usleep(100000);
CtControl::ImageStatus img_status;
ct.getImageStatus(img_status);
high_resolution_clock::time_point end = high_resolution_clock::now();
auto duration = duration_cast<microseconds>(end - begin).count();
std::cout << "SIMUTEST: acq frame nr " << img_status.LastImageAcquired
<< " - saving frame nr " << img_status.LastImageSaved << std::endl;
if (frame != img_status.LastImageAcquired) {
unsigned int nb_frames = img_status.LastImageAcquired - frame;
std::cout << " " << duration << " usec for " << nb_frames << " frames\n";
std::cout << " " << 1e6 * nb_frames / duration << " fps" << std::endl;
frame = img_status.LastImageAcquired;
}
}
std::cout << "SIMUTEST: acq finished" << std::endl;
// Stop acquisition ( not really necessary since all frames where acquired)
ct.stopAcq();
std::cout << "SIMUTEST: acq stopped" << std::endl;
Main interfaces
```````````````
The control interface is the high level interface that lets your run an acquisition.
.. doxygenclass:: lima::CtControl
:project: control
:members:
.. doxygenclass:: lima::CtAcquisition
:project: control
:members:
.. doxygenclass:: lima::HwInterface
.. doxygenclass:: lima::HwFrameCallback
:project: hardware
:members:
.. doxygenclass:: lima::HwFrameCallback
The Hardware Interface is the low level interface that must be implemented by detector plugins.
.. doxygenclass:: lima::HwInterface
:project: hardware
:members:
Capabilities interfaces
```````````````````````
.. doxygenclass:: lima::HwDetInfoCtrlObj
:project: hardware
......@@ -31,7 +119,8 @@ Capabilities interfaces
:project: hardware
:members:
Implementations
Implementations Helpers
```````````````````````
.. doxygenclass:: lima::SoftBufferCtrlObj
:project: hardware
......
Future Cameras
^^^^^^^^^^^^^^
We have many contributors now for new camera plugins, main but not the least are:
ESRF, SOLEIL, DESY, ALBA, FRMII, ANKA.
During the coming year, several new detector plugins will be available.
Acknowledgement
===============
Many contributors contributed to new camera plugins, including:
- `ESRF <https://www.esrf.eu/>`_,
- `SOLEIL <https://www.synchrotron-soleil.fr/>`_,
- `DESY <http://www.desy.de/>`_,
- `ALBA <https://www.cells.es/en>`_,
- `FRMII <https://www.frm2.tum.de>`_,
- `ANKA <https://www.anka.kit.edu/>`_.
thank you for your support.
Under development
=================
During the coming year, several new detector plugins should be released:
- Hexitec
- SVCam HR (SVS-Vistek)
- Vieworks
- Eiger (PSI)
Foreseen
========
- Eiger (PSI)
- Rashpa
......@@ -7,17 +7,21 @@ As Lima is not packaged yet, the only way for now is to retrieve the source from
For both Linux and Windows we recommend to use the git tools:
- For Linux, install Git_ package if your linux distribution did not.
- For Windows, get and install Git_ first for the download section. Then use the git-bash tool with linux-like command line commands.
- For Windows, get and install Git_ first from the download section. Then use the git-bash tool with linux-like commands.
Command to get all sources
^^^^^^^^^^^^^^^^^^^^^^^^^^
All cameras
^^^^^^^^^^^
Here is the command to get the sources for all cameras:
.. code-block:: bash
git clone --recursive git://github.com/esrf-bliss/Lima.git
Commands for a minimum checkout to get all source needed for a particular camera
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
For a specific camera
^^^^^^^^^^^^^^^^^^^^^
Here are the commands for a minimum checkout to get all source needed for a specific camera:
.. code-block:: bash
......@@ -29,7 +33,7 @@ Commands for a minimum checkout to get all source needed for a particular camera
In addition (but optional) you can get the **TANGO** python device servers, so update your git clone again:
.. code-block:: bash
.. code-block:: bash
git submodule init application/tango/python
git submodule update
......
......@@ -6,7 +6,7 @@ For collaborative development, we use the "Fork & Pull" model from Github. So an
.. note:: If you want to contribute with a new camera plug-in you should first request us (by email @ lima@esrf.fr) to get the new plug-in camera sub-module created. We will provide:
- a default structure of directories (<mycamera>/src /include sip/ doc/ python/ test/)
- the Makefile files (<mycamera>/Makefile, <mycamera>/src/Makefile, <mycamera>/test/Makefile)
- the build system file (<mycamera>/CMakeLists.txt)
- templates files (src and include) for the mandatory classes:
- <MyCamera>Interface
......@@ -16,14 +16,6 @@ For collaborative development, we use the "Fork & Pull" model from Github. So an
- a standard .gitignore file
- a template index.rst for the documentation
In addition we will update with new entries other files needed to compile the plugin library and the python module:
- Lima/config.inc_default
- Lima/camera/Makefile
- build/Makefile
- sip/Makefile
- sip/configure.py
As above do not forget to fork the new sub-module project.
Create a github account
......
......@@ -10,18 +10,13 @@ Lima ( **L** ibrary for **Im** age **A** cquisition) is a project for the unifie
Lima is a C++ library which can be used for many different cameras. The library is also available for Python_ and it provides a PyTango_ server for remote control.
The documentation is also available in `pdf`_ format.
The documentation is also available in `pdf`_ and `epub`_ format.
If you want to be in touch with LIMA community, please send email to lima@esrf.fr. You can also subscribe to the mailing-list by sending
a message to sympa@esrf.fr with as subject *subscribe lima*.
If you want to be in touch with the LIMA community, please send an email to lima@esrf.fr. You may also want to subscribe to our mailing list by sending a message to sympa@esrf.fr with `subscribe lima` as subject.
There is no binary package for lima yet but Lima is a very active project and many developments are ongoing and available from `Github <github.com/esrf-bliss/Lima>`_.
There is no binary package for lima yet but Lima is a very active project and many developments are ongoing and available from `GitHub <https://github.com/esrf-bliss/Lima>`_. However you can find stable version releases through git branches and tags on `Github releases <https://github.com/esrf-bliss/Lima/releases>`_.
However you can find stable versions track through git branches and tags on github.com.
Please, feel free to fork/clone or download Lima at http://github.com/esrf-bliss/Lima.
For latest changes, refers to the :download:`Release Notes <./ReleaseNotes.txt>` (Also available under the Git repository master branch as ReleaseNotes.txt text file).
For the latest changes, refers to the :download:`Release Notes <../ReleaseNotes.txt>` (Also available under the Git repository master branch as ReleaseNotes.txt text file).
.. _compilation:
......@@ -73,7 +68,8 @@ You may also want to check out the `doxygen documentation`_ extracted from the s
.. _`doxygen documentation`: doxygen/html/index.html
.. _pdf: ../latex/Lima.pdf
.. _pdf: http://readthedocs.org/projects/lima-doc/downloads/pdf/latest/
.. _epub: http://readthedocs.org/projects/lima-doc/downloads/epub/latest/
.. _release notes: ./ReleaseNotes.txt
.. _Python: http://python.org
......
......@@ -6,19 +6,20 @@ PyTango Device Server
Server setup
````````````
As PyTango_ (Tango_ for python) server is provided as python script, you just have to copy the application/tango/python directory where you want.
As PyTango_ (Tango_ for python) server is provided as Python script, you just have to copy the application/tango/python directory wherever you want.
- **camera directory:** contained all camera Tango device specifics so remove all none need script
- **doc directory:** contained plugins camera documentation (exhaustive list of properties, commands and attributes)
- **plugins directory:** contained all plugins device server like:
- ``camera`` directory: contained all camera Tango device specifics so remove all none need script
- ``doc`` directory: contained plugins camera documentation (exhaustive list of properties, commands and attributes)
- ``plugins`` directory: contained all plugins device server like:
- Roi counters
- Mask...
- **scripts directory:** contained a script use at ESRF to start Lima device server (can also be removed)
- **LimaCCDs.py file:** python script to start Lima device server
- **LimaViewer.py file:** python script to start LimaViewer device server to get image from Lima device server
- ``scripts`` directory: contained a script use at ESRF to start Lima device server (can also be removed)
- ``LimaCCDs.py`` file: python script to start Lima device server
- ``LimaViewer.py`` file: python script to start LimaViewer device server to get image from Lima device server
**Warning**: be sure your environment is properly set for python and library paths, see :ref:`linux_installation` for more information.
:: warning: Make sure your environment is properly set for python and library paths, see :ref:`build_installation` for more information.
Example of plugin server setup : Basler detector
......@@ -28,100 +29,102 @@ This procedure described the way to implement basler camera plugin. It is the sa
You need to create a device server for Lima and another for the camera plugin. Lima device will use basler device thanks to "LimaCameraType" property. This property corresponds to the name of the camera plugin.
- **Lima device server:**
- Run Jive and select "Tools->Server Wizard" menu. You must enter server and instance names
.. image:: installation/LimaDeviceServer_1.png
Click Next...
- Start the Lima device server. Open a terminal and execute the command "server_name instance_name"
.. image:: installation/LimaDeviceServer_2.png
Click Next on the "Tango Device Installation Wizard" window
- Declare a Lima device
The Lima device server, contained several classes. For Basler camera you need to configure LimaCCDs and Basler classes.
.. image:: installation/LimaDeviceServer_3.png
Select "LimaCCDs" class and click "Declare device" button. You must enter the device name with a string as "Domain/Family/member".
.. image:: installation/LimaDeviceServer_4.png
Click Next and configure all the properties. You can let the default property values except for "LimaCameraType". This property must contain the name of the Camera Plugin "Basler".
.. image:: installation/LimaDeviceServer_5.png
At the end of the configuration, click "New Class" button.
.. image:: installation/LimaDeviceServer_6.png
Select "Basler" class and click "Declare device" button. You must enter the device name with a string as "Domain/Family/member".
.. image:: installation/LimaDeviceServer_7.png
Click Next and configure all the properties. You can let the default property values except for "cam_ip_adress". This property must contain the IP adress of the Basler camera.
.. image:: installation/LimaDeviceServer_8.png
Configuration is now ended, click "Finish"
.. image:: installation/LimaDeviceServer_9.png
- **Lima Viewer:**
To test the Lima device server, you can use the LimaViewer. This is a device server which periodically get the last image from the buffer. It allows the user to check that Lima device server is operational. The procedure below describe how to install and configure the LimaViewer device server.
- Run Jive and select "Tools->Server Wizard" menu. You must enter server and instance names
.. image:: installation/LimaViewerDeviceServer_1.png
Click Next...
- Start the LimaViewer device server. Open a terminal and execute the command "server_name instance_name"
.. image:: installation/LimaViewerDeviceServer_2.png
Click Next on the "Tango Device Installation Wizard" window
- Declare a LimaViewer device
Select "LimaViewer" class and click "Declare device" button.
.. image:: installation/LimaViewerDeviceServer_3.png
Enter the device name with a string as "Domain/Family/Member".
.. image:: installation/LimaViewerDeviceServer_4.png
Click Next and configure the "Dev_Ccd_name" property. This property corresponds to the name of the Lima device created before.
.. image:: installation/LimaViewerDeviceServer_5.png
Configuration is now finished, click on "Finish"
.. image:: installation/LimaViewerDeviceServer_6.png
- **Test LimaCCDs device server with Jive:**
The LimaViewer device appears in the Device tab from Jive. Make a right click on the LimaViewer device server and select "Monitor Device"
.. image:: installation/LimaViewerDeviceServer_7.png
AtkPanel is now launched. You can configure exposure time and the number of frames to acquire.
.. image:: installation/LimaViewerDeviceServer_8.png
The camera image can be viewed by selecting the "image_ccd" tab
.. image:: installation/LimaViewerDeviceServer_9.png
Lima device server
^^^^^^^^^^^^^^^^^^
1. Run Jive and select "Tools->Server Wizard" menu. You must enter server and instance names
.. image:: installation/LimaDeviceServer_1.png
Click Next...
2. Start the Lima device server. Open a terminal and execute the command "server_name instance_name"
.. image:: installation/LimaDeviceServer_2.png
Click Next on the "Tango Device Installation Wizard" window
3. Declare a Lima device
The Lima device server, contained several classes. For Basler camera you need to configure LimaCCDs and Basler classes.
.. image:: installation/LimaDeviceServer_3.png
Select "LimaCCDs" class and click "Declare device" button. You must enter the device name with a string as "Domain/Family/member".
.. image:: installation/LimaDeviceServer_4.png
Click Next and configure all the properties. You can let the default property values except for "LimaCameraType". This property must contain the name of the Camera Plugin "Basler".
.. image:: installation/LimaDeviceServer_5.png
At the end of the configuration, click "New Class" button.
.. image:: installation/LimaDeviceServer_6.png
Select "Basler" class and click "Declare device" button. You must enter the device name with a string as "Domain/Family/member".
.. image:: installation/LimaDeviceServer_7.png
Click Next and configure all the properties. You can let the default property values except for "cam_ip_adress". This property must contain the IP adress of the Basler camera.
.. image:: installation/LimaDeviceServer_8.png
Configuration is now ended, click "Finish"
.. image:: installation/LimaDeviceServer_9.png
Lima Viewer
^^^^^^^^^^^
To test the Lima device server, you can use the LimaViewer. This is a device server which periodically get the last image from the buffer. It allows the user to check that Lima device server is operational. The procedure below describe how to install and configure the LimaViewer device server.
1. Run Jive and select "Tools->Server Wizard" menu. You must enter server and instance names
.. image:: installation/LimaViewerDeviceServer_1.png
Click Next...
2. Start the LimaViewer device server. Open a terminal and execute the command "server_name instance_name"
.. image:: installation/LimaViewerDeviceServer_2.png
Click Next on the "Tango Device Installation Wizard" window
3. Declare a LimaViewer device
Select "LimaViewer" class and click "Declare device" button.
.. image:: installation/LimaViewerDeviceServer_3.png
Enter the device name with a string as "Domain/Family/Member".
.. image:: installation/LimaViewerDeviceServer_4.png
Click Next and configure the "Dev_Ccd_name" property. This property corresponds to the name of the Lima device created before.
.. image:: installation/LimaViewerDeviceServer_5.png
Configuration is now finished, click on "Finish"
.. image:: installation/LimaViewerDeviceServer_6.png
Test LimaCCDs device server with Jive
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The LimaViewer device appears in the Device tab from Jive. Make a right click on the LimaViewer device server and select "Monitor Device"
.. image:: installation/LimaViewerDeviceServer_7.png
AtkPanel is now launched. You can configure exposure time and the number of frames to acquire.
.. image:: installation/LimaViewerDeviceServer_8.png
The camera image can be viewed by selecting the "image_ccd" tab
.. image:: installation/LimaViewerDeviceServer_9.png
.. _Python: http://python.org
.. _PyTango: http://github.com/tango-cs/pytango
.. _Tango: http://tango-control.org
......@@ -4,3 +4,91 @@ Python API
Most of the previous sections about the user interface routines applies to the Python binding. Naturally, some specifics concerning Python come into play.
This documentation is very much a work in progress. Stay tuned!
Hello, pyLima!
``````````````
Let's start with a simple example of an image acquisition function using the simulator camera.
.. code-block:: python
from Lima import Core
from Lima import Simulator
import time
def test_mode_generator(cam, nb_frames_prefetched=0):
if nb_frames_prefetched:
cam.setMode(Simulator.Camera.MODE_GENERATOR_PREFETCH)
fb = cam.getFrameGetter()
fb.setNbPrefetchedFrames(nb_frames_prefetched)
test = fb.getNbPrefetchedFrames()
else:
cam.setMode(Simulator.Camera.MODE_GENERATOR)
fb = cam.getFrameGetter()
# Add a peak
p1 = Simulator.GaussPeak(10, 10, 23, 1000) # peak at 10,10 fwhm=23 and max=1000
fb.setPeaks([p1])
def test_mode_loader(cam, nb_frames_prefetched=0):
if nb_frames_prefetched:
cam.setMode(Simulator.Camera.MODE_LOADER_PREFETCH)
fb = cam.getFrameGetter()
fb.setNbPrefetchedFrames(nb_frames_prefetched)
test = fb.getNbPrefetchedFrames()
else:
cam.setMode(Simulator.Camera.MODE_LOADER)
fb = cam.getFrameGetter()
# Set file pattern
fb.setFilePattern(b'input\\test_*.edf')
cam = Simulator.Camera()
#test_mode_generator(cam)
#test_mode_generator(cam, 10)
#test_mode_loader(cam)
test_mode_loader(cam, 100)
# Get the hardware interface
hwint = Simulator.Interface(cam)
# Get the control interface
control = Core.CtControl(hwint)
# Get the acquisition control
acq = control.acquisition()
# Set new file parameters and autosaving mode
saving = control.saving()
pars=saving.getParameters()
pars.directory = b'output'
pars.prefix = b'testsimul_'
pars.suffix = b'.edf'
pars.fileFormat = Core.CtSaving.EDF
pars.savingMode = Core.CtSaving.AutoFrame
saving.setParameters(pars)
acq = control.acquisition()
# now ask for 2 sec. exposure and 10 frames
acq.setAcqExpoTime(0.1)
acq.setAcqNbFrames(10)
control.prepareAcq()
control.startAcq()
# wait for last image (#9) ready
status = control.getStatus()
lastimg = status.ImageCounters.LastImageReady
while lastimg != 9:
time.sleep(0.1)
lastimg = control.getStatus().ImageCounters.LastImageReady
status = control.getStatus()
lastimg = status.ImageCounters.LastImageReady
# read the first image
im0 = control.ReadImage(0)
......@@ -4,7 +4,7 @@
Requirements
------------
You need to install some tools and libraries for building Lima for both Windows and Linux.
Some tools and libraries are required to build Lima for either Windows and Linux.
Build dependencies
~~~~~~~~~~~~~~~~~~
......@@ -14,8 +14,9 @@ Build dependencies
- Visual Studio 2008 for x86 or x64 for python2.7.x
- Visual Studio 2008 Express for x86 only for python2.7.x
- Visual Studio 2015 for x86 and x64 for python >= 3.5
- Visual Studio 2017
- CMake_ >= 3
- CMake_ >= 3.1
- The GSL_ library. For Windows, download the ESRF binary package `gsl-windows`_ and install it under ``C:\Program Files``.
Python dependencies
......@@ -24,7 +25,7 @@ Python dependencies
Lima_ is compatible with python 2 and 3 (Linux only).
- numpy_ >= 1.1
- sip_ <= 4.18
- sip_ <= 4.18. Version 4.19 is known not to work.
Optional dependencies
~~~~~~~~~~~~~~~~~~~~~
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment