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.1.0.tar.gz (375.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.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (224.5 kB view details)

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

nanodisort-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (209.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

nanodisort-0.1.0-cp313-cp313-macosx_10_13_x86_64.whl (224.0 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

nanodisort-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (224.5 kB view details)

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

nanodisort-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (210.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

nanodisort-0.1.0-cp312-cp312-macosx_10_13_x86_64.whl (224.1 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

nanodisort-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (225.6 kB view details)

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

nanodisort-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (211.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

nanodisort-0.1.0-cp311-cp311-macosx_10_13_x86_64.whl (224.7 kB view details)

Uploaded CPython 3.11macOS 10.13+ x86-64

nanodisort-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (225.8 kB view details)

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

nanodisort-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (211.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

nanodisort-0.1.0-cp310-cp310-macosx_10_13_x86_64.whl (224.9 kB view details)

Uploaded CPython 3.10macOS 10.13+ x86-64

nanodisort-0.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (226.0 kB view details)

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

nanodisort-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (211.6 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

nanodisort-0.1.0-cp39-cp39-macosx_10_13_x86_64.whl (225.1 kB view details)

Uploaded CPython 3.9macOS 10.13+ x86-64

File details

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

File metadata

  • Download URL: nanodisort-0.1.0.tar.gz
  • Upload date:
  • Size: 375.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.1.0.tar.gz
Algorithm Hash digest
SHA256 7c36007d56084d26d83a76e1392a0969ccd2819fe45f8e83830650539cce6ee9
MD5 de85fc78a474d723ba1b1f1e14570408
BLAKE2b-256 81fa7edf4cfa1ff56b338e55834e67bfa519279295b77a2d28c65ac78c4a2f62

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 523e3797b0368be9291a15d8722f0242ba068c93c48a1a33a23afcf64702809f
MD5 55664d8c6b36fcca92e1cc828c8f5f91
BLAKE2b-256 45695f3682af61cb64aed594054c554e19ee069de3238f5f9c2f37806dafeb07

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cb0e53f426f530709ce024f407e3052d6e0f43c386df14ce2dcc4ad25ba9ee7c
MD5 b88523af85706e70f62df61ae7f502e3
BLAKE2b-256 d42f976f7117848e8ecd5492a3da75c5d7bf391d93badc7d25c781ba82f773ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 b33357ef6bee22334d72c8d91b49cfe8bc52fa1471a9dffe259081df74a84896
MD5 5adea979892e92d958929411aaeb5907
BLAKE2b-256 67abf4149cd10c21be04e25e4efd55b7d81414746bde4c337ae1b094ca49eda5

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 44defe98292ea7e8e8dfe4602ca8c71e3990a5367343b93471efe42e77401ad8
MD5 6a2739af19110bb6514ea35585262f41
BLAKE2b-256 0c2d1dcc35a4b7c83be40af44fa138e99887e5d9d00b5b89fcc617742db36cd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e57afed9fedf364f90bcc2f748f2450f306d6a4d3bf2a60be03cecc67d751275
MD5 3389497ea0b8ec3bcc0dc5537d27b056
BLAKE2b-256 57199c99622ca1a40f67b56838039c2c7613e4417584adf4c820e091c91236f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 803b88d294a4eeae7381246855f86bb8c4b7dde715dbe5f81bbd2c3b7eb579d3
MD5 cad168005ad2345882f3a64ae60d23c1
BLAKE2b-256 edb116c2b292a013d17d36ec07cf3ad4a070a5d1b702171559fa9dd74f71c24d

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 38a35e95a30fa9a2162ef54808c43b05f6c33c43657b00a01450aa6723f5046b
MD5 1273e77bfef84fe452fea3f3d96b4cb2
BLAKE2b-256 18bff45be2c41def2c718a1485f641c081ee9cd1aef2ad71a5e7a19000cf71ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2d39b0497292414bb4209ac78959371d7d30e5fa241394e9cc637f6254cc7480
MD5 400d90219e30ed95cc162d2e3cfada4b
BLAKE2b-256 602cae126b1b3882cd6f328a5c5e23760413f648d2dab16fff9531770fd4e6f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp311-cp311-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 1273a287837c7b6224c42a1f3b731dfc5e1111fd7aff7bfbacb27aee379d90bb
MD5 5e9d9b7672d3b7ca4d9fa8d4f8d7e9b3
BLAKE2b-256 9ead0e925b807d8639c11a7796e1290e4d2eb97d56e3ee0e3f05241401b90f72

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 967f72eb915b276c61026ab31c5fb651d8c16fcde4765b02f88f950b114864a9
MD5 37e175da5144d568922b494166ab6ead
BLAKE2b-256 6487240fafad8aee49ae68d61e1d9c40fd67d6d973c16c2c3af0bea6f4c6a7a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 60f1ffdf8c2e5c99a99f4f8b8f339d43f285c9523480ca0539e23f6072f8e959
MD5 8cf61034248278e6c2f3d921eb3628a0
BLAKE2b-256 f24e4d562bcd75fb79bb859d5c0907aeb0ea7eca0fe70223cef3eca30f910c50

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp310-cp310-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp310-cp310-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 644f7b4eb6bfdd482ad3353a18890467fe5c47ad7f949c106d8f01ce8e51245e
MD5 0745b0c1789fcd61e4b6009afb0b1581
BLAKE2b-256 87f7082dfa8a6a70759c496756c8686728d0bdc3d3adfbaf5d4d2b5e0ef607fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fbed40098eb2296f206ecf79673aea3fe17e0df85271183d029d0b28f1de6dee
MD5 63a71c3762dd781de9aaee15ef9b00b0
BLAKE2b-256 6b7c22a287f67d77a330c99ff0d9bdff303e2723636a33f1e4873afd705bd8f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bb50e03af96ef8af4d7fb8327003740fd7f684c8d08ca009695884b15df61244
MD5 91ab9100a9f16e9dddbaf722238baeb5
BLAKE2b-256 6d5483484c50969fcd7e44de8418030d24823a812470a09c1670fadc9655bf3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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.1.0-cp39-cp39-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for nanodisort-0.1.0-cp39-cp39-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 8fb888173ea14a7afaa2694c7438c607a2c307874126a584e26c68ae4bd93cc8
MD5 10f35f3d024d90e895cb1e1a2ae3eb91
BLAKE2b-256 ef54e6cabcb26dcd0a03291a0a720bf7c328be687763eb63077fd43b17ccbb63

See more details on using hashes here.

Provenance

The following attestation bundles were made for nanodisort-0.1.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