torchMWRT.absorption_model#

Torch implementations of microwave absorption models.

This module ports pyrtlib absorption formulations to PyTorch so they can be evaluated on batched tensors and used in differentiable radiative-transfer workflows.

Classes

AbsModel(model, dtype, device, freqs[, amu])

Base class with shared absorption-model configuration.

H2OAbsModel(model, dtype, device, freqs[, amu])

Water-vapor absorption model family.

LiqAbsModel(model, dtype, device, freqs[, amu])

Liquid-water absorption model family.

N2AbsModel(model, dtype, device, freqs[, amu])

Nitrogen collision-induced absorption model family.

O2AbsModel(model, dtype, device, freqs[, amu])

Oxygen absorption model family.

O3AbsModel(model, dtype, device, freqs[, amu])

Ozone absorption model family.

Exceptions

AbsModelError(model, message)

Error raised for invalid absorption-model configuration.

exception torchMWRT.absorption_model.AbsModelError(model, message)[source]#

Bases: Exception

Error raised for invalid absorption-model configuration.

Parameters:
  • model (str) – Model identifier that triggered the error.

  • message (str) – Human-readable description of the issue.

class torchMWRT.absorption_model.AbsModel(model, dtype, device, freqs, amu=None)[source]#

Bases: object

Base class with shared absorption-model configuration.

Parameters:
  • model (str) – Absorption model identifier (for example "R24" or "MWL24").

  • dtype (torch.dtype) – Default dtype for internal constants.

  • device (torch.device or str) – Device for internal constants and line-list tensors.

  • freqs (torch.Tensor) – Frequency grid in GHz associated with this model instance.

  • amu (dict, optional) – Optional uncertainty/tuning parameter overrides.

class torchMWRT.absorption_model.LiqAbsModel(model, dtype, device, freqs, amu=None)[source]#

Bases: AbsModel

Liquid-water absorption model family.

liquid_water_absorption(water, freq, temp)[source]#

Compute absorption by suspended liquid water droplets in Np/km.

Parameters:
  • water (torch.Tensor) – Liquid water content in g/m^3 (mass of liquid water per volume of dry air).

  • freq (torch.Tensor) – Frequency in GHz.

  • temp (torch.Tensor) – Temperature in K.

Returns:

Liquid-water absorption in Np/km.

Return type:

torch.Tensor

Raises:

ValueError – If self.model is not implemented for liquid water absorption.

Notes

Model selection is consistent with pyrtlib: R03/R98 use the older double-Debye form, while newer models use _dilec12. In torchMWRT, non-positive water values are masked to zero with torch.where instead of scalar early return.

Revision history from the original Rosenkranz routine:

  • PWR 08/03/92 Original Version

  • PWR 12/14/98 Temp dependence of eps2 eliminated to agree with MPM93

  • PWR 06/05/15 Using dilec12 for complex dielectric constant

Provenance: the revision-history bullets and reference list are taken from the docstring of pyrtlib.absorption_model.LiqAbsModel.liquid_water_absorption.

References

class torchMWRT.absorption_model.N2AbsModel(model, dtype, device, freqs, amu=None)[source]#

Bases: AbsModel

Nitrogen collision-induced absorption model family.

n2_absorption_mwl24(t, p, f)[source]#

Evaluate the MWL24 \(N_2-N_2\) collision-induced absorption term.

Parameters:
  • t (torch.Tensor) – Air temperature in K.

  • p (torch.Tensor) – Dry-air pressure in mbar.

  • f (torch.Tensor) – Frequency in GHz.

Returns:

Pair-absorption coefficient in 1/cm.

Return type:

torch.Tensor

Notes

The implementation follows the MWL24 parametrization based on classical trajectory calculations and keeps pyrtlib constants. torchMWRT pre-stores polynomial coefficients as tensors to avoid repeated host allocations.

To convert to Np/km multiply by 1e5. To convert pair absorption to dry-air absorption, multiply by 0.84.

Provenance: the model description and conversion guidance are taken from the docstring of pyrtlib.absorption_model.N2AbsModel.n2_absorption_mwl24.

References

n2_absorption(t, p, f)[source]#

Compute nitrogen continuum absorption in Np/km.

Parameters:
  • t (torch.Tensor) – Temperature in K.

  • p (torch.Tensor) – Dry-air pressure in mbar.

  • f (torch.Tensor) – Frequency in GHz.

Returns:

Nitrogen continuum absorption in Np/km.

Return type:

torch.Tensor

Raises:

ValueError – If self.model is not implemented.

Notes

The factor n accounts for additional pair processes (\(O_2-O_2\) and \(O_2-N_2\)) for model families where that correction is prescribed. MWL24 uses n2_absorption_mwl24(); other models use the Rosenkranz-style empirical power law with optional high-frequency taper fdepen.

Provenance: the model intent and the Eq. 2.6 pointer in References are taken from the docstring of pyrtlib.absorption_model.N2AbsModel.n2_absorption.

References

class torchMWRT.absorption_model.H2OAbsModel(model, dtype, device, freqs, amu=None)[source]#

Bases: AbsModel

Water-vapor absorption model family.

h2o_continuum(frq, vx, nfreq)[source]#

Compute the MT-CKD-based self-continuum helper term.

Parameters:
  • frq (torch.Tensor) – Frequency in GHz.

  • vx (torch.Tensor) – Normalized temperature \(300/T\).

  • nfreq (int) – Kept for API compatibility with pyrtlib. The torch implementation is fully vectorized and does not need this value for iteration.

Returns:

Self-continuum coefficient in (1/cm)/mbar^2.

Return type:

torch.Tensor

Notes

The implementation uses a cubic interpolation over six tabulated nodes adapted from mt_ckd_h2o_module.f90 (MT-CKD 4.1 fit).

Provenance: this description is adapted from the docstring of pyrtlib.absorption_model.H2OAbsModel.h2o_continuum.

h2o_continuum_mwl24(frq, vx)[source]#

Compute the MWL24 water-vapor self-continuum parametrization.

Parameters:
  • frq (torch.Tensor) – Frequency in GHz.

  • vx (torch.Tensor) – Normalized temperature \(300/T\).

Returns:

Self-continuum coefficient scaled to (Np/km)/mbar^2.

Return type:

torch.Tensor

Notes

The model combines bound-dimer, metastable-dimer, and far-wing contributions. This helper already applies the 1e5 conversion used in pyrtlib, so callers should multiply only by pvap**2 to obtain the continuum absorption contribution in Np/km.

Provenance: the physical summary and reference selection are taken from the docstring of pyrtlib.absorption_model.H2OAbsModel.h2o_continuum_mwl24.

References

h2o_absorption(pdrykpa, vx, ekpa, frq, amu=None)[source]#

Compute water-vapor line and continuum absorption terms.

Parameters:
  • pdrykpa (torch.Tensor) – Dry-air pressure in kPa.

  • vx (torch.Tensor) – Normalized temperature \(300/T\).

  • ekpa (torch.Tensor) – Water-vapor partial pressure in kPa.

  • frq (torch.Tensor) – Frequency in GHz.

  • amu (dict, optional) – Optional parameter overrides. Expected entries have a .value attribute, matching the uncertainty workflow used in torchMWRT.

Returns:

(npp, ncpp) where npp is the line term and ncpp is the continuum term, both in ppm.

Return type:

tuple[torch.Tensor, torch.Tensor]

Notes

Inputs are broadcast with torch.broadcast_tensors and line-list coefficients are moved to input device/dtype before computation. Compared with pyrtlib’s scalar flow, torchMWRT avoids hard early returns for non-positive vapor density and instead masks outputs, preserving differentiability and shape consistency.

Provenance: the base description and primary reference are taken from the docstring of pyrtlib.absorption_model.H2OAbsModel.h2o_absorption. Additional torchMWRT notes document behavior changes in this port.

References

class torchMWRT.absorption_model.O2AbsModel(model, dtype, device, freqs, amu=None)[source]#

Bases: AbsModel

Oxygen absorption model family.

o2_absorption(pdrykpa, vx, ekpa, frq, amu=None)[source]#

Compute oxygen line and continuum absorption terms.

Parameters:
  • pdrykpa (torch.Tensor) – Dry-air pressure in kPa.

  • vx (torch.Tensor) – Normalized temperature \(300/T\).

  • ekpa (torch.Tensor) – Water-vapor partial pressure in kPa.

  • frq (torch.Tensor) – Frequency in GHz.

  • amu (dict, optional) – Optional parameter overrides with .value fields.

Returns:

(npp, ncpp) where npp is the oxygen line term and ncpp is the non-resonant continuum term, both in ppm.

Return type:

tuple[torch.Tensor, torch.Tensor]

Notes

This routine keeps the Rosenkranz lineage and later revisions used in pyrtlib, including line-mixing and line-shape updates across R03/R16/R17/R18/R19/R20/R22/R23/R24 families.

History (as documented in the original pyrtlib routine):

  • 5/1/95 P. Rosenkranz

  • 11/5/97 P. Rosenkranz - 1- line modification.

  • 12/16/98 pwr - updated submm freq’s and intensities from HITRAN96

  • 8/21/02 pwr - revised width at 425

  • 3/20/03 pwr - 1- line mixing and width revised

  • 9/29/04 pwr - new widths and mixing, using HITRAN intensities for all lines

  • 6/12/06 pwr - chg. T dependence of 1- line to 0.8

  • 10/14/08 pwr - moved isotope abundance back into intensities, added selected O16O18 lines.

  • 5/30/09 pwr - remove common block, add weak lines.

  • 12/18/14 pwr - adjust line broadening due to water vapor.

  • 9/29/18 pwr - 2nd-order line mixing

  • 8/20/19 pwr - adjust intensities according to Koshelev meas.

Line intensities follow HITRAN2004; non-resonant intensity follows JPL catalog values. For models where the continuum is folded into the line formulation (R19+ variants), ncpp is returned as zeros.

The mm line-width coefficients are from Tretyakov et al. (2005), Makarov et al. (2008), and Koshelev et al. (2016); submm line-widths are from Golubiatnikov and Krupnov, except the 234-GHz line width from Drouin. Mixing coefficients follow Makarov’s 2018 revision. The same temperature dependence (1/T)**X is used for submillimeter line widths as in the 60-GHz band.

Provenance: the full history block and detailed spectroscopy notes are taken from the docstring of pyrtlib.absorption_model.O2AbsModel.o2_absorption.

References

class torchMWRT.absorption_model.O3AbsModel(model, dtype, device, freqs, amu=None)[source]#

Bases: AbsModel

Ozone absorption model family.

o3_absorption(t, p, f, o3n, amu=None)[source]#

Compute ozone absorption from selected \(O_3\) rotational lines.

Parameters:
  • t (torch.Tensor) – Temperature in K.

  • p (torch.Tensor) – Total pressure in mbar.

  • f (torch.Tensor) – Frequency in GHz.

  • o3n (torch.Tensor) – Ozone number density in molecules/m^3.

  • amu (dict, optional) – Optional line-parameter overrides with .value fields.

Returns:

Ozone absorption coefficient in Np/km.

Return type:

torch.Tensor

Notes

Inputs are broadcast to a common shape. For R22/R22SD the routine evaluates a Doppler-Lorentz form through _dcerror; other models use the Lorentz/Voigt-width approximation retained from pyrtlib. For scalar frequency input, the calculation is limited to lines within +/-1 GHz around f; tensor frequency grids evaluate all lines.

Provenance: the functional description is adapted from the docstring of pyrtlib.absorption_model.O3AbsModel.o3_absorption.

References

[Boissoles et al., 2003]

J. Boissoles, C. Boulet, Robert H. Tipping, Alex Brown, and Q. Ma. Theoretical calculation of the translation-rotation collision-induced absorption in n2–n2, o2–o2, and n2–o2 pairs. Journal of Quantitative Spectroscopy and Radiative Transfer, 82(1–4):505–516, 2003. doi:10.1016/S0022-4073(03)00174-2.

[Borysow and Frommhold, 1986]

Aleksandra Borysow and Lothar Frommhold. Collision-induced rototranslational absorption spectra of n2–n2 pairs for temperatures from 50 to 300 k. The Astrophysical Journal, 311:1043–1057, 1986. doi:10.1086/164841.

[Drouin, 2007]

Brian J. Drouin. Temperature dependent pressure induced linewidths of ^16O_2 and ^18O^16O transitions in nitrogen, oxygen and air. Journal of Quantitative Spectroscopy and Radiative Transfer, 105(3):450–458, 2007. doi:10.1016/j.jqsrt.2006.12.001.

[Galanina et al., 2022] (1,2)

T. A. Galanina, A. O. Koroleva, A. A. Simonova, Alain Campargue, and M. Yu. Tretyakov. The water vapor self-continuum in the terahertz gap region (15–700 cm-1): experiment versus mt_ckd-3.5 model. Journal of Molecular Spectroscopy, 389:111691, 2022. doi:10.1016/j.jms.2022.111691.

[Golubiatnikov and Krupnov, 2003]

G. Yu. Golubiatnikov and A. F. Krupnov. Microwave study of the rotational spectrum of oxygen molecule in the range up to 1.12 thz. Journal of Molecular Spectroscopy, 217(2):282–287, 2003. doi:10.1016/S0022-2852(02)00058-9.

[Koshelev et al., 2017]

M. A. Koshelev, T. Delahaye, E. A. Serov, I. N. Vilkov, C. Boulet, and M. Yu. Tretyakov. Accurate modeling of the diagnostic 118-ghz oxygen line for remote sensing of the atmosphere. Journal of Quantitative Spectroscopy and Radiative Transfer, 196:78–86, 2017. doi:10.1016/j.jqsrt.2017.03.043.

[Koshelev et al., 2015]

M. A. Koshelev, I. N. Vilkov, and M. Yu. Tretyakov. Pressure broadening of oxygen fine-structure lines by water. Journal of Quantitative Spectroscopy and Radiative Transfer, 154:24–27, 2015. doi:10.1016/j.jqsrt.2014.11.019.

[Koshelev et al., 2016]

M. A. Koshelev, I. N. Vilkov, and M. Yu. Tretyakov. Collisional broadening of oxygen fine structure lines: the impact of temperature. Journal of Quantitative Spectroscopy and Radiative Transfer, 169:91–95, 2016. doi:10.1016/j.jqsrt.2015.09.018.

[Liebe et al., 1993]

Hans J. Liebe, George A. Hufford, and Michael G. Cotton. Propagation modeling of moist air and suspended water/ice particles at frequencies below 1000 ghz. In AGARD Conference Proceedings 542, 3.1–3.10. 1993.

[Liebe et al., 1991]

Hans J. Liebe, George A. Hufford, and Takeshi Manabe. A model for the complex permittivity of water at frequencies below 1 thz. International Journal of Infrared and Millimeter Waves, 12(7):659–675, 1991. doi:10.1007/BF01008897.

[Makarov et al., 2008]

D. S. Makarov, I. A. Koval, M. A. Koshelev, V. V. Parshin, and M. Yu. Tretyakov. Collisional parameters of the 118-ghz oxygen line: temperature dependence. Journal of Molecular Spectroscopy, 252:242–243, 2008. doi:10.1016/j.jms.2008.08.005.

[Makarov et al., 2011]

D. S. Makarov, M. Yu. Tretyakov, and Philip W. Rosenkranz. 60-ghz oxygen band: precise experimental profiles and extended absorption modeling in a wide temperature range. Journal of Quantitative Spectroscopy and Radiative Transfer, 112(9):1420–1428, 2011. doi:10.1016/j.jqsrt.2011.02.018.

[Makarov et al., 2020]

Dmitriy S. Makarov, Mikhail Yu. Tretyakov, and Philip W. Rosenkranz. Revision of the 60-ghz atmospheric oxygen absorption band models for practical use. Journal of Quantitative Spectroscopy and Radiative Transfer, 243:106798, 2020. doi:10.1016/j.jqsrt.2019.106798.

[Meshkov and De Lucia, 2007]

Andrey I. Meshkov and Frank C. De Lucia. Laboratory measurements of dry air atmospheric absorption with a millimeter wave cavity ringdown spectrometer. Journal of Quantitative Spectroscopy and Radiative Transfer, 108(2):256–276, 2007. doi:10.1016/j.jqsrt.2007.04.001.

[M{\"a}tzler et al., 2006]

Christian Mätzler, Philip W. Rosenkranz, Alessandro Battaglia, and Jean-Pierre Wigneron. Thermal Microwave Radiation – Applications for Remote Sensing. IET, 2006.

[Odintsova et al., 2022] (1,2)

T. A. Odintsova, A. O. Koroleva, A. A. Simonova, Alain Campargue, and M. Yu. Tretyakov. The atmospheric continuum in the terahertz gap region (15–700 cm-1): review of experiments at soleil synchrotron and modeling. Journal of Molecular Spectroscopy, 386:111603, 2022. doi:10.1016/j.jms.2022.111603.

[Rosenkranz, 1988]

Philip W. Rosenkranz. Interference coefficients for overlapping oxygen lines in air. Journal of Quantitative Spectroscopy and Radiative Transfer, 39(4):287–297, 1988. doi:10.1016/0022-4073(88)90004-0.

[Rosenkranz, 1993]

Philip W. Rosenkranz. Absorption of microwaves by atmospheric gases. In Michael A. Janssen, editor, Atmospheric Remote Sensing by Microwave Radiometry, pages 37–90. Wiley, New York, 1993. URL: http://hdl.handle.net/1721.1/68611.

[Rosenkranz, 2015]

Philip W. Rosenkranz. A model for the complex dielectric constant of supercooled liquid water at microwave frequencies. IEEE Transactions on Geoscience and Remote Sensing, 53(3):1387–1393, 2015. doi:10.1109/TGRS.2014.2339015.

[Rosenkranz, 2017]

Philip W. Rosenkranz. Line-by-line microwave radiative transfer (non-scattering). 2017. doi:10.21982/M81013.

[Serov et al., 2024]

E. A. Serov, T. A. Galanina, A. O. Koroleva, D. S. Makarov, I. S. Amerkhanov, M. A. Koshelev, M. Yu. Tretyakov, D. N. Chistikov, A. A. Finenko, and A. A. Vigasin. Continuum absorption in pure n2 gas and in its mixture with ar. Journal of Quantitative Spectroscopy and Radiative Transfer, 328:109172, 2024. doi:10.1016/j.jqsrt.2024.109172.

[Tretyakov et al., 2025] (1,2)

M. Yu. Tretyakov, T. A. Galanina, A. O. Koroleva, D. S. Makarov, D. N. Chistikov, A. A. Finenko, and A. A. Vigasin. Atmospheric water vapor continuum model for the sub-thz range. Journal of Quantitative Spectroscopy and Radiative Transfer, 333:109319, 2025. doi:10.1016/j.jqsrt.2024.109319.

[Tretyakov et al., 2004]

M. Yu. Tretyakov, G. Yu. Golubiatnikov, V. V. Parshin, M. A. Koshelev, S. E. Myasnikova, A. F. Krupnov, and Philip W. Rosenkranz. Experimental study of the line mixing coefficient for 118.75 ghz oxygen line. Journal of Molecular Spectroscopy, 223(1):31–38, 2004. doi:10.1016/j.jms.2003.09.008.

[Tretyakov et al., 2005]

M. Yu. Tretyakov, M. A. Koshelev, V. V. Parshin, D. S. Makarov, and Philip W. Rosenkranz. 60-ghz oxygen band: precise broadening and central frequencies of fine structure lines, absolute absorption profile at atmospheric pressure, revision of mixing coefficients. Journal of Molecular Spectroscopy, 231(1):1–14, 2005. doi:10.1016/j.jms.2004.11.011.