Skip to main content

Python bindings for the CDISORT radiative transfer solver

Project description

nanodisort

PyPI version GitHub Workflow Status (branch) Documentation Status uv ruff

Python bindings for CDISORT, a C implementation of the DISORT (Discrete Ordinates Radiative Transfer) solver.

Overview

DISORT is a widely-used radiative transfer solver for plane-parallel atmospheres. It uses the discrete ordinates method to solve the radiative transfer equation with support for:

  • Multiple scattering
  • Absorption and emission
  • Thermal emission (Planck function)
  • Various boundary conditions
  • Pseudo-spherical geometry for direct beam

The CDISORT library offers improved performance over the original Fortran version through dynamic memory allocation and full double precision arithmetic.

Installation

pip install nanodisort

Prerequisites:

  • Supported platforms: Linux, macOS
  • Python 3.9 to 3.13
  • NumPy 1.20 or later

Quickstart

Single Rayleigh-scattering layer illuminated by a solar beam at 60° zenith:

import numpy as np
import nanodisort as nd
from nanodisort.utils import phase_functions as pf

# Configure dimensions and allocate
ds = nd.DisortState()
ds.nstr = 16  # number of streams
ds.nlyr = 1   # number of layers
ds.nmom = 16  # phase function moments (>= nstr)
ds.ntau = 2   # output optical depth levels
ds.numu = 6   # output polar angles
ds.nphi = 1   # output azimuthal angles
ds.allocate()

# Flags
ds.usrtau = True            # user-specified output levels
ds.usrang = True            # user-specified viewing angles
ds.lamber = True            # Lambertian lower boundary
ds.quiet = True             # suppress C-level output
ds.intensity_correction = True  # Nakajima-Tanaka correction

# Optical properties
ds.dtauc = np.array([0.1])          # extinction optical thickness
ds.ssalb = np.array([1.0])          # single-scattering albedo (pure scattering)
ds.pmom = pf.rayleigh(ds.nmom).reshape(-1, 1)  # Rayleigh phase function moments

# Output levels and viewing angles
ds.utau = np.array([0.0, 0.1])                    # TOA and surface
ds.umu = np.array([-1.0, -0.5, -0.1, 0.1, 0.5, 1.0])  # cosines of polar angles
ds.phi = np.array([0.0])                           # azimuthal angle [degrees]

# Boundary conditions
ds.fbeam = np.pi  # solar irradiance [W/m²]
ds.umu0 = 0.5     # cosine of solar zenith angle (60°)
ds.phi0 = 0.0     # solar azimuth [degrees]
ds.albedo = 0.0   # black surface
ds.fisot = 0.0    # no diffuse illumination from above

# Solve
ds.solve()

# Fluxes at each output level: shape (ntau,)
print(ds.rfldir)  # direct-beam downward irradiance
print(ds.rfldn)   # diffuse downward irradiance
print(ds.flup)    # diffuse upward irradiance

# Radiance field: shape (numu, ntau, nphi)
print(ds.uu.shape)

License

This project is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later), consistent with the CDISORT library it wraps.

Acknowledgements

nanodisort authors are grateful to the developers of the many implementations of DISORT, and, in particular, to

  • Timothy E. Dowling (original CDISORT C translation);
  • Robert Buras (phase function extensions);
  • Arve Kylling (pseudo-spherical approximation, testing);
  • the original DISORT Fortran authors (Knuth Stamnes, Si-Chee Tsay, Warren Wiscombe and Kolf Jayaweera).

Citation

If you use nanodisort in your research, please cite the CDISORT paper and the nanodisort repository:

@software{Leroy_nanodisort,
    author = {Leroy, Vincent and Emde, Claudia},
    license = {GPL-3.0-or-later},
    title = {{nanodisort}},
    url = {https://github.com/eradiate/nanodisort},
    version = {0.1.0}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nanodisort-0.2.0.tar.gz (378.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nanodisort-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (225.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

nanodisort-0.2.0-cp313-cp313-macosx_11_0_arm64.whl (211.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

nanodisort-0.2.0-cp313-cp313-macosx_10_13_x86_64.whl (225.2 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

nanodisort-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (225.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

nanodisort-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (211.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

nanodisort-0.2.0-cp312-cp312-macosx_10_13_x86_64.whl (225.3 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

nanodisort-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (227.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

nanodisort-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (212.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

nanodisort-0.2.0-cp311-cp311-macosx_10_13_x86_64.whl (226.0 kB view details)

Uploaded CPython 3.11macOS 10.13+ x86-64

nanodisort-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (227.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

nanodisort-0.2.0-cp310-cp310-macosx_11_0_arm64.whl (212.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

nanodisort-0.2.0-cp310-cp310-macosx_10_13_x86_64.whl (226.2 kB view details)

Uploaded CPython 3.10macOS 10.13+ x86-64

nanodisort-0.2.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (227.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

nanodisort-0.2.0-cp39-cp39-macosx_11_0_arm64.whl (212.9 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

nanodisort-0.2.0-cp39-cp39-macosx_10_13_x86_64.whl (226.6 kB view details)

Uploaded CPython 3.9macOS 10.13+ x86-64

File details

Details for the file nanodisort-0.2.0.tar.gz.

File metadata

  • Download URL: nanodisort-0.2.0.tar.gz
  • Upload date:
  • Size: 378.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nanodisort-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f1d5d58ca03cf38d73e89bb9de12a252977a4d677d94af74b7d2e836d9b40e03
MD5 7fe6b3bb1be1fff0ff605d8b7cc8e001
BLAKE2b-256 1331afe991b64a9fc2a84a87e2f192598508ec6613ea9cc51a1743f6299b8324

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0.tar.gz:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 449741971b8742d84c0172c025c560974523d4e50b0f0b3fb99bb9a6d492c08b
MD5 9082a91333576ee55fa041601181980d
BLAKE2b-256 90bd28b01375351efaabbc31dd42b7a0838cf68fa69977ada3fc6545102f9560

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 407fe3111fd2c0a6066d6836d840516bdccb9cb6314d61b8d0d0a4f943f593b8
MD5 9a98a797133244631bbd39e6bf1ecb9f
BLAKE2b-256 8ef2e4deb37635758300f208065df7126c6de114a3bdd5367d5325fb96e22aae

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 37d9fdf92962184e3bfc306fb7cc4a4b7d5f97a64156d356f07fd75024d56b5b
MD5 2a4281f7940bb9436bef7fe48c47af9c
BLAKE2b-256 b304286c123aafaa621edb3f7b8684e9d1ed2c73cba0493271f31073ce26d415

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp313-cp313-macosx_10_13_x86_64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6895d5b9391eeaa408dc4ba66a4e56f32ee81abaf8d781a92a0c018f06e35059
MD5 53afb63809d1c5d3a95d87aaebc912d7
BLAKE2b-256 76373b3b112cb6df0823317ba636bdde0ebba14e6496005df0fbb810f71ffe6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7038b5493401662a8831da17fb456b7741585683a42a8d848dcb65083e77aaf0
MD5 c13e92e204de238e213b03944c9bc9d1
BLAKE2b-256 fc341bd89623f6627e65325d8c16645960238414151e04ef20b57110645a81c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 c6d092f0ea7d94686d8d89438a14c030b84ba46294cfc658dde3b909060254d9
MD5 be1d065a1e3047a50411e00f364d1e18
BLAKE2b-256 f57470c0417419f4d4b19877d86fde3d62b6bf7b6d1eff80427d67911c2c0bb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp312-cp312-macosx_10_13_x86_64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 faea45ae70e819d4eb7f125f99847f44d0dc658be0582d89aafc0c2d77865313
MD5 6f4923e1fca4b31640839806e8b05c4d
BLAKE2b-256 9596489f348503841dec1ee4ed4b60de70e829357cb565dc32cf3b4c5ef39d7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c27b5c42ef7a980f204b78364400955f65be251dabc45364d9772a455fd0016b
MD5 17433e1c92d9794392cef365f55e4701
BLAKE2b-256 42b414ee1fceda7f01f4805d8c1c25ef234dbfe4816f6b0de7561f264b7c8baf

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp311-cp311-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 fbe5961bf42dd768c7bf2f1b7633a60ab7be78bc85a6f78d0d236a3107e82341
MD5 57428c5b00bd4057fe78dc210801fb49
BLAKE2b-256 6758bd95d4c5eb51f1f3481822f1bf71225be96eaf33b34f4af6c3c4bb602d98

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp311-cp311-macosx_10_13_x86_64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6e16333a8a6846c4fc28ac37c9068caef513817b4257462f5780e8f5531a8404
MD5 4e0052f3afad911e888690684dbbfb0f
BLAKE2b-256 5a0f80c1c0499a1a25b159107fedf025c116da166e2fb0c4367d4f1175a323fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1f242b8b4b5abadee7723892009e1031c20cce3dba93ad0f84220c3e21ed26ea
MD5 bec80725d3baa12349d12c90a34cd5bc
BLAKE2b-256 08269c096725a9b7adf108907bb5c91a27c30dfe8e07df11adeee7f8e222d980

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp310-cp310-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp310-cp310-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 332bcf42704004c442a17966b39c3c26e848b688859a48f27ce97a0819314fa9
MD5 5af96d6a2d180907bff5832f858590ac
BLAKE2b-256 06a0875fc8139a98d75b7607a64a8c4ee155693662e92a89a419ea467636e19a

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp310-cp310-macosx_10_13_x86_64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a828d3b6691925846af4475ea4c8531720a389a0e3650bd38ac3b6d066b6ddac
MD5 ddcbe37c838c6f0837dfb8da927fe8ef
BLAKE2b-256 37bafb9f69e8bc13e6f3be7182c003d9c0ee2c485e786f64ff1fc3022ac7f163

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd5a81822917a250afa12bddfe8d369884dd6e7619219bbd7457b53ea2d67e54
MD5 fdba8e2c16844437ff536248bc26e87d
BLAKE2b-256 1065576a3011c0886e97a9889b85b2b4b40bd7764d6afe0bd428199083caf778

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nanodisort-0.2.0-cp39-cp39-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.2.0-cp39-cp39-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 424421b8f423defef802b3d1af8dfe4b7a60e89b04c8f06aee0b1227e1851f9a
MD5 3eb2905e936043df6a85116fd739255b
BLAKE2b-256 dfe4dc61d4740f3df552e385e6b49044f53b011f1473e0e2e1cd25cafe1d00b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.2.0-cp39-cp39-macosx_10_13_x86_64.whl:

Publisher: build.yml on eradiate/nanodisort

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page