radphen-iadpython 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,264 @@
1
+ Metadata-Version: 2.4
2
+ Name: radphen-iadpython
3
+ Version: 0.7.0
4
+ Summary: Forward and inverse radiative transport using adding-doubling
5
+ Author-email: Scott Prahl <scott.prahl@oit.edu>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/PanxoPanza/iadpython
8
+ Project-URL: Documentation, https://iadpython.readthedocs.io
9
+ Project-URL: Source, https://github.com/PanxoPanza/iadpython
10
+ Project-URL: Tracker, https://github.com/PanxoPanza/iadpython/issues
11
+ Project-URL: Changelog, https://github.com/PanxoPanza/iadpython/blob/main/docs/CHANGELOG.rst
12
+ Keywords: absorption,scattering,reflection,transmission,optical properties,radiative transport,scattering coefficient,scattering anisotropy
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Topic :: Scientific/Engineering
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Requires-Python: <3.15,>=3.10
24
+ Description-Content-Type: text/x-rst
25
+ License-File: LICENSE.txt
26
+ Requires-Dist: scipy>=1.10
27
+ Requires-Dist: numpy>=1.24
28
+ Requires-Dist: pandas>=1.5
29
+ Requires-Dist: matplotlib
30
+ Provides-Extra: docs
31
+ Requires-Dist: Sphinx==8.1.3; extra == "docs"
32
+ Requires-Dist: nbsphinx==0.9.7; extra == "docs"
33
+ Requires-Dist: sphinx_automodapi; extra == "docs"
34
+ Requires-Dist: sphinx_rtd_theme; extra == "docs"
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest; extra == "dev"
37
+ Requires-Dist: imageio; extra == "dev"
38
+ Requires-Dist: requests; extra == "dev"
39
+ Requires-Dist: ruff; extra == "dev"
40
+ Requires-Dist: yamllint; extra == "dev"
41
+ Requires-Dist: rstcheck; extra == "dev"
42
+ Requires-Dist: pylint; extra == "dev"
43
+ Requires-Dist: pyroma; extra == "dev"
44
+ Requires-Dist: black[jupyter]; extra == "dev"
45
+ Requires-Dist: build; extra == "dev"
46
+ Requires-Dist: check-manifest; extra == "dev"
47
+ Requires-Dist: libarchive-c; extra == "dev"
48
+ Requires-Dist: pyyaml; extra == "dev"
49
+ Requires-Dist: setuptools; extra == "dev"
50
+ Requires-Dist: jupyterlab; extra == "dev"
51
+ Requires-Dist: nbconvert; extra == "dev"
52
+ Requires-Dist: nbformat; extra == "dev"
53
+ Provides-Extra: lite
54
+ Requires-Dist: jupyterlite-core==0.6.4; extra == "lite"
55
+ Requires-Dist: jupyterlite-pyodide-kernel==0.6.1; extra == "lite"
56
+ Dynamic: license-file
57
+
58
+ radphen-iadpython
59
+ =================
60
+
61
+ This is the MIT-licensed RadPhen fork of Scott Prahl's iadpython, maintained
62
+ at https://github.com/PanxoPanza/iadpython for empylib. Distribution version
63
+ 0.7.0 retains the original ``iadpython`` import namespace and ``iadp``
64
+ command. The distribution name alone is ``radphen-iadpython``.
65
+
66
+ Install with ``python -m pip install radphen-iadpython``. For example::
67
+
68
+ import iadpython as iad
69
+ sample = iad.Sample(a=0.9, b=1.0, g=0.5)
70
+ print(sample.rt())
71
+
72
+ The fork preserves HG, TABULATED and MOMENTS phase functions, complex sample
73
+ and exterior boundary indices, and diffuse-cone transport from the audited
74
+ source. See PROVENANCE.md for the exact source and release procedure.
75
+ Both distributions provide ``iadpython`` and ``iadp``; install this fork in a
76
+ fresh environment without the upstream ``iadpython`` distribution. They cannot
77
+ coexist safely in one environment because their package paths overlap.
78
+
79
+ Original upstream README (historical attribution)
80
+ =================================================
81
+
82
+ .. |pypi| image:: https://img.shields.io/pypi/v/iadpython?color=68CA66
83
+ :target: https://pypi.org/project/iadpython/
84
+ :alt: pypi
85
+
86
+ .. |github| image:: https://img.shields.io/github/v/tag/scottprahl/iadpython?label=github&color=68CA66
87
+ :target: https://github.com/scottprahl/iadpython
88
+ :alt: github
89
+
90
+ .. |conda| image:: https://img.shields.io/conda/vn/conda-forge/iadpython?label=conda&color=68CA66
91
+ :target: https://github.com/conda-forge/iadpython-feedstock
92
+ :alt: conda
93
+
94
+ .. |doi| image:: https://zenodo.org/badge/102148844.svg
95
+ :target: https://zenodo.org/badge/latestdoi/102148844
96
+ :alt: doi
97
+
98
+ .. |license| image:: https://img.shields.io/github/license/scottprahl/iadpython?color=68CA66
99
+ :target: https://github.com/scottprahl/iadpython/blob/main/LICENSE.txt
100
+ :alt: License
101
+
102
+ .. |test| image:: https://github.com/scottprahl/iadpython/actions/workflows/test.yaml/badge.svg
103
+ :target: https://github.com/scottprahl/iadpython/actions/workflows/test.yaml
104
+ :alt: Testing
105
+
106
+ .. |docs| image:: https://readthedocs.org/projects/iadpython/badge
107
+ :target: https://iadpython.readthedocs.io
108
+ :alt: Docs
109
+
110
+ .. |downloads| image:: https://img.shields.io/pypi/dm/iadpython?color=68CA66
111
+ :target: https://pypi.org/project/iadpython/
112
+ :alt: Downloads
113
+
114
+ iadpython
115
+ =========
116
+
117
+ by Scott Prahl
118
+
119
+ |pypi| |github| |conda| |doi|
120
+
121
+ |license| |test| |docs| |downloads|
122
+
123
+ `iadpython` will be a pure Python module to do forward and inverse multiple light
124
+ scattering (radiative transport) in layered materials. Calculations are done using
125
+ van de Hulst's adding-doubling technique.
126
+
127
+ The original adding-doubling algorithm was developed by van de Hulst to model light
128
+ propagation through layered media. I extended it to handle Fresnel
129
+ reflection at boundaries as well as interactions with integrating spheres.
130
+
131
+ Finally, the code was further extended to handle lost light using
132
+ Monte Carlo techniques for inverse calculations.
133
+
134
+ Version v0.4.0 started the migration to a pure-python implementation. This
135
+ version includes the ability to do forward calculations of light transport through
136
+ layered 1D structures.
137
+
138
+ The long-term goal is rewrite the integrating sphere, inverse algorithm, and
139
+ lost light calculations in pure python so that one can do
140
+ inverse calculations (i.e., reflection and transmission measurements to
141
+ intrinsic absorption and scattering properties).
142
+
143
+ Both inverse and forward calculations are currently possible using the `iadc` framework.
144
+ This is a python interface to the inverse
145
+ adding-doubling package written in C by Scott Prahl
146
+ <https://github.com/scottprahl/iad>. This works now
147
+ but is a nuisance to install and maintain because of its dependence on compiling
148
+ and installing a C library.
149
+
150
+ See <https://iadpython.readthedocs.io> for full documentation of `iadpython`.
151
+
152
+ Differences from upstream iadpython (this fork)
153
+ -----------------------------------------------
154
+
155
+ This fork adds first-class multilayer support and **changes how arrays are
156
+ interpreted** relative to upstream. If you are migrating code, read this
157
+ section.
158
+
159
+ **Layer API.** A multilayer sample is built from explicit ``Layer`` objects;
160
+ each layer may have its own refractive index (large index mismatches between
161
+ layers are handled exactly, including total internal reflection), its own
162
+ Henyey-Greenstein anisotropy *or* tabulated phase function, and its own
163
+ wavelength dependence::
164
+
165
+ import numpy as np
166
+ import iadpython as iad
167
+
168
+ l0 = iad.Layer(a=0.95, b=0.84, g=0.20, n=1.35, d=0.10)
169
+ l1 = iad.Layer(a=0.81, b=0.31, g=0.85, n=2.00, d=0.05)
170
+ l2 = iad.Layer(a=0.90, b=1.00, n=1.45, pf_type='TABULATED', pf_data=df)
171
+
172
+ s = iad.Sample(layers=[l0, l1, l2], n_above=1.5, quad_pts=16)
173
+ ur1, ut1, uru, utu = s.rt()
174
+
175
+ **Axis rule.** The two axes of a simulation are now structurally distinct
176
+ and cannot be confused:
177
+
178
+ * *layer axis* = position in the ``layers`` list;
179
+ * *wavelength axis* = arrays **inside** each attribute (``a``/``b``/``g``/``n``
180
+ of a ``Layer`` may each be a scalar or a wavelength array; a ``TABULATED``
181
+ phase function holds one ``pf_data`` column per wavelength). Scalar-valued
182
+ layers are automatically held constant across the sweep.
183
+
184
+ **Breaking change.** Upstream allowed ``sample.a = np.array([...])`` followed
185
+ by ``rt_matrices()`` to mean *layers* while the same array passed to ``rt()``
186
+ meant *wavelengths*. That ambiguity is removed: flat arrays on ``a``/``b``/``g``
187
+ now **always mean wavelengths**, and array-valued ``n`` on a flat sample is an
188
+ error. Code using the old flat-arrays-as-layers form fails with::
189
+
190
+ RuntimeError: array-valued a/b/g now mean wavelengths, not layers; build a
191
+ multilayer sample with iadpython.Sample(layers=[iadpython.Layer(...), ...])
192
+
193
+ Classic single-layer usage (scalars, or wavelength arrays with ``rt()``) is
194
+ unchanged, as are all inverse-calculation entry points.
195
+
196
+ Usage
197
+ -----
198
+
199
+ The following will do a forward calculation::
200
+
201
+ import iadpython as iad
202
+
203
+ mu_s = 10 # scattering coefficient [1/mm]
204
+ mu_a = 0.1 # absorption coefficient [1/mm]
205
+ g = 0.9 # scattering anisotropy
206
+ d = 1 # thickness mm
207
+
208
+ a = mu_s/(mu_a+mu_s)
209
+ b = (mu_a+mu_s) * d
210
+
211
+ # air / glass / sample / glass / air
212
+ s = iadpython.Sample(a=a, b=b, g=g, n=1.4, n_above=1.5, n_below=1.5)
213
+ ur1, ut1, uru, utu = s.rt()
214
+
215
+ print('Collimated light incident perpendicular to sample')
216
+ print(' total reflection = %.5f' % ur1)
217
+ print(' total transmission = %.5f' % ut1)
218
+
219
+ print('Diffuse light incident on sample')
220
+ print(' total reflection = %.5f' % uru)
221
+ print(' total transmission = %.5f' % utu)
222
+
223
+ `Sample` also accepts tabulated phase-function data via the ``pf_data``
224
+ keyword. When ``pf_type`` is ``'TABULATED'``, ``pf_data`` may hold one column per
225
+ wavelength and must have the same length as other wavelength-dependent inputs.
226
+
227
+
228
+ Installation
229
+ ------------
230
+
231
+ Use ``pip``::
232
+
233
+ pip install iadpython
234
+
235
+ or ``conda``::
236
+
237
+ conda install -c conda-forge iadpython
238
+
239
+ or use immediately by clicking the Google Colaboratory button below
240
+
241
+ .. image:: https://colab.research.google.com/assets/colab-badge.svg
242
+ :target: https://colab.research.google.com/github/scottprahl/iadpython/blob/main
243
+ :alt: Colab
244
+
245
+ Inverse Calculations
246
+ ---------------------
247
+
248
+ As of version 0.5.3, the forward and inverse calculations work fine as long as you do not need to
249
+ include integrating sphere effects or lost-light calculations.
250
+
251
+ If you want to do these, then you're probably best served by downloading and compiling
252
+ the C-code (on unix or macos) or the `.exe` file for Windows. <https://omlc.org/software/iad/>
253
+
254
+
255
+ Dependencies
256
+ ------------
257
+
258
+ Required Python modules: numpy, matplotlib, ctypes, scipy
259
+
260
+
261
+ License
262
+ -------
263
+
264
+ `iadpython` is licensed under the terms of the MIT license.
@@ -0,0 +1,28 @@
1
+ iadpython/__init__.py,sha256=0RjPAM8p5fJQ64zzwS6tW9pI-TL9RCb1yBzBFc1KDhk,1778
2
+ iadpython/ad.py,sha256=VsflOqzks8B3DaDUammY9zDfHHYSiEzBzttwAtpBf-Q,58155
3
+ iadpython/agrid.py,sha256=GxsoD9imS79ZXV_Xm5k3H4k5S-aq54bDnVHcwCdOM4M,10747
4
+ iadpython/cache.py,sha256=T137_YxLEDh5GOMXEbHyf8DKzZNSboIxKMHDl6VqeaE,3744
5
+ iadpython/combine.py,sha256=l5VU72L0JNrVxR8LEOTJOWPo0uEm25MRFMUtoonrFkY,23809
6
+ iadpython/constants.py,sha256=x8PS_FiHLiwPLa_PURf_XJ-tcBksd7mfwpiZMQmsXps,81
7
+ iadpython/double.py,sha256=vSa1e33Dmxrwh51tO3MWVhu2VodGSXMfcAonZswtgio,12999
8
+ iadpython/fresnel.py,sha256=YfClK_V3FXn9XxY6xUVIFA9qNjTy9byz3a0y8Xsl5zk,21837
9
+ iadpython/grid.py,sha256=Oc2w58Cqn_9J8ecZBjL5LSjDbXdV5nwES_K_b42qyAc,3813
10
+ iadpython/iad.py,sha256=bw8ZkEC30QM9rMq_RrLBKJRSVidxgexFu11MVhr_-CY,20656
11
+ iadpython/iadc.py,sha256=th7pziN8sdD_V5ZHnyc-mVQbvU0KOSyIfMMGUXuw4MA,33016
12
+ iadpython/iadcommand.py,sha256=x-UGfNPpPE3l79-FZfbh3h53yC98txbNiY0wMhaQTSY,21625
13
+ iadpython/layer.py,sha256=DT0o5gNrNFKYtR6bGm9IT_kCDjDhxjYY_WanLphk1qg,10157
14
+ iadpython/nist.py,sha256=MiAfL5TtmOsf2OsEh2x96nUmGEHqk1UIhWn9yHBI658,3046
15
+ iadpython/port.py,sha256=vwORubI9GYyzRVW50qJ40XG76TKJNfXI8BeCXq19WS4,9741
16
+ iadpython/quadrature.py,sha256=GVBHp0-AvIU5cv837341ylM9scHSzfDuo1DE1MTIOB8,4876
17
+ iadpython/redistribution.py,sha256=ItdIblYkw4cA5HDkEwtfceLXDzV865L6tfkqzJD6vqk,11534
18
+ iadpython/rxt.py,sha256=bry1HMRLhFJzcO6Anfae0DLccplH7pYAQbqRBpD-PF8,6383
19
+ iadpython/sphere.py,sha256=HpPHQjo2ovqCC5QSXRk31PpwQEMF9W4KrpC9waT2K_0,22340
20
+ iadpython/start.py,sha256=qfXDb1OD3DE-w3GYjWA2D1-OoEJJ3O4pVNpBz7a40mE,13035
21
+ iadpython/txt.py,sha256=wkPPYkJzOBs81cB2hn4vfHezhEaUHO1-BFxNYeVErqY,4501
22
+ iadpython/data/M38597.csv,sha256=zpqsc12dg7S4dLmNRfHr2mgs3A5lL4BO_gCrL84MJdk,2119696
23
+ radphen_iadpython-0.7.0.dist-info/licenses/LICENSE.txt,sha256=g9-BWWRLvMDMQ1Zflxliku7Sleom1_SbXHQHOLGgqqk,1055
24
+ radphen_iadpython-0.7.0.dist-info/METADATA,sha256=HIWciUTXAYAIJpdzG0t6S4VkvHuOqyfIZtGjl5JP4Pk,10267
25
+ radphen_iadpython-0.7.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
26
+ radphen_iadpython-0.7.0.dist-info/entry_points.txt,sha256=JKvuEI8iM3nx0J4zyw1Gs5lxmIx8ZF8hefRyjCtn-ns,51
27
+ radphen_iadpython-0.7.0.dist-info/top_level.txt,sha256=OYHVgl4RKNT4etTl1K8AEnchCeR5O8zru08wrKBwQPg,10
28
+ radphen_iadpython-0.7.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ iadp = iadpython.iadcommand:main
@@ -0,0 +1,18 @@
1
+ Copyright 2017-2021 Scott Prahl
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
+ the Software, and to permit persons to whom the Software is furnished to do so,
8
+ subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ iadpython