https://github.com/taurusolson/emspectrum
A handy tool to handle frequencies and wavelengths of the electromagnetic spectrum
https://github.com/taurusolson/emspectrum
Last synced: 8 months ago
JSON representation
A handy tool to handle frequencies and wavelengths of the electromagnetic spectrum
- Host: GitHub
- URL: https://github.com/taurusolson/emspectrum
- Owner: TaurusOlson
- Created: 2011-07-03T17:37:37.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-10-31T13:20:34.000Z (over 14 years ago)
- Last Synced: 2025-10-03T17:57:52.270Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 164 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Electromagnetic Spectrum
EMSpectrum is a little script to handle frequencies and wavelengths values of
the electromagnetic spectrum. It is basically classes providing a few
convenient methods to
* determine in which part of the spectrum a given value is
* convert:
* wavelengths to frequencies
* frequencies to wavelengths
* units of magnitude
# EXAMPLE
* Instantiate an EMSpectrum object:
ems = EMSpectrum()
* Determine the frequency range of the infrared spectrum
>>> ems.infrared_rad.freq
>>> [300000000000.0, 100000000000000.0]
>>> ems.infrared_rad.freq_unit
>>> 'Hz'
* Convert the frequency range of the infrared spectrum in wavelength
>>> ems.infrared_rad.freq.to_wave()
>>> [3e-06, 0.001]
>>> ems.infrared_rad.wave_unit
>>> 'm'
# TODO
* Sort the ranges properly
* Write some tests
* Add dynamic methods
* Improve the documentation