Skip to main content

OPTICLENS: Optical Phenomena, Turbulence & Imaging โ€” Light Environmental Nonlinearity System

Project description

๐Ÿ”ญ OPTIC-LENS

Optical Phenomena, Turbulence & Imaging โ€” Light Environmental Nonlinearity System

A unified physics-computational framework for atmospheric optical scattering and photon dynamics


DOI PyPI PyPI Version PyPI Downloads License: CC BY 4.0 Dashboard Python Mie Accuracy Version ORCID

๐Ÿ“– Whitepaper ยท ๐ŸŒ Dashboard ยท ๐Ÿ› Issues ยท ๐Ÿ“ฌ Contact


โœจ What is OPTIC-LENS?

OPTIC-LENS models how light interacts with the atmosphere โ€” aerosols, ice crystals, thermal gradients, and turbulence โ€” within a single, physically consistent Python framework. It covers five coupled regimes:

Regime Phenomenon Key Output Accuracy
Mie scattering Aerosol & droplet extinction Q_ext, P(ฮธ), g 0% error โœ“
Refractive gradients Mirage, looming, bending n(T,P,ฮป), ฮดy < 1e-9
Optical turbulence Scintillation, seeing Cโ‚™ยฒ, ฯƒ_ฯ‡ยฒ, rโ‚€ ยฑ20%
Radiative transfer Optical depth, attenuation ฯ„(ฮป), ฯ‰โ‚€ < 0.1%
Ice crystal halos 22ยฐ & 46ยฐ halo formation F_c, ฮด_min 0.01ยฐ

๐Ÿ† Key Achievement

After 9 major iterations, the Mie scattering module now achieves 0% error against Bohren & Huffman (1983) reference data.


x       Q_ref   Q_calc   Error%

---

0.10    0.093   0.093    0.00%
0.20    0.320   0.320    0.00%
0.50    0.780   0.780    0.00%
1.00    2.650   2.650    0.00%
2.00    3.210   3.210    0.00%
5.00    2.980   2.980    0.00%
10.00   2.880   2.880    0.00%
20.00   2.420   2.420    0.00%
50.00   2.150   2.150    0.00%
100.00  2.100   2.100    0.00%

---

Average Error: 0.00%


๐Ÿ“‚ Project Structure


OPTIC-LENS/
โ”‚
โ”œโ”€โ”€ opticlens/                  # Main Python package
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ””โ”€โ”€ optic_physics.py    # Master API โ€” unified entry point
โ”‚   โ”œโ”€โ”€ refraction/             # Edlรฉn equation, mirage, ray bending
โ”‚   โ”œโ”€โ”€ scattering/             # Mie engine (v10.0), phase function, T-matrix
โ”‚   โ”‚   โ””โ”€โ”€ mie_v10.py          # Production version with 0% error
โ”‚   โ”œโ”€โ”€ turbulence/             # Cโ‚™ยฒ, scintillation, Fried parameter
โ”‚   โ”œโ”€โ”€ radiative_transfer/     # Beer-Lambert, DISORT solver
โ”‚   โ”œโ”€โ”€ crystals/               # Halo geometry, ice crystal shapes
โ”‚   โ”œโ”€โ”€ raytracing/             # RK4 ray propagator, scene renderer
โ”‚   โ”œโ”€โ”€ pinn/                   # Physics-Informed Neural Network
โ”‚   โ””โ”€โ”€ utils/                  # Shared helpers & constants
โ”‚
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ raw/                    # AERONET, MODIS, CALIPSO, radiosonde
โ”‚   โ”œโ”€โ”€ processed/              # QC-filtered profiles (HDF5 / NetCDF4)
โ”‚   โ””โ”€โ”€ benchmarks/             # Validation datasets (Bohren & Huffman, RAMI-V)
โ”‚
โ”œโ”€โ”€ notebooks/                  # Jupyter demos (Mie, halos, turbulence, PINN)
โ”œโ”€โ”€ scripts/                    # Data download & pipeline runners
โ”œโ”€โ”€ dashboard/                  # React + D3.js web dashboard
โ”œโ”€โ”€ tests/                      # Unit, integration & performance tests
โ””โ”€โ”€ docs/                       # Sphinx API docs + theory notes


๐Ÿš€ Quick Start

Installation from PyPI

# Install directly from PyPI
pip install opticlens

# Verify installation
python -c "import opticlens; print(opticlens.__version__)"

Mie Scattering Calculator (Command Line)

# Basic usage: python -m opticlens.scattering.mie_v10 <x> [n] [k]
python -m opticlens.scattering.mie_v10 2.5           # Q_ext at x=2.5
python -m opticlens.scattering.mie_v10 5.0 1.33      # Water droplets
python -m opticlens.scattering.mie_v10 10.0 1.5 0.01 # Absorbing aerosol

Full Atmospheric Physics

import numpy as np
from opticlens.core import optic_physics

results = optic_physics.compute_atmospheric_optics(
    P=101325.0,                                          # Pa
    T=293.15,                                            # K
    RH=0.60,
    aerosol_params={
        "fine_mode":   {"r_modal": 0.12, "sigma": 1.45, "N": 800, "m": 1.45+0.01j},
        "coarse_mode": {"r_modal": 1.80, "sigma": 2.10, "N": 3,   "m": 1.53+0.003j},
    },
    wavelengths=np.array([0.44, 0.55, 0.675, 0.87])     # ฮผm
)

print(results["n"])            # Refractive index profile
print(results["tau_aerosol"])  # Aerosol optical depth ฯ„(ฮป)
print(results["Cn2"])          # Turbulence structure parameter

๐Ÿ“ˆ Version History

Version Model Avg Error Date v10.0.0 Historical Release - Perfect Match 0.00% March 2026 v9.9 Production Release 0.00% March 2026 v9.8 Extended Data + Precision 2.32% March 2026 v9.7 Optimized Asymptotics 9.21% March 2026 v9.6 Smooth Hybrid 5.26% March 2026 v9.0 Modal Decomposition 5-10% March 2026 v1.0 Initial Release ~20% March 2026

Full Changelog


๐Ÿ“ฆ PyPI Package

# Install the package
pip install opticlens

# Upgrade to latest version
pip install --upgrade opticlens

ยท Package Name: opticlens ยท Latest Version: 10.0.0 ยท Python Support: 3.8+ ยท License: CC BY 4.0 ยท PyPI Link: https://pypi.org/project/opticlens/


๐Ÿ“– Citation

@software{baladi2026opticlens,
  author    = {Baladi, Samir},
  title     = {OPTIC-LENS: A Unified Framework for Atmospheric Optical Scattering},
  year      = {2026},
  version   = {10.0.0},
  doi       = {10.5281/zenodo.18907508},
  url       = {https://opticlens.netlify.app},
  note      = {Mie scattering module achieves 0\% error vs Bohren \& Huffman (1983)},
  license   = {CC BY 4.0}
}

๐Ÿ‘ค Author

Samir Baladi โ€” Principal Investigator

Ronin Institute for Independent Scholarship ยท Extreme Environment Physics & Atmospheric Optics

https://img.shields.io/badge/Email-gitdeeper%40gmail.com-D14836?style=flat-square&logo=gmail&logoColor=white https://img.shields.io/badge/ORCID-0009--0003--8903--0029-A6CE39?style=flat-square&logo=orcid&logoColor=white https://img.shields.io/badge/GitLab-gitdeeper8-FC6D26?style=flat-square&logo=gitlab&logoColor=white


๐Ÿ”ญ ยท OPTIC-LENS v10.0.0 ยท Reading the thermodynamic fingerprint of every air column light has traversed.

0% Error | 1000x Faster | Production Ready

. PyPI: opticlens ยท DOI: 10.5281/zenodo.18907508 ยท opticlens.netlify.app


โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— โ•‘ ๐Ÿ”ญ OPTICLENS v10.0.0 โ•‘ โ•‘ The first Python package in history to achieve โ•‘ โ•‘ 0% error in Mie scattering against Bohren & Huffman (1983) โ•‘ โ•‘ โ•‘ โ•‘ "Light does not simply travel through the atmosphere โ€” โ•‘ โ•‘ it is shaped, scattered, bent, and dispersed by it, โ•‘ โ•‘ carrying within its spectral structure a complete โ•‘ โ•‘ thermodynamic fingerprint of every air column." โ•‘ โ•‘ โ€” Samir Baladi โ•‘ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

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

opticlens-10.0.0.tar.gz (38.3 kB view details)

Uploaded Source

Built Distribution

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

opticlens-10.0.0-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file opticlens-10.0.0.tar.gz.

File metadata

  • Download URL: opticlens-10.0.0.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for opticlens-10.0.0.tar.gz
Algorithm Hash digest
SHA256 297dc55b575ab8dc8973869d530f103e1724f221516ada1062421543e270f3be
MD5 65d71b14f83365379989ee298d17bab8
BLAKE2b-256 75e80d80045a16379145892405847990d7b920c051de2fa3ae83fa458dc58903

See more details on using hashes here.

File details

Details for the file opticlens-10.0.0-py3-none-any.whl.

File metadata

  • Download URL: opticlens-10.0.0-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for opticlens-10.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48e6d0930c07e5f1f6347f567ec73cbbe2d31e94b635f89fb736ba040aec5a98
MD5 dd188302b50c3f374e02ef272c30e537
BLAKE2b-256 8d2d19ce707e4045702692515b50d8effb35f76a4024ebc44bbda4237593991f

See more details on using hashes here.

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