Giter Site home page Giter Site logo

dimitrisspacecode / pylablib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexshkarin/pylablib

0.0 0.0 0.0 2.45 MB

Python package for device control and experiment automation

Home Page: http://pylablib.readthedocs.io

License: GNU General Public License v3.0

Python 99.77% Cython 0.23%

pylablib's Introduction

Overview

PyLabLib aims to provide support for device control and experiment automation. It interfaces with lots of different of devices, including several different camera interfaces, translational stages, oscilloscopes, AWGs, sensors, and more. The interface is implemented in a natural way through Python objects, and is easy to understand. For example, here is a complete script which steps Thorlabs KDC101 stage by 10000 steps ten times, and each time grabs a frame with Andor iXon camera:

from pylablib.devices import Thorlabs, Andor  # import the device libraries
import numpy as np  # import numpy for saving

# connect to the devices
with Thorlabs.KinesisMotor("27000000") as stage, Andor.AndorSDK2Camera() as cam:
    # change some camera parameters
    cam.set_exposure(50E-3)
    cam.set_roi(0, 128, 0, 128, hbin=2, vbin=2)
    # start the stepping loop
    images = []
    for _ in range(10):
        stage.move_by(10000)  # initiate a move
        stage.wait_move()  # wait until it's done
        img = cam.snap()  # grab a single frame
        images.append(img)

np.array(images).astype("<u2").tofile("frames.bin")  # save frames as raw binary

The list of the devices is constantly expanding.

Additional utilities are added to simplify data acquisition, storage, and processing:

  • Simplified data processing utilities: convenient fitting, filtering, feature detection, FFT (mostly wrappers around NumPy and SciPy).
  • Universal multi-level dictionaries which are convenient for storing heterogeneous data and settings in human-readable format.
  • Assorted functions for dealing with file system (creating, moving and removing folders, zipping/unzipping, path normalization), network (simplified interface for client and server sockets), strings (conversion of various Python objects to and from string), and more.

The most recent version of the library is available on GitHub (https://github.com/AlexShkarin/pyLabLib), and the documentation can be found at https://pylablib.readthedocs.io/ .

Requirements

  • Python 3 (tested with 3.6+)
  • Most extensively tested with Windows 10 and 64-bit Python. Linux is, in principle, supported, but devices which require manufacturer-provided DLLs (mostly cameras) might, potentially, have problems.
  • Basic version only needs numpy, SciPy and pandas. Advanced device communication packages (such as PyVISA and pySerial) are automatically installed, but can be avoided if necessary.
  • Some devices might require additional software. If this is the case, the requirements are mentioned on the corresponding page.

Installation

You can install the library from PyPi:

pip install pylablib

More options are described in the documentation.

Related projects

Pylablib cam-control - software for universal camera control and frames acquisition.

pylablib's People

Contributors

alexshkarin avatar dimitrisspacecode avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.