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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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