A tool to measure pictures with scale_bars
Project description
Spectran
A simple spectrum analyzer. Read a voltage signal and perform a spectral analysis.
Usage
Installation and Execution
Install via
pip install spectran
Run via
import spectran
spectran.run()
or in terminal
python -m spectran
Workflow
- First, select driver and device and click connect. This connects the device.
- Then, select all other options like sample_rate, input_channel, etc.
- 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
. (host should be 0.0.0.0
to access from other network devices)
You can check your connection by typing in a browser
http://<host>:<port>
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
Install module into environment
pip install -e .[dev]
Extensibility
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.
Then add this class to list of drivers in spectran.daq.__init__
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
Built Distribution
File details
Details for the file spectran-0.5.1.tar.gz
.
File metadata
- Download URL: spectran-0.5.1.tar.gz
- Upload date:
- Size: 51.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1404b57eb66000c1ad13d0112b2ecfba8c73c5f47e0015bee2374ecfd64a740f |
|
MD5 | ea2902df3fd54969e1afdd5dcb29daba |
|
BLAKE2b-256 | 6f0296c5f97d361117aa0c03f53ef89c17c5554eaa77d383cdbc051ae02bc283 |
File details
Details for the file spectran-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: spectran-0.5.1-py3-none-any.whl
- Upload date:
- Size: 36.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3461cbc55b1fb2d357502958b5ff3ccc1d900c5f75ca48b804344c6ab99eef88 |
|
MD5 | f21abe2a29d4b85bda9ac05b5856fd32 |
|
BLAKE2b-256 | cdf788cda12673514a9d67bd5b475d87ebfa9efbb322f8e3b2eaa98c0e4c6741 |