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

Uploaded Source

Built Distribution

spectran-0.3.2-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for spectran-0.3.2.tar.gz
Algorithm Hash digest
SHA256 d86201de14e6fb01eed86e43fa407c648f0bd31dd62b7b92ec504bbc1f6ff1d8
MD5 92fab10963b5521ed7f34768917c605c
BLAKE2b-256 04df2f44071b68bc2a6ae50237198e10b2bc1e72b659b1403ac1d6bbde0113fe

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for spectran-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f7ca3aa60d6ad3894a9eb8de16110d9353ee35f8003647af689bc4f16440aa18
MD5 ec7aa822898933ca13b05f3f0732296c
BLAKE2b-256 5d778286661bd4aa49eb4251116a83076c36a2224442f9adbeb61cfe0b766113

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