PyRTlib is a Python package, for non-scattering line-by-line microwave RT simulations. PyRTlib is a user-friendly tool for computing down and up-welling brightness temperatures and related quantities (e.g., atmospheric absorption, optical depth, opacity) in Python.
Plotting of nadir upwelling
Use pip package to install quicly the pyrtlib library. See installation instructions for more info on how instaling pyrtlib.
$ pip install pyrtlib
For examples of how to use pyrtlib see the examples gallery. Code can be downloaded both as python script or notebook file.
from pyrtlib.tb_spectrum import TbCloudRTE
from pyrtlib.climatology import AtmosphericProfiles as atmp
from pyrtlib.utils import mr2rh, ppmv2gkg
Atmospheric profile definition:
z, p, _, t, md = atmp.gl_atm(atmp.MIDLATITUDE_SUMMER)
Units conversion:
gkg = ppmv2gkg(md[:, atmp.H2O], atmp.H2O)
Relative humidity of
rh = mr2rh(p, t, gkg)[0] / 100
Deifinition of angles and frequencies:
ang = np.array([90.])
frq = np.arange(20, 1001, 1)
Initialize parameters for main execution:
rte = TbCloudRTE(z, p, t, rh, frq, ang)
Set absorption model:
rte.init_absmdl('R22SD')
Execute model by computing upwelling radiances:
df = rte.execute()
df.tbtotal
0 293.119811
1 292.538088
2 291.736672
3 291.913658
4 292.493971
...
976 230.179993
977 231.435965
978 232.592915
979 233.666322
980 234.667522
Name: tbtotal, Length: 981, dtype: float64
You can get started with PyRTlib by installing and executing the first radiative transfer calculation from the following Colab Notebook
Larosa, S., Cimini, D., Gallucci, D., Nilo, S. T., and Romano, F.: PyRTlib: an educational Python-based library for non-scattering atmospheric microwave radiative transfer computations, Geosci. Model Dev., 17, 2053–2076, https://doi.org/10.5194/gmd-17-2053-2024, 2024.
Larosa, S., Cimini, D., Gallucci, D., Nilo, S. T., & Romano, F. (2024). PyRTlib: a python package for non-scattering line-by-line microwave Radiative Transfer simulations. (Computer software). https://doi.org/10.5281/zenodo.8219145