Skip to main content

3D aerosol particle modeling and optical property computation

Project description

Aerosol3D

CI Python 3.10+ License: MIT

Aerosol3D is a Python toolkit for modeling the 3D geometry and optical properties of atmospheric aerosol particles. It provides a unified pipeline from geometric construction to Discrete Dipole Approximation (DDA) optical computation.

Features

  • 3D Geometry Modeling — Build spheres, ellipsoids, cubes, and import fractal aggregates
  • Coating Algorithms — Apply distance-based, potential-based, CCM (Closed-Cell Model), and CAM (Coated-Aggregate Model) coatings
  • Optical Computation — Solve optical properties via DDA using a Julia-based backend with optional GPU acceleration
  • Visualization — Generate 3D screenshots and rotation videos using PyVista
  • Material Database — Built-in refractive index data for common aerosol materials
  • Flexible I/O — Export to VTP and voxel formats

Installation

Requires Python >= 3.10.

pip install Aerosol3D

For development:

git clone https://github.com/openEarthModelling/Aerosol3D.git
cd Aerosol3D
pip install -e ".[dev]"

Optional Dependencies

  • Julia backend (required for DDA optical computation): Install Julia and run pip install pyjulia
  • GPU acceleration: Requires CUDA-capable GPU and Julia CUDA packages

Quick Start

from Aerosol3D import (
    AerosolParticle, create_sphere, MixingState,
    preset_material, save_screenshot, solve_optics, SimulationConfig
)

# Create a black carbon sphere
soot = preset_material("black_carbon")
particle = AerosolParticle(
    name="bc_sphere",
    mixing_state=MixingState.INTERNAL,
    unit="nm",
)
particle.add_mesh("core", create_sphere((0, 0, 0), 50.0), soot)

# 3D visualization
save_screenshot(particle, "sphere.png", colors={"core": "black"})

# DDA optical computation
config = SimulationConfig(wavelength=550.0, source="solar")
result = solve_optics(particle, config)
print(f"Extinction efficiency: {result.qext}")

See the examples/ directory for complete workflows including fractal aggregates and coated particles.

Examples

Example Description
black_carbon_sphere.py Bare BC sphere with DDA optics
black_carbon_fractal.py Fractal aggregate via pyFracAggregate with full pipeline

API Overview

Core Classes

  • AerosolParticle — Particle container with multiple meshes/materials
  • MixingState — Internal / external mixing state
  • Material — Refractive index and density
  • FractalAggregate — Fractal aggregate geometry

Geometry

  • create_sphere(center, radius)
  • create_ellipsoid(center, radii)
  • create_cube(center, size)

Coating

  • apply_distance_coating(particle, thickness, material)
  • apply_potential_coating(particle, thickness, material)
  • apply_ccm_coating(particle, thickness, material)
  • apply_cam_coating(particle, thickness, material)

Optics

  • solve_optics(particle, config) — DDA optical solver
  • SimulationConfig(wavelength, source) — Simulation parameters

I/O & Visualization

  • save_screenshot(particle, path)
  • save_rotation_video(particle, path)
  • save_vtp(particle, path) / save_voxel(particle, path)

Development

# Run tests
pytest

# Run tests with coverage
pytest --cov=Aerosol3D --cov-report=term-missing

License

MIT License. See LICENSE for details.

Acknowledgments

DDA optical computation is powered by CEMD.jl via a Python-Julia bridge.

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

aerosol3d-0.2.0.tar.gz (48.0 kB view details)

Uploaded Source

Built Distribution

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

aerosol3d-0.2.0-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

Details for the file aerosol3d-0.2.0.tar.gz.

File metadata

  • Download URL: aerosol3d-0.2.0.tar.gz
  • Upload date:
  • Size: 48.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for aerosol3d-0.2.0.tar.gz
Algorithm Hash digest
SHA256 49b7f57c17c4a050096b29cfdbbf234aa6acdaa86b985b92f096f5e13748ed36
MD5 8ed29ced65358dfe67942cd6f23943ac
BLAKE2b-256 16ef33b042b258f1532678bea0f5726f44044a02a6914e8e80a464bb98f27053

See more details on using hashes here.

File details

Details for the file aerosol3d-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: aerosol3d-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 42.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for aerosol3d-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0676e7c52b20d59ac43e0aea1c6a3c4ed6737be4f6fa20d2e947a2c3bf7f9ac3
MD5 f5bc7a7b2ea04fd45a4fc3b1757d4890
BLAKE2b-256 8a716187ca090b5df6d56eb7394ef686bc5f95a64c486168d07312c579ee325e

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