Skip to main content

This is a raw8 parser

Project description

phos

Phos is a user-friendly Python library for dealing with the parsing of spectrometry data and retrieve the spectral data and the metadata. Currently support only raw8 files.

Installation

Use the package manager pip to install Phos.

pip install phos

Basic Usage

To parse a raw8 file, initialize a Raw8Spectra instance passing the file directory.

from phos import Raw8Spectra

spectra = Raw8Spectra('input.raw8')

The Raw8Spectra instance has all the attributes of the raw8 file.

print(f'integration time: {spectra.integration_time}')
print(f'integration delay: {spectra.integration_delay}')
print(f'number of averages: {spectra.number_of_averages}')
print(f'start pixel: {spectra.start_pixel}')
print(f'stop pixel: {spectra.stop_pixel}')

You can plot the spectra using the list of wavelenghts and counts.

plt.plot(spectra.wavelenghts, spectra.counts)
plt.show()

You can get the spectra scan on a csv file or all the parameters of the experiment in a json file.

spectra.to_csv('test.csv')
spectra.to_json('test.json')

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

phos-0.0.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

phos-0.0.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file phos-0.0.1.tar.gz.

File metadata

  • Download URL: phos-0.0.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for phos-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d6c184033664d78dadcd26fea773e9ab0972043490c22d67921a3f6fb079ba6a
MD5 4a60911a52d3f5e45fcc79bde17fe77c
BLAKE2b-256 f25eb2ff27216cc82522acce8837e3355bbdaab2c6c88b6c0295ec8c898f24d7

See more details on using hashes here.

File details

Details for the file phos-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: phos-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for phos-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e8c629e73d77d7ec489152e0bda0ac13c21cc106d9d98471f8114b245feb538
MD5 166e4f836bec85d343d95f17e47b6524
BLAKE2b-256 ca5295bedd743f57fbca2e86b71009387d1bf5f5c4f53992f906cbf170fbe43b

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