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

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

spectran-0.5.2.tar.gz (54.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spectran-0.5.2-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spectran-0.5.2.tar.gz
  • Upload date:
  • Size: 54.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for spectran-0.5.2.tar.gz
Algorithm Hash digest
SHA256 4a4c76885e2bc15feb0f604eababbfbb854033bc5debd17561bb40398677ee5e
MD5 a123083512d3f7567721ceba3c2a8811
BLAKE2b-256 16ef9d4aeacd8c622cf72afd980b8672bc67c1d9ec1db26b5b5ac553944d75a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectran-0.5.2.tar.gz:

Publisher: publish.yml on ullmannJan/spectran

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: spectran-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for spectran-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 546d52f66c37a53b11154cddacb2de38247e27bdb50af38edfd9c9c0f5d093ad
MD5 7f78febaf6e3f6e888d9d4870bbbb0f1
BLAKE2b-256 4cddd91e7b325a330cafca833f835702a8531ad1b5d769dba649ae3a750248c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectran-0.5.2-py3-none-any.whl:

Publisher: publish.yml on ullmannJan/spectran

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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