Modèle du coefficient d'extinction de l'eau de 200nm à 200μm en Python

Vous pouvez facilement calculer le coefficient d’extinction de l’eau et la longueur d’absorption pour toute longueur d’onde entre 200 nm et 200 μm en utilisant le module Absorption d’UliEngineering.

Le modèle sous-jacent est basé sur cet article de 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.

Vous pouvez le consulter en ligne sur Optica Publishing Group.

D’abord, installez UliEngineering.

Exemple : Obtenir le coefficient d’extinction pour une longueur d’onde personnalisée

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}")

Exemple : Calculer la longueur à laquelle 99% de la lumière est absorbée

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]  # in 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())  # Hide minor y ticks
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())  # Hide minor y ticks
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

Méthode de calcul

Le modèle Hale-Querry utilise des données tabulées et une interpolation linéaire pour fournir le coefficient d’extinction de l’eau sur une large plage de longueurs d’onde. La longueur d’absorption est simplement l’inverse du coefficient d’extinction.

Voir la documentation UliEngineering pour plus de détails.


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