scipy.constants.
nu2lambda#
- scipy.constants.nu2lambda(nu)[source]#
Convert optical frequency to wavelength.
- Parameters:
- nuarray_like
Optical frequency to be converted.
- Returns:
- lambdafloat or array of floats
Equivalent wavelength(s).
Notes
Computes
lambda = c / nuwhere c = 299792458.0, i.e., the (vacuum) speed of light in meters/second.Array API Standard Support
nu2lambdahas support for Python Array API Standard compatible backends in addition to NumPy. The following combinations of backend and device (or other capability) are supported.Library
CPU
GPU
NumPy
✅
n/a
CuPy
n/a
✅
PyTorch
✅
✅
JAX
✅
✅
Dask
✅
n/a
See Support for the array API standard for more information.
Examples
>>> from scipy.constants import nu2lambda, speed_of_light >>> import numpy as np >>> nu2lambda(np.array((1, speed_of_light))) array([ 2.99792458e+08, 1.00000000e+00])