pysilico


Namepysilico JSON
Version 0.21.0 PyPI version JSON
download
home_pagehttps://github.com/lbusoni/pysilico
SummaryAllied Vision AVT-Prosilica camera controller with PLICO
upload_time2024-06-28 14:24:36
maintainerNone
docs_urlNone
authorLorenzo Busoni
requires_pythonNone
licenseMIT
keywords plico prosilica avt camera laboratory instrumentation control
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # PYSILICO: Prosilica AVT camera controller for Plico

 ![Python package](https://img.shields.io/github/actions/workflow/status/ArcetriAdaptiveOptics/pysilico/pythontest.yml)
 [![codecov](https://codecov.io/gh/ArcetriAdaptiveOptics/pysilico/branch/master/graph/badge.svg?token=GTDOW6IWDE)](https://codecov.io/gh/ArcetriAdaptiveOptics/pysilico)
 [![Documentation Status](https://readthedocs.org/projects/pysilico/badge/?version=latest)](https://pysilico.readthedocs.io/en/latest/?badge=latest)
 [![PyPI version][pypiversion]][pypiversionlink]



pysilico is an application to control [Allied AVT/Prosilica][allied] cameras (and possibly other GigE cameras) under the [plico][plico] environment.

[plico]: https://github.com/ArcetriAdaptiveOptics/plico
[travis]: https://travis-ci.com/ArcetriAdaptiveOptics/pysilico.svg?branch=master "go to travis"
[travislink]: https://travis-ci.com/ArcetriAdaptiveOptics/pysilico
[coveralls]: https://coveralls.io/repos/github/ArcetriAdaptiveOptics/pysilico/badge.svg?branch=master "go to coveralls"
[coverallslink]: https://coveralls.io/github/ArcetriAdaptiveOptics/pysilico
[allied]: https://www.alliedvision.com
[pypiversion]: https://badge.fury.io/py/pysilico.svg
[pypiversionlink]: https://badge.fury.io/py/pysilico



## Installation

### On client

On the client machine

```
pip install pysilico
```

### On the server

On the server machine install the proprietary driver for the camera you want to control. Currently only AVT/Prosilica camera are supported through Vimba

#### For AVT / Prosilica

First install Vimba (that comes with the camera, or download Vimba SDK from AVT website). Assuming you have downloaded and unpacked Vimba6 in the Downloads folder on a Linux machine:

```
cd ~/Downloads/Vimba_6_0/VimbaGigETL/
sudo ./Install.sh
```

Check that the Vimba installation is successful (you may need to log out and log in) and that the camera is accessible by the server using VimbaViewer, the standalone application provided in Vimba SDK. You should be able to see the cameras reachable in the network and you should be able to stream images.

```
cd ~/Downloads/Vimba_6_0/Tools/Viewer/Bin/x86_64bit
./VimbaViewer
```

Then install the Vimba python wrapper. It is suggested to use a dedicated python virtual environment, like conda (check elsewhere how to install Anaconda and create a virtual environment). 

Now you can install the Vimba python wrapper in the 

```
cd ~/Downloads/Vimba_6_0/VimbaPython/
./Install.sh
```

The script `Install.sh` is to date not working with conda virtual envs. If you are using conda and the command above fails, the following should do the work :

```
cd ~/Downloads/Vimba_6_0/VimbaPython/Source
pip install .
```

Check that the installation is successfull by running the provided example, like the one below:

```
cd ~/Downloads/Vimba_6_0/VimbaPython/Examples
python list_cameras.py
```

The ouput shows that camera(s) has been properly detected.

```
(pysilico) lbusoni@argos:~/Downloads/Vimba_6_0/VimbaPython/Examples$ python list_cameras.py 
//////////////////////////////////////
/// Vimba API List Cameras Example ///
//////////////////////////////////////

Cameras found: 1
/// Camera Name   : GC1350M
/// Model Name    : GC1350M (02-2130A)
/// Camera ID     : DEV_000F3101C686
/// Serial Number : 02-2130A-06774
/// Interface ID  : eno2
```


#### Install server
As a last step you always have to install the package `pysilico-server`

```
pip install pysilico-server
```


## Usage

### Edit config file

The config file location depends on the operating system. In Ubuntu is `/home/labot/.config/inaf.arcetri.ao.pysilico_server/pysilico_server.conf`. When the server is started, it prints the config file location on standard output.
Open the file and adapt it to your case.

In this example we want `pysilico_server` to control 2 cameras: a Manta 419 whose IP address is 192.168.29.189 used for a SH WFS, and a GC1350 (IP 192.168.29.194) used as PSF monitor. We reduce the streaming rate to 20MB/s in such a way that no packet will be lost during transfer to the server PC. 

Every `[cameraN]` entry in the config file correspond to a pysilico server; you may add as many as you want. Every `[cameraN]` entry must have a `camera=` key linking to a `[deviceX]` entry that specifies the camera model, IP, etc. 

```
[deviceManta419]
name= AVT Manta G-419B 5CA8
model= avt
ip_address= 192.168.29.189
streambytespersecond= 20000000
binning= 1

[deviceGC1350M]
name= AVT GC 1350M C686
model= avt
ip_address= 192.168.29.194
streambytespersecond= 20000000
binning= 1

[camera1]
name= SH WFS Ibis
log_level= info
camera= deviceManta419
host= localhost
port= 7100

[camera2]
name= PSF Ibis
log_level= info
camera= deviceGC1350M
host= localhost
port= 7110
```


### Starting Servers

Start the servers with 

```
pysilico_start
```

The servers are logging info in a dedicate log file. The log file name is printed on the standard output when the server is started. 

On Ubuntu it can be in `/home/labot/.cache/inaf.arcetri.ao.pysilico_server/log/camera1.log` (and camera2.log and so on for the other servers)

Check in the log file that the server is properly running and communicating with the camera; it should periodically dump a line like "Stepping at xx Hz"  

  

### Using the client module 

We assume that `pysilico_server` runs on '192.168.29.132'.  

In a python terminal on a client computer on which `pysilico` has been installed:

```
In [1]: import pysilico

In [2]: cam_sh= pysilico.camera('192.168.29.132', 7100)

In [3]: cam_psf= pysilico.camera('192.168.29.132', 7110)

In [4]: frames= cam_sh.getFutureFrames(10)
```

### Using the GUI

Run `pysilico_gui`

### Stopping pysilico

To kill the servers run

```
pysilico_stop
```

More hard:

```
pysilico_kill_all
```




## Administration Tool

For developers.


### Testing
Never commit before tests are OK!
To run the unittest and integration test suite cd in pysilico source dir

```
python setup.py test
```


### Creating a Conda environment
Use the Anaconda GUI or in terminal

```
conda create --name pysilico
```

To create an environment with a specific python version (you need > 3.7 for Vimba)

```
conda create --name pysilico python=3.8
```


It is better to install available packages from conda instead of pip. 

```
conda install --name pysilico matplotlib scipy ipython numpy
```

### Packaging and distributing

1. Update the version in version.py and commit
2. Create a new release
3. If you have the proper rights (see PYPI_API_TOKEN in Settings/Secrets), the Action automatically builds and uploads the wheel on pypi


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/lbusoni/pysilico",
    "name": "pysilico",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "plico, prosilica, avt, camera, laboratory, instrumentation control",
    "author": "Lorenzo Busoni",
    "author_email": "lorenzo.busoni@inaf.it",
    "download_url": "https://files.pythonhosted.org/packages/af/f8/8658b44a14d7fa1ab40d9d8d8c4613d982a87aec1304bdb1d5984f59e880/pysilico-0.21.0.tar.gz",
    "platform": null,
    "description": "# PYSILICO: Prosilica AVT camera controller for Plico\n\n ![Python package](https://img.shields.io/github/actions/workflow/status/ArcetriAdaptiveOptics/pysilico/pythontest.yml)\n [![codecov](https://codecov.io/gh/ArcetriAdaptiveOptics/pysilico/branch/master/graph/badge.svg?token=GTDOW6IWDE)](https://codecov.io/gh/ArcetriAdaptiveOptics/pysilico)\n [![Documentation Status](https://readthedocs.org/projects/pysilico/badge/?version=latest)](https://pysilico.readthedocs.io/en/latest/?badge=latest)\n [![PyPI version][pypiversion]][pypiversionlink]\n\n\n\npysilico is an application to control [Allied AVT/Prosilica][allied] cameras (and possibly other GigE cameras) under the [plico][plico] environment.\n\n[plico]: https://github.com/ArcetriAdaptiveOptics/plico\n[travis]: https://travis-ci.com/ArcetriAdaptiveOptics/pysilico.svg?branch=master \"go to travis\"\n[travislink]: https://travis-ci.com/ArcetriAdaptiveOptics/pysilico\n[coveralls]: https://coveralls.io/repos/github/ArcetriAdaptiveOptics/pysilico/badge.svg?branch=master \"go to coveralls\"\n[coverallslink]: https://coveralls.io/github/ArcetriAdaptiveOptics/pysilico\n[allied]: https://www.alliedvision.com\n[pypiversion]: https://badge.fury.io/py/pysilico.svg\n[pypiversionlink]: https://badge.fury.io/py/pysilico\n\n\n\n## Installation\n\n### On client\n\nOn the client machine\n\n```\npip install pysilico\n```\n\n### On the server\n\nOn the server machine install the proprietary driver for the camera you want to control. Currently only AVT/Prosilica camera are supported through Vimba\n\n#### For AVT / Prosilica\n\nFirst install Vimba (that comes with the camera, or download Vimba SDK from AVT website). Assuming you have downloaded and unpacked Vimba6 in the Downloads folder on a Linux machine:\n\n```\ncd ~/Downloads/Vimba_6_0/VimbaGigETL/\nsudo ./Install.sh\n```\n\nCheck that the Vimba installation is successful (you may need to log out and log in) and that the camera is accessible by the server using VimbaViewer, the standalone application provided in Vimba SDK. You should be able to see the cameras reachable in the network and you should be able to stream images.\n\n```\ncd ~/Downloads/Vimba_6_0/Tools/Viewer/Bin/x86_64bit\n./VimbaViewer\n```\n\nThen install the Vimba python wrapper. It is suggested to use a dedicated python virtual environment, like conda (check elsewhere how to install Anaconda and create a virtual environment). \n\nNow you can install the Vimba python wrapper in the \n\n```\ncd ~/Downloads/Vimba_6_0/VimbaPython/\n./Install.sh\n```\n\nThe script `Install.sh` is to date not working with conda virtual envs. If you are using conda and the command above fails, the following should do the work :\n\n```\ncd ~/Downloads/Vimba_6_0/VimbaPython/Source\npip install .\n```\n\nCheck that the installation is successfull by running the provided example, like the one below:\n\n```\ncd ~/Downloads/Vimba_6_0/VimbaPython/Examples\npython list_cameras.py\n```\n\nThe ouput shows that camera(s) has been properly detected.\n\n```\n(pysilico) lbusoni@argos:~/Downloads/Vimba_6_0/VimbaPython/Examples$ python list_cameras.py \n//////////////////////////////////////\n/// Vimba API List Cameras Example ///\n//////////////////////////////////////\n\nCameras found: 1\n/// Camera Name   : GC1350M\n/// Model Name    : GC1350M (02-2130A)\n/// Camera ID     : DEV_000F3101C686\n/// Serial Number : 02-2130A-06774\n/// Interface ID  : eno2\n```\n\n\n#### Install server\nAs a last step you always have to install the package `pysilico-server`\n\n```\npip install pysilico-server\n```\n\n\n## Usage\n\n### Edit config file\n\nThe config file location depends on the operating system. In Ubuntu is `/home/labot/.config/inaf.arcetri.ao.pysilico_server/pysilico_server.conf`. When the server is started, it prints the config file location on standard output.\nOpen the file and adapt it to your case.\n\nIn this example we want `pysilico_server` to control 2 cameras: a Manta 419 whose IP address is 192.168.29.189 used for a SH WFS, and a GC1350 (IP 192.168.29.194) used as PSF monitor. We reduce the streaming rate to 20MB/s in such a way that no packet will be lost during transfer to the server PC. \n\nEvery `[cameraN]` entry in the config file correspond to a pysilico server; you may add as many as you want. Every `[cameraN]` entry must have a `camera=` key linking to a `[deviceX]` entry that specifies the camera model, IP, etc. \n\n```\n[deviceManta419]\nname= AVT Manta G-419B 5CA8\nmodel= avt\nip_address= 192.168.29.189\nstreambytespersecond= 20000000\nbinning= 1\n\n[deviceGC1350M]\nname= AVT GC 1350M C686\nmodel= avt\nip_address= 192.168.29.194\nstreambytespersecond= 20000000\nbinning= 1\n\n[camera1]\nname= SH WFS Ibis\nlog_level= info\ncamera= deviceManta419\nhost= localhost\nport= 7100\n\n[camera2]\nname= PSF Ibis\nlog_level= info\ncamera= deviceGC1350M\nhost= localhost\nport= 7110\n```\n\n\n### Starting Servers\n\nStart the servers with \n\n```\npysilico_start\n```\n\nThe servers are logging info in a dedicate log file. The log file name is printed on the standard output when the server is started. \n\nOn Ubuntu it can be in `/home/labot/.cache/inaf.arcetri.ao.pysilico_server/log/camera1.log` (and camera2.log and so on for the other servers)\n\nCheck in the log file that the server is properly running and communicating with the camera; it should periodically dump a line like \"Stepping at xx Hz\"  \n\n  \n\n### Using the client module \n\nWe assume that `pysilico_server` runs on '192.168.29.132'.  \n\nIn a python terminal on a client computer on which `pysilico` has been installed:\n\n```\nIn [1]: import pysilico\n\nIn [2]: cam_sh= pysilico.camera('192.168.29.132', 7100)\n\nIn [3]: cam_psf= pysilico.camera('192.168.29.132', 7110)\n\nIn [4]: frames= cam_sh.getFutureFrames(10)\n```\n\n### Using the GUI\n\nRun `pysilico_gui`\n\n### Stopping pysilico\n\nTo kill the servers run\n\n```\npysilico_stop\n```\n\nMore hard:\n\n```\npysilico_kill_all\n```\n\n\n\n\n## Administration Tool\n\nFor developers.\n\n\n### Testing\nNever commit before tests are OK!\nTo run the unittest and integration test suite cd in pysilico source dir\n\n```\npython setup.py test\n```\n\n\n### Creating a Conda environment\nUse the Anaconda GUI or in terminal\n\n```\nconda create --name pysilico\n```\n\nTo create an environment with a specific python version (you need > 3.7 for Vimba)\n\n```\nconda create --name pysilico python=3.8\n```\n\n\nIt is better to install available packages from conda instead of pip. \n\n```\nconda install --name pysilico matplotlib scipy ipython numpy\n```\n\n### Packaging and distributing\n\n1. Update the version in version.py and commit\n2. Create a new release\n3. If you have the proper rights (see PYPI_API_TOKEN in Settings/Secrets), the Action automatically builds and uploads the wheel on pypi\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Allied Vision AVT-Prosilica camera controller with PLICO",
    "version": "0.21.0",
    "project_urls": {
        "Homepage": "https://github.com/lbusoni/pysilico"
    },
    "split_keywords": [
        "plico",
        " prosilica",
        " avt",
        " camera",
        " laboratory",
        " instrumentation control"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e1215292d629dabb6f1140636d18c6ec819f617b6caf2dccca07034945060b92",
                "md5": "86a24248310c67e4afba097bbe93af51",
                "sha256": "adf60ba20d052dc6bed764c3be91fdf33f6c0133e85fd6a0e2e293a58b3a179e"
            },
            "downloads": -1,
            "filename": "pysilico-0.21.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "86a24248310c67e4afba097bbe93af51",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 27808,
            "upload_time": "2024-06-28T14:24:34",
            "upload_time_iso_8601": "2024-06-28T14:24:34.687841Z",
            "url": "https://files.pythonhosted.org/packages/e1/21/5292d629dabb6f1140636d18c6ec819f617b6caf2dccca07034945060b92/pysilico-0.21.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aff88658b44a14d7fa1ab40d9d8d8c4613d982a87aec1304bdb1d5984f59e880",
                "md5": "5170c6556410c2db8ba6dd01a10706d0",
                "sha256": "e6f4447f6a97e796f64d3b57cd5f1350bae98b5842bb125b9c51bcb5d2c61b5d"
            },
            "downloads": -1,
            "filename": "pysilico-0.21.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5170c6556410c2db8ba6dd01a10706d0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 30160,
            "upload_time": "2024-06-28T14:24:36",
            "upload_time_iso_8601": "2024-06-28T14:24:36.546460Z",
            "url": "https://files.pythonhosted.org/packages/af/f8/8658b44a14d7fa1ab40d9d8d8c4613d982a87aec1304bdb1d5984f59e880/pysilico-0.21.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-28 14:24:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lbusoni",
    "github_project": "pysilico",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pysilico"
}
        
Elapsed time: 0.50187s