Learn R Programming

photobiology (version 0.11.3)

wl2wavenumber: Wavelength conversions

Description

Convert wavelength (nm) into wave number, frequency (Hz) or energy per photon (J, or eV) and back.

Usage

wl2wavenumber(w.length, unit.exponent = 0)

wavenumber2wl(wavenumber, unit.exponent = 0)

wl2frequency(w.length, unit.exponent = 0)

frequency2wl(frequency, unit.exponent = 0)

wl2energy(w.length, unit.exponent = 0, unit = "joule")

energy2wl(photon.energy, unit.exponent = 0, unit = "joule")

Arguments

w.length

numeric wavelength (nm)

unit.exponent

integer Exponent of the scale multiplier implicit in result, e.g., use 3 for kJ.

wavenumber

numeric Wave number in waves per metre, possibly with a scale factor according to unit.exponent.

frequency

numeric Frequency in Hz, possibly with the scale factor according to unit.exponent.

unit

character One of "joule" or "eV".

photon.energy

numeric Energy of one photon in joule or eV, possibly with a scale factor according to unit.exponent.

Details

These functions always expect as input and return wavelengths expressed in nanometres (nm) as all other functions in the R for photobiology suite of packages. Conversions depend on Plank's constant, h, the speed of light in vacuum, c, and Avogadro's number, \(N_A\). The values used for these constants have at least nine significant digits.

Examples

Run this code

wl2wavenumber(600) # wavelength in nm -> wave number
wavenumber2wl(1666666.66) # wave number -> wavelength in nm
wl2frequency(600) # wavelength in nm -> wave frequency (Hz)
frequency2wl(499654096666667) # wave frequency (Hz) -> wavelength in nm
wl2energy(600) # wavelength in nm -> energy of one photon (J)
wl2energy(600, unit = "eV") # wavelength in nm -> energy of one photon (eV)
wl2energy(600,
          unit.exponent = -3,
          unit = "eV")  # wavelength in nm -> energy of one photon (meV)
energy2wl(2066.40330,
          unit.exponent = -3,
          unit = "eV")  # energy of one photon (meV) -> wavelength (nm)

Run the code above in your browser using DataLab