Skip to main content

An oscilloscope for python that just works™

Project description

Oscilloscope

An oscilloscope for python that just works™

Features

Simple to use

This

import random
from time import sleep

from oscilloscope import Osc

osc = Osc()


@osc.signal
def simple_random_signal(update):
    while True:
        update(random.random())
        sleep(0.1)


osc.start()

Gives you this

Parallel compute

Each osc.signal gets it's own process.

This

import random
from time import sleep

from oscilloscope import Osc


osc = Osc(nrows=2, ncols=3)


@osc.signal
def signal1(update):
    while True:
        update(random.random())
        sleep(0.1)


@osc.signal
def signal2(update):
    while True:
        update(random.random(), row=1, col=2)
        sleep(0.1)


osc.start()

Gives you this

P.S. Don't worry about race conditions, update() is atomic. (See zproc)

Dynamic axis scale

The Y-axis's scale is dynamic, meaning that the graph's y axis scales with your signal.

This

import random
from time import sleep

from oscilloscope import Osc


# adjust window_sec and intensity to improve visibility
osc = Osc(window_sec=10, intensity=1)


@osc.signal
def increasing_signal(update):
    delta = 1

    while True:
        update(random.randint(-delta, delta))
        delta += 5
        sleep(0.01)


osc.start()

Gives you this

Automatic normalization

This

import random
from time import sleep

from oscilloscope import Osc


# turn on normalization
osc = Osc(normalize=True)


@osc.signal
def increasing_signal(update):
    delta = 1

    while True:
        update(random.randint(-delta, delta))
        delta += 5
        sleep(0.01)


osc.start()

Gives you this

This was the same signal as the [earlier](#Automatic normalization) one, but it looks a lot like the simple example, because we turned on normalization!

The Y-axis will now show, % max-amplitude encountered at the time, not the raw value.

Install

pip install oscilloscope

Licence: MIT
Requires Python >= 3.6


Buy Me A Coffee

🐍🏕️

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oscilloscope-0.0.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

oscilloscope-0.0.2-py2.py3-none-any.whl (3.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file oscilloscope-0.0.2.tar.gz.

File metadata

  • Download URL: oscilloscope-0.0.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for oscilloscope-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a9932ca14615d377511e2a0a33dce786850e4ba03f2c3d264a0649aaa480fe5c
MD5 f9de3456f51a7d7c2a3e8ee04e079b8a
BLAKE2b-256 fa8b7c153dd4463966f450aebcce9e65816170885f84f601510131e645e628e8

See more details on using hashes here.

File details

Details for the file oscilloscope-0.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: oscilloscope-0.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for oscilloscope-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d04e3620b433b92c2b7ea31dd796bd7969aa27f95588e9c8d57a11e171956162
MD5 bc3e7e8bb1dfd288da85d407892f41f1
BLAKE2b-256 28d3229bba0388c799d0c00d1748368823f6f6177f6f7a815a0ea2236419bbc5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page