Metadata-Version: 2.4
Name: pydisort
Version: 1.6.0
Summary: Modern Python package for DISORT with support for parallel computation.
Author-email: Zoey Hu <zoey.zyhu@gmail.com>
License-Expression: GPL-3.0-or-later
Project-URL: Repository, https://github.com/zoeyzyhu/pydisort
Project-URL: Documentation, https://pydisort.readthedocs.io/
Project-URL: Issues, https://github.com/zoeyzyhu/pydisort/issues
Keywords: DISORT,radiative transfer,astrophysics,atmospheric science
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS :: MacOS X
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: torch>=2.7.0
Dynamic: license-file

<!-- Logo ------------------------------------------->
<p align="center">
  <img src="https://raw.githubusercontent.com/zoeyzyhu/pydisort/main/docs/img/logo_tr_git.png" alt="Pydisort" width="300">
</p>

<!-- Subtitle --------------------------------------->
<p align="center">
  <i align="center">Superpowered Radiative Transfer: Fast, Scalable, User-Friendly 🚀</i>
</p>

## <a id='about-pydisort'> About Pydisort </a>

A modern Python package for the DISORT (Discrete Ordinate Radiative Transfer) algorithm for high-performance, high-precision modeling of radiative scattering and absorption in layered media.

`pydisort` provides a high-level Python API to the well-tested C implementation of DISORT, originally developed in Fortran (Stamnes et al. 1988) and later ported to C as `cdisort` by Timothy E. Dowling, which is a critical component of `libRadTran`. To support Python integration, the C code was first encapsulated in C++ classes, which were then exposed to Python using `pybind11`. For efficient memory management and potential GPU acceleration, `pydisort` leverages `PyTorch` tensors, paving the way for future applications in machine learning and large-scale parallel computation.

The normal usage of pydisort is to create a `pydisort.DisortOptions` object first and then initialize the `pydisort.cpp.Disort` object with the `pydisort.DisortOptions` object by:

```python
>>> import torch
>>> from pydisort import DisortOptions, Disort
>>> op = DisortOptions().flags("onlyfl,lamber")
>>> op.ds().nlyr = 4
>>> op.ds().nstr = 4
>>> op.ds().nmom = 4
>>> op.ds().nphase = 4
>>> ds = Disort(op)
>>> tau = torch.tensor([0.1, 0.2, 0.3, 0.4]).unsqueeze(-1)
>>> flx = ds.forward(tau, fbeam=torch.tensor([3.14159]))
>>> flx
tensor([[[[0.0000, 3.1416],
        [0.0000, 2.8426],
        [0.0000, 2.3273],
        [0.0000, 1.7241],
        [0.0000, 1.1557]]]])
```

For a detailed documentation, please visit https://pydisort.readthedocs.io/.
