How astro-jingtao/bhmie-py works
bhmiepy is a Python interface to classic BHMIE Mie-scattering, with a vectorized single-sphere API and a dust-population averaging pipeline. Users call the package API; single-sphere requests reach the compiled Fortran routine, while dust requests interpolate material data, prepare size distributions, evaluate sphere scattering across size bins, and aggregate population properties. The dust module also parses upstream parameter files. Some Fortran implementation details were not excerpted, so the binding-to-core link is shown as unverified.
Main entry points: dust.py Dust Computation · mie.py Sphere API · __init__.py Public API · bhmiepy_ext.f90 Extension Binding
Components 11
Python API
- Public API
src/bhmiepy/__init__.py
Sphere Scattering
- Sphere API
src/bhmiepy/mie.py - BHMIE Routine
src/bhmiepy/_fortran/bhmie.f90 - Extension Binding
src/bhmiepy/_fortran/bhmiepy_ext.f90
Dust Populations
- Dust Computation
src/bhmiepy/dust.py - Material Interpolation
src/bhmiepy/dust.py - Size Distributions
src/bhmiepy/dust.py - Parameter Reader
src/bhmiepy/dust.py - Dust Properties
src/bhmiepy/dust.py
Numerical Support
- Log-Log Math
src/bhmiepy/_loglog.py
Other components
- Python User
Connections 14
- Python User → Public API: calls
README.md - Public API → Sphere API: exposes
src/bhmiepy/__init__.py - Public API → Dust Computation: exposes
src/bhmiepy/__init__.py - Sphere API → Extension Binding: calls
src/bhmiepy/mie.py - Extension Binding → BHMIE Routine: dispatches
- Python User → Sphere API: requests
README.md - Dust Computation → Material Interpolation: interpolates
src/bhmiepy/dust.py - Dust Computation → Size Distributions: normalizes
src/bhmiepy/dust.py - Dust Computation → Sphere API: uses scattering
README.md - Material Interpolation → Log-Log Math: interpolates with
src/bhmiepy/dust.py - Size Distributions → Log-Log Math: integrates with
src/bhmiepy/dust.py - Dust Computation → Dust Properties: produces
src/bhmiepy/dust.py - Python User → Parameter Reader: provides file
README.md - Parameter Reader → Dust Computation: supplies inputs
README.md