流明到坎德拉在线计算器和 Python 代码

TechOverflow calculators:
You can enter values with SI suffixes like 12.2m (equivalent to 0.012) or 14k (14000) or 32u (0.000032).
The results are calculated while you type and shown directly below the calculator, so there is no need to press return or click on a Calculate button.
lm
°

公式

$$\Omega_{sr} = 2\cdot\pi\cdot(1-\cos(\frac{\theta}{2}))$$

$$I_{v} = \frac{\Phi_v}{\Omega_{sr}}$$

其中:

Python 代码

你可以像这样使用 UliEngineering 库:

lumen_to_candela_example.py
from UliEngineering.Physics.Light import lumen_to_candela_by_apex_angle
from UliEngineering.EngineerIO import auto_format, auto_print

# 这些是等效的:
intensity = lumen_to_candela_by_apex_angle("25 lm", "120°") # intensity = 7.9577 (cd)
intensity = lumen_to_candela_by_apex_angle(25.0, 120.0) # intensity = 7.9577 (cd)

# ... 或获取人类可读的值:
intensity_str = auto_format(lumen_to_candela_by_apex_angle, "25 lm", "120°") # "7.96 cd"
# ... 或直接打印
auto_print(lumen_to_candela_by_apex_angle, "25 lm", "120°") # prints "7.96 cd"

如果你不能使用 UliEngineering,使用此 Python 函数:

lumen_to_candela_uli.py
import math

def lumen_to_candela_by_apex_angle(flux, angle):
    """
    从光通量计算发光强度,
    假设 <flux> 的通量均匀分布在
    顶角为 <angle> 的圆锥周围。

    关键字参数
    ------------------
    flux : 值、工程字符串或 NumPy 数组
        以勒克斯为单位的光通量。
    angle : 值、工程字符串或 NumPy 数组
        发射圆锥的顶角,以度为单位
        对于许多 LED,这是

    >>> lumen_to_candela_by_apex_angle(25., 120.)
    7.957747154594769
    """
    solid_angle = 2*math.pi*(1.-math.cos((angle*math.pi/180.)/2.0))
    return flux / solid_angle

# 用法示例
print(lumen_to_candela_by_apex_angle(25., 120.)) # 打印 7.957747154594769 (cd)

Check out similar posts by category: Calculators, Physics