Skip to main content

'Forward and inverse radiative transport using adding-doubling'

Project description

by Scott Prahl

https://img.shields.io/pypi/v/iadpython.svg https://colab.research.google.com/assets/colab-badge.svg https://img.shields.io/badge/readthedocs-latest-blue.svg https://img.shields.io/badge/github-code-green.svg https://img.shields.io/badge/BSD-license-yellow.svg https://github.com/scottprahl/iadpython/actions/workflows/test.yml/badge.svg

iadpython will be a pure Python module to do forward and inverse multiple light scattering (radiative transport) in layered materials. Calculations are done using van de Hulst’s adding-doubling technique.

The original adding-doubling algorithm was developed by van de Hulst to model light propagation through layered media. I extended it to handle Fresnel reflection at boundaries as well as interactions with integrating spheres.

Finally, the code was further extended to handle lost light using Monte Carlo techniques for inverse calculations.

Version v0.4.0 started the migration to a pure-python implementation. This version includes the ability to do forward calculations of light transport through layered 1D structures.

The long-term goal is rewrite the integrating sphere, inverse algorithm, and lost light calculations in pure python so that one can do inverse calculations (i.e., reflection and transmission measurements to intrinsic absorption and scattering properties).

Both inverse and forward calculations are currently possible using the iadc framework. This is a python interface to the inverse adding-doubling package written in C by Scott Prahl <https://github.com/scottprahl/iad>. This works now but is a nuisance to install and maintain because of its dependence on compiling and installing a C library.

See <https://iadpython.readthedocs.io> for full documentation of iadpython.

Usage

The following will do a forward calculation:

import iadpython as iad

mu_s = 10  # scattering coefficient [1/mm]
mu_a = 0.1 # absorption coefficient [1/mm]
g = 0.9    # scattering anisotropy
d = 1      # thickness mm

a = mu_s/(mu_a+mu_s)
b = mu_s/(mu_a+mu_s) * d

# air / glass / sample / glass / air
s = iadpython.Sample(a=a, b=b, g=g, n=1.4, n_above=1.5, n_below=1.5)
ur1, ut1, uru, utu = s.rt()

print('Collimated light incident perpendicular to sample')
print('  total reflection = %.5f' % ur1)
print('  total transmission = %.5f' % ut1)

print('Diffuse light incident on sample')
print('  total reflection = %.5f' % uru)
print('  total transmission = %.5f' % utu)

Installation

To install:

pip3 install iadpython

If you just want to do forward calculations then you’re done.

If you want to do inverse calculations, then you’ll need to build and install the libiad library:

git clone https://github.com/scottprahl/iad.git
cd iad
# edit Makefile as needed
make install-lib

Dependencies

Required Python modules: numpy, matplotlib, ctypes, scipy

License

iadpython is licensed under the terms of the MIT license.

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

iadpython-0.4.1.tar.gz (544.6 kB view details)

Uploaded Source

Built Distribution

iadpython-0.4.1-py3-none-any.whl (45.1 kB view details)

Uploaded Python 3

File details

Details for the file iadpython-0.4.1.tar.gz.

File metadata

  • Download URL: iadpython-0.4.1.tar.gz
  • Upload date:
  • Size: 544.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/57.4.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.7

File hashes

Hashes for iadpython-0.4.1.tar.gz
Algorithm Hash digest
SHA256 6ea0bf98295add670709452b43b8d21a680bf7a27862e42f9570779fc4f9f66b
MD5 e6b78cccc2cf99f296aac0b5c2c6d3d3
BLAKE2b-256 b57a99b5e9f36a6e1ff82592963ba8d8293ab682442675c1608e2ea9a2cf7e7a

See more details on using hashes here.

File details

Details for the file iadpython-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: iadpython-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 45.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/57.4.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.7

File hashes

Hashes for iadpython-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e101cf3151868f06d40e4dd9b9a8d13c37320759bd1019f865325448911adee0
MD5 ec506bc45394729f8534dd4a4827892b
BLAKE2b-256 0f1ad1d122b667127d8cc0ecb5bfbe8f17e6e498f97913276e24d317e4bbb698

See more details on using hashes here.

Supported by

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