A project for reading spectra from Avantes AvaSoft files in python
Project description
AvaRead
A project for reading spectra from Avantes AvaSoft 8 files in Python.
It supports all Avantes multichannel files (e.g. .raw8, .rir8, etc.), reading all avaible channels, as well as store-to-RAM/multiframe files (.str8).
Importantly, this means you can work with these files directly in your analysis!
-
No need to convert your
.raw8(or equivalent files) to work with them -
No need to convert your
.str8into large sets of files with very similar names!
Installing
AvaRead can be easily installed with pip and only has numpy as a dependency, which will be installed if missing.
You can install the latest release from PyPI:
pip install avaread
To install the latest development version from GitHub, you can use:
pip install git+https://github.com/AntoineTUE/avaread.git
How to use
Using avaread is fairly straightforward, you should be fine with using the read_file function to open any Avantes AvaSoft 8 file.
Depending on the detected file type, you will either receive an instance of AVSFile or STRFile, which are iterable, container-like objects that give you access to the data and metadata read from the file.
Most of the data is stored as numpy.ndarrays under the hood.
Note that these files store data differently:
AVSFilestores data from multiple devices (or channels), one spectrum per device, which can be of different shape.STRFilestores multiple spectra recorded in sequence by a single device (or channel).
See also the documentation for more details and examples.
import avaread
from avaread.reader import AVSFile, STRFile
from pathlib import Path
import matplotlib.pyplot as plt
file1 = Path("path/to/file1.raw8")
file2 = Path("path/to/file2.str8")
data1 = avaread.read_file(file1)
data2 = avaread.read_file(file2)
assert isinstance(data1, AVSFile)
assert isinstance(data2, STRFile)
plt.figure()
# Plot the different channels stored in the `AVSFile`
for channel in data1:
plt.plot(channel.wavelength, channel.signal, label=f"{channel.ID.SerialNumber}")
plt.figure()
# Plot the different frames stored in the `STRFile`
for i, frame in enumerate(data2):
plt.plot(data2.wavelength, frame, label=f"Delay: {data2.delay[i]} ms")
License
AvaRead is licensed under the MIT license.
See LICENSE.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file avaread-0.2.0.tar.gz.
File metadata
- Download URL: avaread-0.2.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b49d4ceeae9508760120e4c1789288edb7bde7aa2cd21068ae56aadd47240ded
|
|
| MD5 |
a7e8e2ebcbfd09c00170bb9089a81fb3
|
|
| BLAKE2b-256 |
737e3c790a53874875629b3513b3d2543a146df0ca5091a1aa45fcb3f5a8440b
|
Provenance
The following attestation bundles were made for avaread-0.2.0.tar.gz:
Publisher:
build.yml on AntoineTUE/avaread
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
avaread-0.2.0.tar.gz -
Subject digest:
b49d4ceeae9508760120e4c1789288edb7bde7aa2cd21068ae56aadd47240ded - Sigstore transparency entry: 777808404
- Sigstore integration time:
-
Permalink:
AntoineTUE/avaread@bd8ac82a54e6bc49d6f20e2070b982160ae9e720 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/AntoineTUE
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@bd8ac82a54e6bc49d6f20e2070b982160ae9e720 -
Trigger Event:
push
-
Statement type:
File details
Details for the file avaread-0.2.0-py3-none-any.whl.
File metadata
- Download URL: avaread-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af50e3bcc4c05744147a3511d9eb2e71dc0e9bedc666d239f1ccd17925ce4952
|
|
| MD5 |
ad669722d80cc44ef579a4055daf6f17
|
|
| BLAKE2b-256 |
feac270db503e6f1a1675f9b864c1c04952bfd2f0ba9386ad0f18b9b9984c10d
|
Provenance
The following attestation bundles were made for avaread-0.2.0-py3-none-any.whl:
Publisher:
build.yml on AntoineTUE/avaread
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
avaread-0.2.0-py3-none-any.whl -
Subject digest:
af50e3bcc4c05744147a3511d9eb2e71dc0e9bedc666d239f1ccd17925ce4952 - Sigstore transparency entry: 777808406
- Sigstore integration time:
-
Permalink:
AntoineTUE/avaread@bd8ac82a54e6bc49d6f20e2070b982160ae9e720 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/AntoineTUE
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@bd8ac82a54e6bc49d6f20e2070b982160ae9e720 -
Trigger Event:
push
-
Statement type: