Python 中的 200nm 到 200μm 水消光系数模型

你可以使用 UliEngineering 的 Absorption 模块轻松计算 200 nm 到 200 μm 之间任何波长的水消光系数和吸收长度。

底层模型基于这篇 1973 年的论文:

hale_querry_citation.txt
Hale, George M., and Marvin R. Querry. "Optical constants of water in the 200-nm to 200-μ m wavelength region." Applied optics 12.3 (1973): 555-563.

你可以在 Optica Publishing Group 在线查看。

首先,安装 UliEngineering

示例:获取自定义波长的消光系数

extinction_coefficient_example.py
from UliEngineering.Chemistry.Absorption import HaleQuerryAbsorptionModel
from UliEngineering.EngineerIO import EngineerIO

wavelength_nm = 1500  # nm
model = HaleQuerryAbsorptionModel()
ext_coeff = model(wavelength_nm)
formatted = EngineerIO.instance().format(ext_coeff, unit="1/m")
print(f"Extinction coefficient at {wavelength_nm} nm: {formatted}")

示例:计算 99% 光被吸收的长度

plot_absorption.py
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
from UliEngineering.Chemistry.Absorption import HaleQuerryAbsorptionModel, absorption_length_from_absorption_coefficient
from UliEngineering.EngineerIO import format_value

plt.style.use("ggplot")
model = HaleQuerryAbsorptionModel()
wavelengths = [d.wavelength for d in model.datapoints]  # 单位 nm
abs_coeffs = [d.absorption_coefficient for d in model.datapoints]
abs_lengths = [absorption_length_from_absorption_coefficient(ac) for ac in abs_coeffs]

fig, ax1 = plt.subplots(figsize=(12, 5))
color1 = "tab:blue"
color2 = "tab:red"

ax1.set_xlabel("Wavelength (nm)")
ax1.set_ylabel("Absorption coefficient (1/m)", color=color1)
ax1.loglog(wavelengths, abs_coeffs, marker="o", linestyle="-", color=color1, label="Extinction coefficient")
ax1.tick_params(axis="y", labelcolor=color1)
ax1.yaxis.set_minor_locator(plt.NullLocator())  # 隐藏次要 y 刻度
ax1.xaxis.set_major_formatter(FuncFormatter(lambda x, p: format_value(x, "m")))

ax2 = ax1.twinx()
ax2.set_ylabel("Absorption length (m)", color=color2)
ax2.loglog(wavelengths, abs_lengths, marker="s", linestyle="--", color=color2, label="Absorption length (1/e)")
ax2.tick_params(axis="y", labelcolor=color2)
ax2.yaxis.set_minor_locator(plt.NullLocator())  # 隐藏次要 y 刻度
ax2.yaxis.set_major_formatter(FuncFormatter(lambda x, p: format_value(x, "m")))
ax2.xaxis.set_major_formatter(FuncFormatter(lambda x, p: format_value(x, "m")))

plt.title("Hale-Querry Water Extinction Coefficient and Absorption Length")
fig.tight_layout()
plt.grid(True, which="both", ls="--")

HaleQuerryAbsorptionModel.svg

计算方法

Hale-Querry 模型使用表格数据和线性插值在宽波长范围内提供水的消光系数。吸收长度只是消光系数的倒数。

有关更多详细信息,请参阅 UliEngineering 文档


Check out similar posts by category: Python, Physics, Chemistry