Coder Social home page Coder Social logo

josephwkania / psrdada-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trasal/psrdada-python

0.0 0.0 0.0 460 KB

Python bindings to the PSRDada ringbuffer implementation

Home Page: https://trasal.github.io/psrdada-python/index.html

License: Other

Python 99.61% Makefile 0.39%

psrdada-python's Introduction

PSRDada Python

DOI

Python3 bindings to the ringbuffer implementation in PSRDada

It allows you to connect to a ringbuffer, read header info, and read/write ringbuffer pages as numpy arrays. I aim to be interoperable, and bug-for-bug compattible, with PSRDADA. It also supports reading multiple datasets from a ringbuffer for connecting to dada_dbevent.

This is a proof-of-concept implementation, only functions from PSRDADA immediately necessary for my project will be implemented. The code is inspired by the example code in the cython userguide

Error messages, together with a start-up and shutdown message, are written to the syslog. Depending on your OS, you can read those using:

 $ grep psrdada-python /var/log/syslog
 $ journalctl --since "10 minutes ago" | grep psrdada-python

Documentation

The documentation is available here See the two scripts in the examples directory, and the tests.

#!/usr/bin/env python3
import numpy as np
from psrdada import Reader

# Create a reader instace and connect to a running ringbuffer with key 'dada'
reader = Reader(0xdada)

# loop over the pages
for page in reader:
    # read the page as numpy array
    data = np.asarray(page)
    print(np.sum(data))

reader.disconnect()

Installation

clone the repository
git clone [email protected]:TRASAL/psrdada-python.git change into the top-level directory
cd psrdada-python
install the dependencies (in a virtual env) python -m venv env && . env/bin/activate && pip install -f requirements.txt build the package make && make test && make install

Dependencies

PSRDada, see their website:

  • PSRDada dada_db exectuable in the PATH for testing;

  • PSRDada header files needed for compilation, set CPATH or CFLAGS.

  • PSRDada library needed during runtime, set LD_LIBRARY_PATH

License

Copyright (c) 2018, Jisk Attema Apache Software License 2.0.

Contributing

All contributions are welcome! Please use the github issue tracker to get in touch.

Contributing authors so far:

  • Jisk Attema
  • Leon Oostrum
  • Liam Connor
  • Wael Farah

psrdada-python's People

Contributors

loostrum avatar wfarah 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.