{ } Raw JSON

bundles / scipy 1.18.0 / scipy / constants / _constants / nu2lambda

function

scipy.constants._constants:nu2lambda

source: /scipy/constants/_constants.py:340

Signature

def nu2lambda(nu: npt.ArrayLike) → Any

Summary

Convert optical frequency to wavelength.

Parameters

nu : array_like

Optical frequency to be converted.

Returns

lambda : float or array of floats

Equivalent wavelength(s).

Notes

Computes lambda = c / nu where c = 299792458.0, i.e., the (vacuum) speed of light in meters/second.

Array API Standard Support

nu2lambda has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable SCIPY_ARRAY_API=1 and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. 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 dev-arrayapi for more information.

Examples

from scipy.constants import nu2lambda, speed_of_light
import numpy as np
✓
nu2lambda(np.array((1, speed_of_light)))
✗
array([3.e+08, 1.e+00])

Aliases

  • scipy.constants.nu2lambda