Socket
Book a DemoInstallSign in
Socket

pydisort

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pydisort

Modern Python package for DISORT with support for parallel computation.

pipPyPI
Version
1.3.1
Maintainers
2

Pydisort

Superpowered Radiative Transfer: Fast, Scalable, User-Friendly 🚀

About Pydisort

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:

>>> 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/.

Keywords

DISORT

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts