200nm to 200μm water extinction coefficient model in Python
You can easily compute the water extinction coefficient and absorption length for any wavelength between 200 nm and 200 μm using UliEngineering’s Absorption module.
The underlying model is based on this 1973 paper:
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.
You can view it online at Optica Publishing Group.
How to install
Install UliEngineering using:
pip install -U UliEngineering
Example: Get the extinction coefficient for a custom wavelength
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}")
Example: Compute the length at which 99% of the light is absorbed
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="--")
Calculation Method
The Hale-Querry model uses tabulated data and linear interpolation to provide the extinction coefficient for water over a wide wavelength range. The absorption length is simply the reciprocal of the extinction coefficient.
HaleQuerryAbsorptionModel()(wavelength_nm)
returns the extinction coefficient in 1/m for a given wavelength in nanometers.absorption_length_from_extinction_coefficient(ext_coeff)
computes the absorption length (distance for 1/e attenuation) in meters.length_from_remaining_fraction(fraction, ext_coeff)
computes the length at which a given fraction of light remains.
See the UliEngineering documentation for more details.
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow