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. (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

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.5.0.tar.gz (50.8 kB view details)

Uploaded Source

Built Distribution

spectran-0.5.0-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for spectran-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b5a85f4dccdc70fe9bbc8f264e7f3b07ab38fbff8be25e15fa3511204229d03d
MD5 a9b3bc1729702e9264e978d33599e05d
BLAKE2b-256 171abe79f223ab1661b9cc791d5c97c439cb23213828f441f6822ab2b9a2ca53

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spectran-0.5.0-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

Hashes for spectran-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f108fe0b84d4ade4fdd6db3d3e86ce6713c62a5173e948556c605a153e560ec
MD5 1bc41da5a56fd58696623519e7289d89
BLAKE2b-256 d5fc28e9e933bc85e82522ae4cfea2d785bcbcd19f9ad78d785abaac3e88473d

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