Skip to main content

KISS SciPy-based CCN activation model

Project description

☁️ KISS SciPy-based CCN activation model

PyPI version

📌 overview

ccnact is a simple, yet complete, adiabatic/hydrostatic air-parcel framework employing moving-sectional/particle-resolved aerosol-cloud microphysics, featuring:

  • 🧮 integration using SciPy's LSODA interface
  • 📝 ODE system based on Arabas & Shima 2017 (extended to polydisperse aerosol size spectrum)
  • 🏁 wet radii equilibration for input dry-size distribution using SciPy's elementwise scalar optimisation
  • 🌪️ capable of resolving aerosol activation, deactivation, drop growth, evaporation and ripening
  • ⚙️ single-function interface allowing to modify every single constants, and returning a tuple of:
    • concentration of activated droplets (at STP)
    • maximal supersaturation
  • 🧩 effective interfacing options for Matlab, Julia, etc
  • 📈 mulit-modal lognormal (using SciPy's stats routines) spectrum specification (with concentration interpretted as at STP)
  • ⚖️ implemeted using Pint dimensional analysis (physical units consistency checks) enabled for tests only
  • 🚀 subsecond execution times for common parameter settings
  • 🔗 KISS design: SciPy, NumPy & Pint are the only dependencies; single ~500 LOC file (physics + setup + tests)

The last four points motivated the development of this package - the project originated from a search for a simple, lightweight (in dependencies) and fast CCN activation air-parcel model with concise code, automated testing and no hardcoded constants.

💻 notes for users

To install the package, try: pip install ccnact

Using from Python:

from ccnact import parcel
help(parcel)
n_act, s_max = parcel(...)

Interfacing from Matlab (using the built-in Python bridge):

ccnact = py.importlib.import_module('ccnact');
ccnact.parcel(pyargs(...
   'MAC', 1,...
   'n_bins', int32(100),...
   'p', 101300,...
   'T', 300,...
   'RH', .99,...
   'dt', 1,...
   'nt', int32(100),...
   'w', 2,...
   'sigma', 0.072,...
   'kappa', py.tuple({1}),...
   'meanr', py.tuple({3e-8}),...
   'gstdv', py.tuple({1.5}),...
   'n_tot', py.tuple({1e9})...
))

⚙ notes for developers

To execute the tests after checking out from git: pip install -e .[dev]; pytest ccnact.py

To set-up pre-commit: pip install pre-commit; pre-commit install

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

ccnact-0.0.5.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

ccnact-0.0.5-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file ccnact-0.0.5.tar.gz.

File metadata

  • Download URL: ccnact-0.0.5.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ccnact-0.0.5.tar.gz
Algorithm Hash digest
SHA256 4910271b669428c5ce70e21274f8c0a16c8d0dfe64bcb8fc7ceaaa4908db1495
MD5 37bb35768f00e02d80cc6aaaba9efe0c
BLAKE2b-256 ca55d966f8b5a6a83ad29a5ee63e5a7eb421b5a155352311be02901d03f702fc

See more details on using hashes here.

File details

Details for the file ccnact-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: ccnact-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ccnact-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4e8731717831adfba9044810bd54cf40b0946506c94e5fb1b030f4e8c67a7526
MD5 d408f11d6882f4a56a57185566190e9a
BLAKE2b-256 84372dbb01adb0d450c68d79662a00d16aedcf0394c9a727b535eb27960cec6e

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