Skip to main content

A tool to measure pictures with scale_bars

Project description

Spectran

Spectran Logo

A simple spectrum analyzer. Read a voltage signal and perform a spectral analysis.

grafik

Usage

Installation and Execution

Install via

pip install spectran

Run via

import spectran
spectran.run()

or in terminal

python -m spectran

Workflow

  1. First, select driver and device and click connect. This connects the device.
  2. Then, select all other options like sample_rate, input_channel, etc.
  3. Finally, start the measurement by clicking on Start Measurement.

API Connection

It is possible to remotely control most of Spectran's features via an API. API key can be set with the environment variable API_KEY. Default host is 127.0.0.1 on port 8111.

A detailed example can be found in this example.

First, the connection to the API has to be set up (you might have to input your api key):

api = API_Connection()

Afterwards one can set up devices and measurements:

api.connect_device("DummyDAQ", 'Dev1')

CONFIG = {
    "input_channel": "ai0",
    "sample_rate": 50_000 * ureg.Hz,
    "duration": 0.05 * ureg.second,
    "averages": 4,
    "signal_range_min": -3 * ureg.volt, 
    "signal_range_max":  3 * ureg.volt,
    "unit": "Volt",
}
api.set_config(CONFIG)    

# start the measurement
api.start_measurement()
# this waits for the measurement to finish
api.wait_for_measurement()
# this saves the data to a file
api.save_file(f"data.txt")

Development

Spectran is written to provide extensive possibilities for extension. Just extend the spectran.daq.DAQ class for a new driver and implement all necessary functions.

Install module into environment

pip install -e .[dev]

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

spectran-0.4.1.tar.gz (47.6 kB view details)

Uploaded Source

Built Distribution

spectran-0.4.1-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

Details for the file spectran-0.4.1.tar.gz.

File metadata

  • Download URL: spectran-0.4.1.tar.gz
  • Upload date:
  • Size: 47.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for spectran-0.4.1.tar.gz
Algorithm Hash digest
SHA256 0678fb9a20057ee1a82da9794b112b3e16c415d8477542f277196787a413ef8d
MD5 0530fc28ebc321093f1870ff8963813a
BLAKE2b-256 59902f58c5d2f412e62e0f638c7ec037ed5ec695c0b6890bc974d5a19319ef24

See more details on using hashes here.

File details

Details for the file spectran-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: spectran-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 32.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for spectran-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b2a9077124a89937a915ca6a9cb2a77fbbac21f01e17dbf36aa08f2541456618
MD5 9eac8d0cd393de75f7ff0227a420d0e7
BLAKE2b-256 3f184c9d9170fe5e8fed10fc0a5720a307f7e73a8ff1feca5d581c4fcfb334d5

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