windwhisper.atmospheric_absorption ================================== .. py:module:: windwhisper.atmospheric_absorption .. autoapi-nested-parse:: This module contains functions to calculate the atmospheric absorption of sound. Functions --------- .. autoapisummary:: windwhisper.atmospheric_absorption.load_atmospheric_absorption_coefficients windwhisper.atmospheric_absorption.compute_weighted_absorption windwhisper.atmospheric_absorption.get_absorption_coefficient Module Contents --------------- .. py:function:: load_atmospheric_absorption_coefficients() Load atmospheric absorption coefficients from disk. :returns: Nested mapping keyed by temperature and relative humidity with absorption coefficients per frequency band. :rtype: dict .. py:function:: compute_weighted_absorption(absorption_coefficients) Compute a weighted atmospheric absorption coefficient. :param absorption_coefficients: Absorption coefficients in dB/km keyed by third-octave band centre frequency. :type absorption_coefficients: dict[str, float] :returns: Weighted absorption coefficient in dB/km. :rtype: float .. py:function:: get_absorption_coefficient(temperature=20, humidity=70) Return the weighted absorption coefficient for the given conditions. :param temperature: Air temperature in degrees Celsius. :type temperature: float :param humidity: Relative humidity expressed as a percentage. :type humidity: float :returns: Weighted absorption coefficient in dB/km. :rtype: float :raises ValueError: If the requested temperature or humidity is not available in the coefficient table.