/Elemental

A small program for converting atomic spectra to audible sound.

Primary LanguagePythonMIT LicenseMIT

Elemental

A small program for converting atomic spectra to the audible spectrum.

There are two options for creating sounds from atomic spectra. One is using experimental data, which takes in the observed wavelengths of different spectroscopies. The other is using the Rydeberg formula, but which is limited to just the Hydrogen spectrum.

Sound of the Elements

Description

The wavelengths are generated by taking the wavelengths of the spectra wl, and converting them to the Hertz by

spectra = 1 / wl * convertion_factor

where typically convertion_factor=100.

The spectra is then used to build the output sound, by summing over all sine waves for each of the spectra,

sound = sum(sin(2 * pi * frequency * spectra * time))

the sampling rate is included in the time resolution,

N_length = N_seconds * sampling_rate

Installation

$ pip install .

Install in dev mode

$ pip install -e ".[dev]"

The quotes are included in case you are using zsh.

Downloading spectra

Download atomic spectra using

$ python spectra_retriever path/to/spectra/output/folder

Usage

Use elemental --help or rydeberg --help to view run commands.

Example using elementa

$ elemental U -lf spectra/U.dat -ln 20

Example using rydeberg

$ rydeberg 4

-lf spectra/H.dat gets the Hydrogen spectrum from a local file. -p enables parallel processing with a default of 4 cores. -ln 5 makes the recording 5 seconds long.

Testing

Run pytest to unit test code base.