L iK) dZddlZddlmZmZddlmZerddl mZ ddl m Z m Z mZ gdZej Zdej"dzd z xZZd Zd Zd Zd ZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)d Z*d!Z+d"Z,d#Z-d$Z.d%Z/d&Z0d'Z1d d(zZ2d d)zZ3ed*xZ4Z5ed+Z6ed,Z7ed-xZ8Z9ed.Z:ed/xZ;Z<ed0Z=ed1xZ>Z?ed2xZ@ZAed3xZBZCed4xZDZEed5xZFZGed6xZHZIed7ZJed8ZKdZLdZMd9ZNd:eNzxZOZPePe=zd;z xZQZReQdePzZVd?ePzZWd@ePzZXdAeNzZYd)FgqىEgyCxDgPKDgNgmCg4&k CgmBgeAg.Ag@@gY@g$@g?g{Gz?gMbP?gư>g& .>g-q=gV瞯i&gh㈵>valz npt.ArrayLike old_scale new_scalereturnc<t|}t||d}|jdvr |tz}nd|jdvr|}nO|jdvr|dz dzdz tz}n*|jd vr |dzdz }nt d |d |jdvr |tz }|S|jdvr|}|S|jdvr|tz dzdz dz}|S|jd vr |dzdz }|St d |d )a] Convert from a temperature scale to another one among Celsius, Kelvin, Fahrenheit, and Rankine scales. Parameters ---------- val : array_like Value(s) of the temperature(s) to be converted expressed in the original scale. old_scale : str Specifies as a string the original scale from which the temperature value(s) will be converted. Supported scales are Celsius ('Celsius', 'celsius', 'C' or 'c'), Kelvin ('Kelvin', 'kelvin', 'K', 'k'), Fahrenheit ('Fahrenheit', 'fahrenheit', 'F' or 'f'), and Rankine ('Rankine', 'rankine', 'R', 'r'). new_scale : str Specifies as a string the new scale to which the temperature value(s) will be converted. Supported scales are Celsius ('Celsius', 'celsius', 'C' or 'c'), Kelvin ('Kelvin', 'kelvin', 'K', 'k'), Fahrenheit ('Fahrenheit', 'fahrenheit', 'F' or 'f'), and Rankine ('Rankine', 'rankine', 'R', 'r'). Returns ------- res : float or array of floats Value(s) of the converted temperature(s) expressed in the new scale. Notes ----- .. versionadded:: 0.18.0 Examples -------- >>> from scipy.constants import convert_temperature >>> import numpy as np >>> convert_temperature(np.array([-40, 40]), 'Celsius', 'Kelvin') array([ 233.15, 313.15]) Txpsubok)celsiusr()kelvinrZ) fahrenheitf r )rankinerz old_scale=zN is unsupported: supported scales are Celsius, Kelvin, Fahrenheit, and Rankinez new_scale=zV is unsupported: supported scales are 'Celsius', 'Kelvin', 'Fahrenheit', and 'Rankine')rrlowerrNotImplementedError)rrrr_valtemporess `/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/scipy/constants/_constants.pyr.r.sgZ  B CBd +D,,|#  o -  1 1a!#l2  . .q1 !ZYL1-#-. .,,l" J  o - J  1 1|#q(1,r1 J  . .ai!m J "ZYL1A#AB Blambda_cBt|}tt||dz S)aL Convert wavelength to optical frequency Parameters ---------- lambda_ : array_like Wavelength(s) to be converted. Returns ------- nu : float or array of floats Equivalent optical frequency. Notes ----- Computes ``nu = c / lambda`` where c = 299792458.0, i.e., the (vacuum) speed of light in meters/second. Examples -------- >>> from scipy.constants import lambda2nu, speed_of_light >>> import numpy as np >>> lambda2nu(np.array((1, speed_of_light))) array([ 2.99792458e+08, 1.00000000e+00]) Trrr(r)rrs rrara4s"8  !B xBd3 33rnucBt|}tt||dz S)aL 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. 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]) Trr)rrs rr|r|Ts"8  B xr. ..r)__doc__math_mathtypingrr_codatar_cd numpy.typingnptscipy._lib._array_apirrr __all__rsqrtrMrNrrrrr=rrrLrnr]rUr3r0r-rtrpryrr?r"rrrrr\rmrKrrr>rrr(rrxr;rRrrSrrQrFr6r:rrJrrArr rZr rrrrrProrOrbrr'rrr~r}rrgrrrr,rhr8rjrrir{rkrr!r1rrrrrurWr/rrrrYrErrsrrrrrrrzr@rrqr#rrdrrr r$rrvrrTrrfrerGrHrBrCr&r%rIrDr_rwrlrr`rr2r7r9r)r+r*r<rr r rrXrVr4r5rcrr[r^strr.rar|rrrsW%!LL# N XXZUZZ]*a//                              "u"u344N %& . / " ##F $% !DEE*+/00+,,L677())h())I:;; 67  !    E\U F""v by RZU U  %< 5L 5[ *_ /**m &&k((l2333a+ cb[ b[   F{4i3w Sysl  Dy4x d{ Tk BYU [     '' 1_ f,--j Cit ai4$;  tQw47]"(3. nI~f  s" Dj Tk~t '&]*    " "Z /$ 6((:5<<f *u$q((ZdAIkn I III II^44344>///c//r